zfsonlinux / grub

GRUB enhancements for ZFS on Linux
16 stars 18 forks source link

booting from a pool on an external USB drive #11

Closed RJVB closed 10 years ago

RJVB commented 10 years ago

I have a little issue with the root pool I have on an external USB drive. AFAIR, I could boot off it without issues, but for some reason it's started not being able to mount the pool. This is despite the fact that the pool does exist and imports fine manually. Looking at the screen output, it is almost as if the USB device is in the process of being mounted itself when the zpool import command is executed. Which is surprising as the bootloader and the /boot partition (btrfs) are on that same device.

Has anyone seen something similar, and is there something I could do about it, like adding a delay at the appropriate place?

zfs-boot-from-extusb

FransUrbo commented 10 years ago

it is almost as if the USB device is in the process of being mounted itself when the zpool import command is executed.

Yes, almost. The import fails because the USB device isn't (yet!) available.

The problem isn't really in grub, but in the initramfs. The zfs script there issues an 'udevadm settle' almost at the very top before continuing looking for pools etc. The default period to wait is 120 seconds. Unfortunately, it returns immediately, meaning that even though the settle have been issued, we (the ZFS script) doesn't wait around for it to actually finish.

So when the import fails because the devices isn't available (yet), it gives you a "rescue prompt", which you read, and THEN udev is finished with the "import" of the USB devices, that's why you get that second part of the message, while still in the shell.

I honestly do not know how to fix this at the moment.

But could you close this issue and open an identical in pkg-zfs (reference this one issue there).

RJVB commented 10 years ago

OK