dajhorn/pkg-zfs — pull request #39 by pdf (2012-07-28 08:33:35+00:00)
Title: Move udev initrd hooks into zfsutils to mount zdev-based pools at boot

Ref zfsonlinux/zfs#811 for discussion

This patch attempts to solve the following problem of zdev-based pools not mounting on boot:

Setup a new pool using zdev.conf
======================================
```

pool: tank
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
pci-0000:00:07.0-virtio-pci-virtio4 ONLINE 0 0 0
pci-0000:00:08.0-virtio-pci-virtio5 ONLINE 0 0 0

errors: No known data errors
rm: cannot remove `/etc/zfs/zpool.cache': No such file or directory
pool: tank
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
disk1 ONLINE 0 0 0
disk2 ONLINE 0 0 0

errors: No known data errors
```

Post reboot
-----------
```
pool: tank
state: ONLINE
scan: none requested
config:

NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
disk1 ONLINE 0 0 0
disk2 ONLINE 0 0 0

errors: No known data errors
NAME USED AVAIL REFER MOUNTPOINT
tank 93K 952M 30K /tank
tank on /tank type zfs (rw,xattr)
```

So, the pool is not available when mountall is doing it's work. The only caveat to the proposed approach is that the initrd needs to be regenerated when zdev.conf is updated, but since the alternative is no support at all, that seems fair.