Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://ubuntu.com/tutorials/setup-zfs-storage-pool#3-creating-a-zfs-pool
https://www.csparks.com/ZFS%20Without%20Tears.md

https://blog.programster.org/zfs-cheatsheet

Install:

apt install -y zfsutils-linux

Testing!! (Create a few files and use them as "vdevs"):

dd if=/dev/zero of=myFile1 bs=1M count=64
dd if=/dev/zero of=myFile2 bs=1M count=64
dd if=/dev/zero of=myFile3 bs=1M count=64
dd if=/dev/zero of=myFile4 bs=1M count=64
zpool create myPool ~/myFile1 ~/myFile2

Create:

Note: Never use /dev/sd... because adding/removing disks can change those designations, always using something under /dev/disk/* as it should be unique. 

https://unix.stackexchange.com/questions/577001/raid-2-smaller-drives-with-one-larger-drive/577053#577053

Eg: Find By-ID for Entire Disk (Won't work for /dev/sdb1 only /dev/sdb)

ls -l /dev/disk/by-id | grep -v part | grep -v wwn | sort -k 11

Since I was using partitons like /dev/sdb1, I used simeple "blkid" and then "partuuiid".

Eg:

/dev/sdb2: PARTUUID="aef43ae1-2bff-4eac-8c91-7818b1ec37fd"
/dev/disk/by-partuuid/aef43ae1-2bff-4eac-8c91-7818b1ec37fd

Striped (Parity):

zpool create poolname /dev/sdb /dev/sdc -o ashift=12

Mirror:

zpool create poolname mirror /dev/sdb /dev/sdc -o ashift=12

Mount:

  • By default a new pool is mounted at the root of the file system where it appears as a directory named after the pool. Use `-m /path` to set mount point
zpool create poolname ... -m /mnt/poolname

Change Mount:

zfs set mountpoint=/mnt/poolname poolname

Status:

zpool status
zpool iostat
zpool iostat -v
zpool iostat -v 5 # Watch 5sec
zpool history poolname

Destroy/Remove/Add:

zpool destroy poolname
zpool remove poolname /dev/sda
zpool attach poolname /dev/sda
  • No labels