Booting via GRUB 2 prompt: Difference between revisions

From Jeremy Bryan Smith
Jump to navigation Jump to search
(Created page with "Did your update-initramfs not complete before you rebooted your zfs-on-root Ubuntu install? Here's how to boot it from the GRUB prompt using a previous kernel, assuming that y...")
 
No edit summary
Line 6: Line 6:
grub> initrd /BOOT/ubuntu/HEAD/@/initrd.img-5.4.0-42-generic
grub> initrd /BOOT/ubuntu/HEAD/@/initrd.img-5.4.0-42-generic
grub> boot
grub> boot
...
</pre>
... kernel messages here ...
That should load the kernel and initial ramdisk. If you are then dropped to an '''<tt>(initramfs)</tt>''' shell, you'll have to manually import the zpool containing the root filesystem:
...
<pre>
(initramfs) /sbin/modprobe zfs
(initramfs) /sbin/modprobe zfs
(initramfs) zpool import rpool -R /root
(initramfs) zpool import rpool -R /root
(initramfs) exit
(initramfs) exit
</pre>
</pre>
I also add:
Note: The following:
  net.ifnames=0 biosdevname=0
  net.ifnames=0 biosdevname=0
to ensure that all Ethernet device names use the naming scheme '''<tt>ethX</tt>''' for consistency. That part is not necessary.
was added to the kernel parameters to ensure that all Ethernet device names use the naming scheme '''<tt>ethX</tt>''' for consistency. That part is not necessary.

Revision as of 03:28, 6 February 2021

Did your update-initramfs not complete before you rebooted your zfs-on-root Ubuntu install? Here's how to boot it from the GRUB prompt using a previous kernel, assuming that your boot filesystem is on (hd0,gpt3), the zfs dataset name of your boot filesystem is bpool/BOOT/ubuntu/HEAD, the zfs dataset name of your root filesystem is rpool/ROOT/ubuntu/HEAD, and you're wanting to boot version 5.4.0-42-generic of the kernel:

grub> insmod zfs
grub> set root=(hd0,gpt3)
grub> linux /BOOT/ubuntu/HEAD/@/vmlinuz-5.4.0-42-generic boot=zfs zfs_force=1 root=ZFS=rpool/ROOT/ubuntu/HEAD net.ifnames=0 biosdevname=0
grub> initrd /BOOT/ubuntu/HEAD/@/initrd.img-5.4.0-42-generic
grub> boot

That should load the kernel and initial ramdisk. If you are then dropped to an (initramfs) shell, you'll have to manually import the zpool containing the root filesystem:

(initramfs) /sbin/modprobe zfs
(initramfs) zpool import rpool -R /root
(initramfs) exit

Note: The following:

net.ifnames=0 biosdevname=0

was added to the kernel parameters to ensure that all Ethernet device names use the naming scheme ethX for consistency. That part is not necessary.