Install:
yay - S zfs-dkms zfs-utils
systemctl enable -- now zfs-import.target
systemctl enable -- now zfs.target
systemctl enable -- now zfs-import-scan.service
systemctl enable [email protected]
List Disks
ubuntu@ip-172-31-14-48:~ $ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 27.2M 1 loop /snap/amazon-ssm-agent/11320
loop1 7:1 0 73.9M 1 loop /snap/core22/1981
loop2 7:2 0 50.9M 1 loop /snap/snapd/24505
xvda 202:0 0 8G 0 disk
├─xvda1 202:1 0 7G 0 part /
├─xvda14 202:14 0 4M 0 part
├─xvda15 202:15 0 106M 0 part /boot/efi
└─xvda16 259:0 0 913M 0 part /boot
xvdb 202:16 0 4G 0 disk
xvdc 202:32 0 4G 0 disk
xvdd 202:48 0 4G 0 disk
xvde 202:64 0 4G 0 disk
>> > lsblk -d - o NAME,ROTA,PHY-SEC,LOG-SEC,SIZE
NAME ROTA PHY-SEC LOG-SEC SIZE
sda 1 4096 512 9.1T
sdb 1 4096 512 9.1T
sdc 1 4096 512 9.1T
sdd 1 4096 512 9.1T
sde 1 4096 512 9.1T
sr0 1 2048 2048 4.1G
nvme0n1 0 512 512 465.8G
Create RAID-Z
sudo zpool create Totoro raidz /dev/xvdb /dev/xvdc /dev/xvdd /dev/xvde
sudo zfs create - o encryption=on - o keyformat=passphrase - o keylocation=prompt Totoro/raid
sudo zfs load-key Totoro/raid
sudo zfs compression=lz4 Totoro/raid
sudo zfs set atime=off Totoro/raid
Get Drive Info:
sudo zfs list
NAME USED AVAIL REFER MOUNTPOINT
Totoro 325K 11.2G 32.9K /Totoro
Totoro/raid 111K 11.2G 111K /Totoro/raid
zpool status
pool: Totoro
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
Totoro ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
xvdb ONLINE 0 0 0
xvdc ONLINE 0 0 0
xvdd ONLINE 0 0 0
xvde ONLINE 0 0 0
errors: No known data errors
sudo zpool get all Totoro
NAME PROPERTY VALUE SOURCE
Totoro size 15.5G -
Totoro capacity 0% -
Totoro altroot - default
Totoro health ONLINE -
Totoro guid 3429868136221982441 -
Totoro version - default
Totoro bootfs - default
Totoro delegation on default
Totoro autoreplace off default
Totoro cachefile - default
Totoro failmode wait default
Totoro listsnapshots off default
Totoro autoexpand off default
Totoro dedupratio 1.00x -
Totoro free 15.5G -
Totoro allocated 435K -
Totoro readonly off -
Totoro ashift 0 default
Totoro comment - default
Totoro expandsize - -
Totoro freeing 0 -
Totoro fragmentation 0% -
Totoro leaked 0 -
Totoro multihost off default
Totoro checkpoint - -
Totoro load_guid 8979862071442544198 -
Totoro autotrim off default
Totoro compatibility off default
Totoro bcloneused 0 -
Totoro bclonesaved 0 -
Totoro bcloneratio 1.00x -
Totoro feature@async_destroy enabled local
Totoro feature@empty_bpobj active local
Totoro feature@lz4_compress active local
Totoro feature@multi_vdev_crash_dump enabled local
Totoro feature@spacemap_histogram active local
Totoro feature@enabled_txg active local
Totoro feature@hole_birth active local
Totoro feature@extensible_dataset active local
Totoro feature@embedded_data active local
Totoro feature@bookmarks enabled local
Totoro feature@filesystem_limits enabled local
Totoro feature@large_blocks enabled local
Totoro feature@large_dnode enabled local
Totoro feature@sha512 enabled local
Totoro feature@skein enabled local
Totoro feature@edonr enabled local
Totoro feature@userobj_accounting active local
Totoro feature@encryption active local
Totoro feature@project_quota active local
Totoro feature@device_removal enabled local
Totoro feature@obsolete_counts enabled local
Totoro feature@zpool_checkpoint enabled local
Totoro feature@spacemap_v2 active local
Totoro feature@allocation_classes enabled local
Totoro feature@resilver_defer enabled local
Totoro feature@bookmark_v2 enabled local
Totoro feature@redaction_bookmarks enabled local
Totoro feature@redacted_datasets enabled local
Totoro feature@bookmark_written enabled local
Totoro feature@log_spacemap active local
Totoro feature@livelist enabled local
Totoro feature@device_rebuild enabled local
Totoro feature@zstd_compress enabled local
Totoro feature@draid enabled local
Totoro feature@zilsaxattr enabled local
Totoro feature@head_errlog active local
Totoro feature@blake3 enabled local
Totoro feature@block_cloning enabled local
Totoro feature@vdev_zaps_v2 active local
sudo zfs get encryption Totoro/raid
NAME PROPERTY VALUE SOURCE
Totoro/raid encryption aes-256-gcm -
sudo zpool status - v
sudo zpool import
sudo zpool import Totoro
Unmount and remount Drive:
sudo zfs unmount Totoro/raid
sudo zfs unload-key Totoro/raid
sudo zfs get keystatus Totoro/raid
sudo zfs load-key Totoro/raid
sudo zfs get keystatus Totoro/raid
sudo zfs mount Totoro/raid
Permissions:
sudo zfs unmount Totoro/raid
sudo chown root:root /Totoro/raid
sudo chmod 000 /Totoro/raid
ls - ld /Totoro/raid
sudo zfs mount Totoro/raid
sudo chmod 755 /Totoro/raid
sudo chown ubuntu:ubuntu /Totoro/raid
ls - ld /Totoro/raid
Add systemd timer for scrubs: