After creating an unbootable kernel, the steps necessary to boot kernel.old are unclear. The problem is that under normal circumstances, /boot/zfs/zpool.cache is loaded in some magic way - this is evidenced by breaking into the loader (by pressing "6") and doing an lsmod. If you attempt to unload, then manually load kernel and zfs.ko, the zpool.cache file is not loaded. Attempting to load zpool.cache with the load command fails, and there is no alternative command to do so. Attempting to boot the kernel without the zpool.cache loaded results in an irrecoverable failure to mount root. Fix: Either loading zfs.ko needs to perform whatever magic is necessary to fetch zpool.cache, or a command needs to be added (like load_geli) to fetch the zpool cache. How-To-Repeat: Set up a zfsroot system. boot. hit '6' at the loader menu, then "unload", "load kernel" and "load zfs.ko", then "boot".
Responsible Changed From-To: freebsd-bugs->freebsd-fs From the description, it sounds more like an issue for the filesystem people.
Try the following options: 1) unload set kernel=kernel.old boot 2) unload load /boot/kernel.old/kernel load -t /boot/zfs/zpool.cache /boot/zfs/zpool.cache boot My expectation is that both should do what you want. -- Andriy Gapon
Option number 2, indeed, does the trick. This should be added to the documentation for ZFS-on-root installations.
Andriy Gapon <avg@FreeBSD.org> writes: > Try the following options: > > 1) > unload > set kernel=kernel.old > boot > > 2) > unload > load /boot/kernel.old/kernel > load -t /boot/zfs/zpool.cache /boot/zfs/zpool.cache zpool_cache_type can be anything. loader(8) unlike grub2 doesn't enforce type to be "/boot/zfs/zpool.cache". > boot Whatever happened to just typing following? boot kernel.old It assumes zpool.cache was already preloaded by failed attempt to boot default kernel. No need to `unload' the kernel, `boot' replaces it. > My expectation is that both should do what you want.
On May 25, 2011, at 1:52 AM, Pan Tsu wrote: > Andriy Gapon <avg@FreeBSD.org> writes: >=20 >> Try the following options: >>=20 >> 1) >> unload >> set kernel=3Dkernel.old >> boot >>=20 >> 2) >> unload >> load /boot/kernel.old/kernel >> load -t /boot/zfs/zpool.cache /boot/zfs/zpool.cache >=20 > zpool_cache_type can be anything. loader(8) unlike grub2 doesn't = enforce > type to be "/boot/zfs/zpool.cache". >=20 >> boot >=20 > Whatever happened to just typing following? >=20 > boot kernel.old >=20 > It assumes zpool.cache was already preloaded by failed attempt to boot > default kernel. No need to `unload' the kernel, `boot' replaces it. I didn't try that. At the time I didn't think it worked that way. Back = when I was in full on panic mode, I think option number 1 was what = finally worked, but I am happier with option 2, as it offers the most = control. It just needs to be better documented. >=20 >> My expectation is that both should do what you want.
on 25/05/2011 11:52 Pan Tsu said the following: > Andriy Gapon <avg@FreeBSD.org> writes: > >> Try the following options: >> >> 1) >> unload >> set kernel=kernel.old >> boot >> >> 2) >> unload >> load /boot/kernel.old/kernel >> load -t /boot/zfs/zpool.cache /boot/zfs/zpool.cache > > zpool_cache_type can be anything. loader(8) unlike grub2 doesn't enforce > type to be "/boot/zfs/zpool.cache". Yes, one can specify load -t anything /boot/zfs/zpool.cache and it will work. I was just on the safe side following what's done in /boot/defaults/loader.conf. >> boot > > Whatever happened to just typing following? > > boot kernel.old > > It assumes zpool.cache was already preloaded by failed attempt to boot > default kernel. No need to `unload' the kernel, `boot' replaces it. > Yes, I think that this command is a more convenient form of doing #1 above. All in all, I qualify this as a pilot error. Supported convenience methods do the right thing automatically. In the completely manual method a user should know what he is doing. Perhaps it's worth mentioning somewhere that zpool.cache must be loaded, but I think that it's a common knowledge. -- Andriy Gapon
State Changed From-To: open->closed No change needed.
Before this gets closed, is someone going to maybe add this to some = documentation somewhere? This ought to go in the handbook at the very = least.
>>>>> On Thu, 26 May 2011 18:20:14 +0300, Andriy Gapon said: > > on 26/05/2011 17:40 Nick Sayer said the following: > > > > Before this gets closed, is someone going to maybe add this to some = > > documentation somewhere? This ought to go in the handbook at the very = > > least. > > Which part exactly? > IMO, loader(8) should be sufficient. I think it should be http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-trouble.html where it currently tells you to do unload and boot with arguments that don't work for zfs... __Martin