I'm giving the bundled OpenZFS on Ubuntu 16.04 Xenial a try.
When creating pools, I always reference drives by their serials in /dev/disk/by-id/
(or /dev/disk/gpt
on FreeBSD) for resiliency. Drives aren't always in the same order in /dev
when a machine reboots, and if you have other drives in the machine the pool may fail to mount correctly.
For example, running zpool status
on a 14.04 box I get this:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
ata-Hitachi_HDS722020ALA330_[..] ONLINE 0 0 0
ata-Hitachi_HDS722020ALA330_[..] ONLINE 0 0 0
ata-Hitachi_HDS722020ALA330_[..] ONLINE 0 0 0
ata-Hitachi_HUA722020ALA330_[..] ONLINE 0 0 0
But when I create a new pool on 16.04 with this (abbreviated):
zpool create pool raidz \
/dev/disk/by-id/ata-Hitachi_HDS723030ALA640_[..] \
/dev/disk/by-id/ata-Hitachi_HDS723030ALA640_[..] \
/dev/disk/by-id/ata-Hitachi_HDS723030ALA640_[..] \
/dev/disk/by-id/ata-Hitachi_HDS723030ALA640_[..]
I get this with zpool status
:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
sdf ONLINE 0 0 0
sde ONLINE 0 0 0
sdd ONLINE 0 0 0
sda ONLINE 0 0 0
It looks like zpool followed the symlinks, rather than referencing them.
Is there a way to force zpool on 16.04 to respect my drive references when creating a pool? Or alternatively, are my misgivings about what its doing here misplaced?
Update: Workaround
I found a thread for zfsonlinux on Github that suggested a workaround. Create your zpool with /dev/sdX
devices first, then do this:
$ sudo zpool export tank
$ sudo zpool import -d /dev/disk/by-id -aN
I would still prefer to be able to do this with the initial zpool create
though if possible.
zfs export
andzfs import -d
will work anyway. BTW, unless you really need every byte of space, use two mirrored pairs rather than raidz. raidz's performance is better than raid-5 but still much worse than raid-10 or zfs mirrored pairs. it's also easier to expand a pool made up of mirrored pairs, just add two disks at a time...with raidz, you have to replace each of the drives with larger drives, and only when you've replaced all of them will your pool have more space available.