Sonntag, 18. November 2007

Grub Error 17

Interestingly 0x17=23 hehe, but let's leave that aside. If you follow those guidelines, make sure to have at least backup copies of all changed files. Note that I use initramfs and a crypted partition with a containing lvm and therein root and swap.

Problem:
Even before the GRUB boot menu is displayed: Grub error 17
What I did was using the Windows built-in repartitioning tool to merge the second into the first partition, like here:

Previous Setup: 4 partitions:
1 - Vista
2 - Encrypted
3 - /boot
4 - encrypted lvm root and swap

Current Setup: (Changed with Vista) 3 partitions:
1 - Vista (merged purged Encrypted)
2 - /boot
3 - encrypted lvm root and swap

Okay, I booted from Debian Install/Rescue CD, mounted /boot and changed the device.map's root entry to match the now second instead of third partition. But that didn't do anything. (But should be done anyways)

My suspicion is that Windows Vista somehow messed up the MBR or the partition table. So I mounted all my partitions and chrooted into my system to have the grub command available. Then started grub and ran root (hd0,2) and setup (hd0) to reinstall grub into the MBR.

That gave me my boot menu back (and Windows Vista, but haven't tested it yet). Still I couldn't boot, due to other references to the previous partitions 3 and 4. So again in my chrooted system, I adapted the /etc/crypttab entry to refer to sda3 instead of sda4 and the fstab to refer to sda2 for /boot.

So the root system was setup to work, but the initrd files (I use initramfs) still contained the old settings. That was done with update-initramfs -k 2.6.23.1methos -u -t. I had to specify the kernel because I was still running from the rescue cd, so the version of the currently running kernel was not the one I wanted to create an initrd for (my normal current kernel). -u means update, change/replace the initrd. And -t means with force :) as it told me image altered, cannot update due to some reason.

So with the new initrd and reinstalled grub everything is working again. Wonderful!

Keine Kommentare: