Saturday, May 12, 2018

openSUSE Tumbleweed boot problem

After recent update (20180502) of openSUSE Tumbleweed, my machine failed to boot.  A quick check in the dracut emergency shell seems to indicate that somehow the root volume is mounted as /kdump/mnt0 and so cannot be mounted as root again.

Here is a quick fix.

Boot the system with LiveCD or any emergency tool.  Mount the Tumbleweed system (here I mounted it under /mnt/temp).  Go to the boot directory and find the initrd file.  We are going to extract and modify the fstab inside.

cd /mnt/temp/boot
mkdir initrd-mod
cd initrd-mod
/usr/lib/dracut/skipcpio ../initrd > initrd.xz
xz -d initrd.xz
cpio -idv < initrd
cd etc
# edit the fstab file, comment out the mount of /kdump/mnt0
vi fstab

Now, repackage the initrd file

cd /mnt/temp/boot/initrd-mod
find . 2>/dev/null | cpio --quiet -c -o | xz -9 --format=lzma >"../initrd-mod.img"
chmod go-r ../initrd-mod.img

The original boot/initrd should be a symbolic link to the current kernel version.  Remove it and point it to the modified initrd

cd /mnt/temp/boot
rm initrd
ln -s initrd-mod.img initrd
# Depends on your setup, you probably also need to
# backup and link specific kernel version of initrd. e.g.
# mv initrd-4.16.6-1-default initrd-4.16.6-1-default.bak
# ln -s initrd-mod.img initrd-4.16.6-1-default


Sync, umount, and reboot.  There will be error messages saying /kdump/mnt0 can't be mounted but at least the system can boot up.

No comments: