SvennD
Create ZFS Raidz2 pool
March 20, 2019

Create ZFS Raidz2 pool

Posted on March 20, 2019  •  2 minutes  • 388 words  •  Suggest Changes

This is a quick howto, I made a raidz2 pool on ZFS, its very similar to how to create a mirror.

find out what disks you are giving to the pool :

root@panda:~# fdisk -l /dev/sd* | grep Disk
Disk /dev/sda: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sdb: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sdc: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sdd: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sde: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sdf: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sdg: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sdh: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sdi: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sdj: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sdk: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors
Disk /dev/sdl: 9.1 TiB, 10000831348736 bytes, 19532873728 sectors

I was lucky that the main system is on a nvme so not /dev/sd* so basically all disks can be in the pool.

Create the pool, the name is panda, and the “raid” level raidz2 meaning 2 disks can fail before data loss occurs similar to RAID6.

zpool create panda raidz2 /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk /dev/sdl

After that the pool is made :

root@panda:~# zfs list
NAME    USED  AVAIL  REFER  MOUNTPOINT
panda   768K  80.4T   219K  /panda
root@panda:~# zpool status
  pool: panda
 state: ONLINE
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        panda       ONLINE       0     0     0
          raidz2-0  ONLINE       0     0     0
            sda     ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0
            sdd     ONLINE       0     0     0
            sde     ONLINE       0     0     0
            sdf     ONLINE       0     0     0
            sdg     ONLINE       0     0     0
            sdh     ONLINE       0     0     0
            sdi     ONLINE       0     0     0
            sdj     ONLINE       0     0     0
            sdk     ONLINE       0     0     0
            sdl     ONLINE       0     0     0

errors: No known data errors

Note : you can rename the disks to be sure they are consistent across hardware changes, but it never gave any issues for me personally …

Don’t forget to change the defaults settings to something you prefer :

zfs set xattr=sa panda
zfs set acltype=posixacl panda
zfs set compression=lz4 panda
zfs set atime=off panda
zfs set relatime=off panda
zfs set recordsize=1M panda

note: recordsize depends on data you expect to store.

See the basic tuning tips for more info.

Support

If you enjoyed this website, consider buying me a Dr. Pepper

Buy me a Dr PepperBuy me a Dr Pepper