Thursday 9 August 2012

Couldn't boot to Windows 2

Ubuntu 12.04 Precise Pangolin
Windows XP
Grub 2

Well, the very day after that post, the problem recurred, almost certainly the result of an update.  This time /boot/grub.d/device.map was not the problem: it was there, but os-prober still couldn't find Win XP.  I decided it was time to just write a static entry.  I created a script /etc/grub.d/29_winxp (so it runs after memtest, but before os_prober), and it looks like this:
#!/bin/sh -e
echo "Adding Windows XP to GRUB 2 menu (29_windxp)" >&2
cat << EOF
menuentry "Microsoft Windows XP (on /dev/sda1)" --class windows --class os {
insmod part_msdos
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set=root 6EC07F71C07F3E81
drivemap -s (hd1) (hd0)
chainloader +1
}
EOF

The uuid for the Windows drive was found using sudo blkid.  It works, and let's hope it's a durable solution.

No comments:

Post a Comment