NOTE: Yes, I know I should have taken a snapshot of bpool. This would have solved this whole problem, but I forgot to do this.
I installed Ubuntu 19.10 as a clean install with ZFS on a whole hard drive.
I a few changes to /etc/default/grub
:
GRUB_TIMEOUT_STYLE=menu
GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi=off splash"
I ran:
sudo update-grub
sudo grub-install
Then I rebooted.
At this point, I was dropped into the grub command line. There were no menu entries, and my system is unbootable.
I'd really not like to re-install as I had already customized my system and moved lots of personal data onto it.
I ran an Ubuntu rescue disk to fix this. I was able to mount my rpool
and bpool
partitions and chroot
into them, but update-grub
and grub-install
did not find my current Ubuntu root and did not populate grub.cfg
.
I had read that os-prober
was a problem:
https://github.com/zfsonlinux/pkg-zfs/issues/193
sudo os-prober
Yields this:
device-mapper: reload ioctl on osprober-linux-sdb5
failed: Device or resource busy
Command failed.
Also, grub-probe
fails. Running:
sudo grub-probe /
Yields:
grub-probe: error: unknown filesystem.
So this might explain why grub is not working. Here's the version:
grub-probe (GRUB) 2.04-1ubuntu12.1
Any ideas on how to make this system bootable again besides re-installing?
chroot
,you need do this (after you have booted from your rescue disk and got things mounted):
mv $target_root/dev $target_root/dev.save && mkdir $target_root/dev
mount --bind /dev $target_root/dev
(you might need to do the same for your/sys
)Only THEN you can chroot to
$target_root/
and expect things to work. After you exit from chroot, don't forget toumount $target_root/dev && rmdir $target_root/dev && mv $target_root/dev.save $target_root/dev
(and do the same for/sys
if you used that). Or else you won't be able to boot cause your/dev
won't be in place.you must be able to install GRUB without all that chroot stuff. Just check
/etc/fstab
and learn what your partitions are. Get your root (/) device from there.Most likely you'll find UUIDs instead of /dev/sd* device names. No problem!! Get device name from
ls -l /dev/disk/by-uuid
where you find your UUIDs and devices they are linked to.Learn where your
/boot/grub
is located -- most likely it's on your root, sols /boot/grub
is enough to make sure.The standard
grub-install
command WON'T FIND ANYTHING, you need to supply your target installation (root) device to it:grub-install /dev/sda
(instead of/dev/sda
supply your root device you found from/etc/fstab
).grub-probe
to get sensible answer from it:grub-probe --target=disk /
(or any other --target)