2

I am upgrading a laptop from 24.10 to 25.04, however the upgrade process failed, and crashed the desktop and said "A problem has occurred, please contact a system administrator." Oh No! Something has gone wrong

This system uses ZFS.

I was able to get in via recovery/advanced options and attempt an update-grub:

Console screen hung on update-grub

I saw that it was missing an initrd for the 6.14.0-15 kernel, so I was able to generate one. However, that did not fix the problem:

Update-grub hung after adding initrd

If I boot normally, it boots into the old kernel and has the Oh no! Something has gone wrong screen, but I'm able to to access via ctrl+alt+2 a terminal. The desktop doesn't load, start up apps appear to load (e.g. mattermost), but I'm not able to access any windows or alt-tab.

After leaving it for a while, I came back to this message: task moun.zfs:7221 blocked for more than 122 seconds Tainted: P O 6.11.0-26-generic #26-ubuntu

Task mount.zfs blocked for more than 122 seconds

How can I complete the upgrade and boot into the new kernel? I have a snapshot I can roll back to, but I'd like to finish the upgrade.

Thystra
  • 363

1 Answers1

2

I rebooted into a live cd and was able to run dpkg --configure -a from there:

From this answer: How to mount an encrypted Ubuntu 20.10 ZFS file system from an Ubuntu live CD?

This system was installed with the Ubuntu ZFS option from the OS installer. First, I need to load the system key:

$sudo -i
#cryptsetup open /dev/zvol/rpool/keystore zfskey

This put it in the media folder:

sudo cat /media/ubuntu/keystore-rpool/system.key | sudo zfs load-key -L prompt rpool

Then I was able to mount and chroot into the system:

https://tpmullan.com/2021/10/27/chroot-into-an-ubuntu-on-zfs-system/

zpool export -a
zpool import -N -R /mnt rpool
zpool import -N -R /mnt bpool
zfs load-key -a
# Add “UUID” at the end, if appropriate; use zfs list to see your values:
zfs mount rpool/ROOT/ubuntu_#######
zfs mount bpool/BOOT/ubuntu_######
zfs mount -a
for i in proc sys dev run tmp; do mount -o bind /$i /mnt/$i; done
chroot /mnt /bin/bash --login
mount -a

Finish the upgrade:

sudo dpkg --configure -a
sudo apt-get autoremove
exit
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -i{} umount -lf {}
zpool export -a
reboot

it hung up on the zpool export -a in the terminal, but I was able to reboot and back into the main system without issue. In the past, failure to export the pools requires a zpool import from initramfs then you can boot.

Thystra
  • 363