I am using Ubuntu aka Debian aka Linux as my main operating system. It is just great, easy to use, and looks as sexy as any other OS these days.
But as I have an iPhone, which annoys me regularly, I need a Windows partition on my notebook to host iTunes. Even though I do not like iTunes, I just need it to manage my iPhone. So it worked just fine over a long time, but recently I could not use iTunes anymore! The reason was very weird, suddenly Windows 7 disappeared from my GRUB2 operation system list. So there was no way to boot Windows 7 anymore, and therefore iTunes was gone as well. I could basically do little with my iPhone, in regard to uploading and changing my music on it. There are some other iTunes alternatives available on Ubuntu, but they are not too cool right now and to not deliver the same set of features, even though iTunes is really bad.
After accepting the fact, that I could not boot Windows 7 anymore, I tried to fix the problem. And this time I actually managed to fix it.
Apparently the current version of GRUB2 has some issues with mounting NTFS partitions, which make the auto detection of the Windows 7 partition impossible. As a short term remedy to the problem, we just need to tell GRUB2 about the Windows 7 partition manually, which is not that complicated.
First of all, you need to get some information about your hard disk and its partitions.
Download the Boot Info Script at:
http://sourceforge.net/projects/bootinfoscript/
This is script, which delivers comprehensive partition of you hard disk. The output may look like this:
============================= Boot Info Summary: ==============================
=> Grub 1.97 is installed in the MBR of /dev/sda and looks on the same drive
in partition #2 for /boot/grub.
sda1: _________________________________________________________________________
File system: swap
Boot sector type: -
Boot sector info:
sda2: _________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 9.10
Boot files/dirs: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img
sda3: _________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /bootmgr /Boot/BCD /grldr /boot/grub/core.img
sda4: _________________________________________________________________________
File system: ntfs
Boot sector type: Windows Vista/7
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows 7
Boot files/dirs: /Windows/System32/winload.exe
=========================== Drive/Partition Info: =============================
Drive: sda ___________________ _____________________________________________________
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00026691
Partition Boot Start End Size Id System
/dev/sda1 63 9,992,429 9,992,367 82 Linux swap / Solaris
/dev/sda2 9,992,430 209,985,614 199,993,185 83 Linux
/dev/sda3 * 209,987,584 210,192,383 204,800 7 HPFS/NTFS
/dev/sda4 210,192,384 824,387,583 614,195,200 7 HPFS/NTFS
blkid -c /dev/null: ____________________________________________________________
sda1: UUID="131ff342-2567-4916-a64b-13bca2a542c3" TYPE="swap"
sda2: UUID="f9f8bf18-b65a-4104-86d0-b9e7559784d2" TYPE="ext4"
sda3: UUID="76484BEE484BABA5" LABEL="Door systeem gereserveerd" TYPE="ntfs"
sda4: UUID="12EA518AEA516ACD" TYPE="ntfs"
=============================== "mount" output: ===============================
... tons of other lines ...
This is a lot of information, and there is no need to understand all the lines in this script output. Instead you just need to get the UUID, of the hard disk, which is used for booting Windows 7 or any other Windows version.
In this example, the UUID in charge of this, is 76484BEE484BABA5 . In your situation, the number will be completely different though, or may be very similar.
After you have found the UUID, it is only matter of minutes to get Windows up and running again. Be patient, we are almost there.
You need to add the following lines to the /etc/grub.d/40_Custom file:
menuentry "Microsoft Windows 7" { insmod ntfs set root=(hd0,3) search --no-floppy --fs-uuid --set 76484BEE484BABA5 drivemap -s (hd0) ${root} chainloader +1 }But you need to change the UUID to your individual UUID number. You may also need to change the set root value.
After you have changed the existing file or have added the given lines, just do:
sudo update-grubYour system will ask you for your root password.
This will update the grub information.
Then reboot and, you should see Windows 7 again in your GRUB2 boot menu.
Good luck!