You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/etc/zfs/zpool.cache gets built into the initrd. This can become problematic and prevent your zfs filesystems from mounting at boot and require them to be forcibly re-imported. As a workaround, you can run 'update-initramfs -k all -u' and that will fix the problem short term.
This became a problem for me because I create a pool using the /dev/sd? names from disks that were attached via USB. While I have this pool attached via USB, there was an update which triggered my initrd to be rebuilt. I them moved these disk onto my sata controller and off of the usb device and then imported it with 'zpool import -d /dev/disk/by-id [pool]'. Everything was working and then I rebooted and none of my zpools mounted (except for my root zpool). A zpool status showed that the pool was unavailable because the /dev/sd? devices were missing. So I exported the pool, did an import as mentioned above and that failed until I added -f to the import which was successful. I checked the contents of zpool.cache and it correctly had the device paths using by-id.
At this point I rebooted and the whole process started over again. The zpool.cache had the correct information, but zpool status showed the wrong device paths. I get everything back into working order and rebuilt my initrd. Finally I rebooted and all was well.
Really, the zpool.cache file should not be in the initrd. But clearly it is and it is being used and causing a problem. Perhaps updating the code to ensure that the zpool.cache file is ignored prior to the real / is mounted?
The text was updated successfully, but these errors were encountered:
Some early tentative planning is happening to deprecate and obsolesce the zpool.cache file, which should solve this problem.
In the meantime, if you don't need the zpool.cache file on your system, then put a rm "$DESTDIR/etc/zfs/zpool.cache" line at the bottom of the /usr/share/initramfs-tools/hooks/zdev file, and optionally dpkg-divert it so that it will not be overwritten during upgrades.
I may give that a try in the next day or so. But ultimately, I don't normally have disks moving around like this (nor do most people). I just happened to be unlucky with the timing of things this time and figured it was worth the effort of noting it so that others at least have something they can find via google at least. :)
Given the the zpool.cache is getting deprecated, and the rarity of this actually causing any problems, I would say that there is no reason to spend any dev time trying to hack another fix in ahead of time. Thanks!
/etc/zfs/zpool.cache gets built into the initrd. This can become problematic and prevent your zfs filesystems from mounting at boot and require them to be forcibly re-imported. As a workaround, you can run 'update-initramfs -k all -u' and that will fix the problem short term.
This became a problem for me because I create a pool using the /dev/sd? names from disks that were attached via USB. While I have this pool attached via USB, there was an update which triggered my initrd to be rebuilt. I them moved these disk onto my sata controller and off of the usb device and then imported it with 'zpool import -d /dev/disk/by-id [pool]'. Everything was working and then I rebooted and none of my zpools mounted (except for my root zpool). A zpool status showed that the pool was unavailable because the /dev/sd? devices were missing. So I exported the pool, did an import as mentioned above and that failed until I added -f to the import which was successful. I checked the contents of zpool.cache and it correctly had the device paths using by-id.
At this point I rebooted and the whole process started over again. The zpool.cache had the correct information, but zpool status showed the wrong device paths. I get everything back into working order and rebuilt my initrd. Finally I rebooted and all was well.
Really, the zpool.cache file should not be in the initrd. But clearly it is and it is being used and causing a problem. Perhaps updating the code to ensure that the zpool.cache file is ignored prior to the real / is mounted?
The text was updated successfully, but these errors were encountered: