How to move /boot from zfs on root to ext4 filesystem?

  • 1 June 2021
  • 0 replies
  • 253 views

  • Anonymous
  • 0 replies

Sometimes the Logpoint (zfs on root) is not able to boot hence dropping to "grub rescue>" shell, if the system is not able to boot even after reinstalling grub, follow the below steps to boot from ext4 formatted partition which is better supported by grub2

Attach new virtual/physical disk or usb stick .eg /dev/sdx

Boot from Logpoint 6.3.0 ISO or later, get to the command line

Part 1-

# modprobe zfs# zpool import -a -N -R /mntMount the root pool into /mnt# zfs mount LP_Pool/ROOT/lp_rootmount -t proc /proc /mnt/procmount --rbind /dev /mnt/devmount --rbind /sys /mnt/syschroot /mnt /bin/bash --loginexport ZPOOL_VDEV_NAME_PATH=YESgrub-probe /# Part 2# Preparing ext4 boot disk sgdisk -p /dev/sdxsgdisk -n 1:2048:4095 -c 1:"BIOS Boot Partition" -t 1:ef02 /dev/sdx#below command will create new partition number "2" of size 3219MB sgdisk -n 2:4096:6291456 -c 2:"Linux /boot" -t 2:8300 /dev/sdxmkfs.ext4 /dev/sdx2 mv /boot /oldbootmkdir /boot

Now, mount the ext4 formatted usb disk to /boot

mount -t ext4 /dev/sdx2 /boot/rsync -aP /oldboot/* to /boot

get UUID of /dev/sdx2 and append to fstab as below:-

blkid | grep sdx2 # this will give uuid of sdx2 

Edit /etc/fstab file:-

UUID=1b1d424c-9fd1-4fd2-aba7-80252f1a8d64 /boot           ext4    defaults        0       2
grub-mkdevicemapgrub-install /dev/sdxupdate-grub2update-initramfs -u -k all

Exit from chroot

# zfs unmount -a# zfs set mountpoint=/ LP_Pool/ROOT/lp_root# reboot

In the bios settings make sure you select the disk just configured as a primary boot device


0 replies

Be the first to reply!

Reply