Debian Emergency Mode after migrating to Debian 12
Hello,
I tried to upgrade from Raspbian 11 to 12 yesterday on a Raspberry.
When the package installation began, I encountered an error with a package (libc6) and as a result, I couldn't use sudo anymore. It said "account validation failure".
I tried to restart and then... it was a disaster!
I can ping the host but there's no SSH access.
When I connected a screen, I realized I was booting in Emergency mode.
The pi login doesn't work.
I attempted to boot directly into a shell using init=/bin/sh in one of the files on the Raspberry's SSD.
I tried to change the password => "password unchanged".
I wanted to check if there was any space left via df -h => "cannot read table of mounted file system: No such file or directory".
Note that when I try to boot normally, I get errors like:
Failed to start Journal Service
Failed to start File system check on root device
Failed to Start Network Time Synchronization
I'm a bit at my wits' end...
Any idea how I could get out of this mess?
Thanks
1 answer
-
Hello,
Ouch, the libc, if there's one thing you shouldn't break, it's that, because nothing will work anymore!
At least you can recover the files you care about by booting from a live USB (for example, the USB stick you used to install Debian), or more generally any Linux (not necessarily Debian) installed on a USB stick (which includes installation sticks).
Once you are on your live USB, you can try to complete the migration by booting from a live USB.
Personally, I would say reinstall your Debian. Now if you're motivated and knowledgeable about Linux, you can try to see if what I'm suggesting below resolves your issue.
- For both approaches, start by booting from the live CD, go to the partitioning step, recover, and save the documents you care about on another medium (e.g., another USB stick).
- Approach 1: do a chroot on the partition of the installed Debian (a manipulation I've detailed many times on the forum) and from there, restart the update. There's a good chance that from the chroot, it won't go well because the libc will be that of the broken system. If that's the case, you need to opt for approach 2.
mkdir -p /mnt/linux mount /dev/sda5 /mnt/linux # if /dev/sda5 is your / partition, see fdisk -l mount --bind /dev /mnt/linux chroot /mnt/linux mount /sys mount /proc sudo apt update sudo apt upgrade umount /proc umount /sys exit # exit the chroot umount /mnt/linux
- Approach 2: the idea is to download the problematic libc package, without doing a chroot, and deploy it where the / partition of the installed Debian system is mounted instead of targeting / (which is the / partition of the live system).
mkdir -p /mnt/linux mount /dev/sda5 /mnt/linux # if /dev/sda5 is your / partition, see fdisk -l wget http://ftp.fr.debian.org/debian/pool/main/g/glibc/libc6_2.37-7_amd64.deb dpkg --root=/mnt/linux --instdir=/mnt/linux -i libc6_2.37-7_amd64.deb mount --bind /dev /mnt/linux chroot /mnt/linux mount /sys mount /proc sudo apt update sudo apt upgrade umount /proc umount /sys exit # exit the chroot umount /mnt/linux
Good luck