After fighting to upgrade my system from Debian Squeeze (Stable) to Wheezy (Testing), I thought I was finally in the free and clear once I had installed all of the packages so I rebooted. After taking a YouTube break, I tried to SSH back into the machine. Timed out.
I made the long trek to the other room and turned on the TV the machine is connected to and was faced with:
error: symbol not found: 'grub_divmod64_full'
Luckily this one wasn’t quite as bad as my apt-get adventures and recovery is fairly well documented. My steps varied a bit because my system is running RAID, so I’m expanding the steps a bit for any [software mdadm] RAID users.
Boot to your favorite Linux live CD and add the kernel parameter “nodmraid”. This was needed for my raid because dmraid kept accessing my disks and wouldn’t assemble the RAID properly and locked the disks so I couldn’t use mdadm. As far as the live CD is concerned, I ended up using Ubuntu because I couldn’t get Knoppix to boot to 64 bit and bitness is important since we’ll be using chroot.
First, assemble and mount the RAID arrays (replace drives and partitions as necessary.) For me /dev/md0 is /boot and /dev/md1 is my root filesystem, /.
mdadm --activate /dev/md0 /dev/sda1 /dev/sdb1 mdadm --activate /dev/md1 /dev/sda3 /dev/sdb3 mkdir /mnt/target mount /dev/md1 /mnt/target mount /dev/md0 /mnt/target/boot
Next we’ll need to populate the dynamic areas of the filesystem (e.g. /dev, /proc) and then change our shell into that environment:
mount --bind /proc /mnt/target/proc mount --bind /run /mnt/target/run mount --bind /sys /mnt/target/sys mount --bind /dev /mnt/target/dev mount --bind /dev/pts /mnt/target/dev/pts chroot /mnt/target /bin/bash
Now a few easy commands to reinstall Grub 2:
apt-get install --reinstall grub-pc dpkg-reconfigure grub-pc
I opted to install Grub to both of my physical drives, /dev/sda and /dev/sdb for safety.
Ctrl+D to exit the chroot, reboot, and you should be all set!
Now I’ve got a fully upgraded system running Debian Testing and since I’m using “testing” in sources.list, I’ll never have to do a major dist-upgrade again since packages roll in over time. It’s a versionless OS and that’s just wonderful!