Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I had a system with windows 7 installed on it. For installing Ubuntu 12.04 LTS, I installed GRUB. Now Ubuntu is working fine. But the GRUB boot menu at system startup doesn't show Windows 7, after successful installation of Ubuntu.

Following is the output of sudo fdisk -l

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
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x71c30ce5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63       80324       40131   12  Compaq diagnostics
Partition 1 does not start on physical sector boundary.
/dev/sda2           81920    29044735    14481408    7  HPFS/NTFS/exFAT
/dev/sda3   *    29044736   522272767   246614016    7  HPFS/NTFS/exFAT
/dev/sda4       522274814   976764927   227245057    f  W95 Ext'd (LBA)
Partition 4 does not start on physical sector boundary.
/dev/sda5       522274816   651298815    64512000    7  HPFS/NTFS/exFAT
/dev/sda6       665636864   709464063    21913600    7  HPFS/NTFS/exFAT
/dev/sda7       808998912   976764927    83883008    7  HPFS/NTFS/exFAT
/dev/sda8       651300864   665634815     7166976   82  Linux swap / Solaris
/dev/sda9       709466112   808984575    49759232   83  Linux

Partition table entries are not in disk order
omitting empty partition (6)

Disk /dev/sdb: 32.0 GB, 32017047552 bytes
255 heads, 63 sectors/track, 3892 cylinders, total 62533296 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x71c30ccf

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    16775167     8386560   84  OS/2 hidden C: drive
/dev/sdb2        16777214    62531583    22877185    5  Extended
/dev/sdb5        16777216    54396927    18809856   83  Linux
share|improve this question
    
Why did you not install Ubuntu in the conventional way? Ubuntu's installer, Ubiquity, would have taken care of everything. –  user25656 Jan 21 '13 at 6:23
    
Please indicate your BootInfo URL: help.ubuntu.com/community/Boot-Info –  LovinBuntu Jan 22 '13 at 0:00
    
This is my boot info url: paste.ubuntu.com/1565256 –  user124841 Jan 24 '13 at 6:21
add comment

3 Answers

Try using the update-grub command which will remap bootable images, then reboot to see if you can find Windows now.

share|improve this answer
    
I already tried that. After reading a few posts i tried adding following lines to /etc/grub.d/40_custom menuentry "windows 7 (loader) (on /dev/sda3)"{ insmod ntfs set root='(hd0,1)' chainloader +1 } after this i did sudo update-grub. This did show windows 7 in the boot menu, but when i selected it, it said BOOTMGR is missing. –  user124841 Jan 21 '13 at 6:01
    
The entry is wrong as per your partitions. You mentioned {root='(hd0,1)'} which means second partition(1) of first physical drive(hd0). Numbering starts from zero(0). So try correcting it to root='(hd0,2)' in your case according to the output you mentioned earlier. Thank you –  Robin Jan 21 '13 at 10:32
    
I corrected the entry as per your suggestion Robin. Now when i select windows 7 from the boot menu, Windows Boot Manager has following message for me: windows failed to start. A recent hardware or software change might be the cause. To fix the problem: Use the installation CD to repair the computer. File: \Boot\BCD Status: 0x000000f Info: An error occurred while attempting to read the boot configuration data. I dont have the installation CD, and i dont want to lose ubuntu, please help. –  user124841 Jan 22 '13 at 16:23
    
ok see now there are two steps to be done very carefully. –  Robin Jan 23 '13 at 3:48
1  
If it makes the situation any more clear, following is the boot info url: paste.ubuntu.com/1565256 Do i need to have a separate partition set for the purpose of boot? –  user124841 Jan 24 '13 at 6:25
show 7 more comments

I'm having the same problem I'll try this: I formatted the c drive of windows using gparted to ntfs. Changed the BIOS setting 'SATA Operation' from 'Intel Smart Response Technology' to 'ATA'. Reinstalled windows 7 using live CD. After successful installation of windows, grub was over written, so there was no boot menu at start up and windows 7 was boot straight away. I loaded ubuntu using ubuntu live CD. (Did not install, just run ubuntu).

Ran following commands in terminal:

sudo mount /dev/sda9 /mnt # sda9 was the partition i had previously set for ubuntu

sudo rm -rf /boot

sudo ln -s /mnt/boot /boot

sudo apt-get update && sudo apt-get install grub-pc

sudo grub-setup /dev/sda

sudo umount /boot
After this i ran 'Boot Repair' with recommended settings.
Removed the extra lines i had added in /etc/grub.d/40_custom, and did update-grub.

Now I have the boot menu with both ubuntu and windows 7.

share|improve this answer
add comment
up vote 0 down vote accepted

Thanks to all users and askubuntu forum, I finally got it all sorted out.

Following are the list of steps:

  1. I formatted the c drive of windows using gparted to ntfs.
  2. Changed the BIOS setting 'SATA Operation' from 'Intel Smart Response Technology' to 'ATA'.
  3. Reinstalled windows 7 using live CD.
  4. After successful installation of windows, grub was over written, so there was no boot menu at start up and windows 7 was boot straight away.
  5. I loaded ubuntu using ubuntu live CD. (Did not install, just run ubuntu).
  6. Ran following commands in terminal:

    sudo mount /dev/sda9 /mnt  # sda9 was the partition i had previously set for ubuntu
    
    sudo rm -rf /boot
    
    sudo ln -s /mnt/boot /boot
    
    sudo apt-get update && sudo apt-get install grub-pc
    
    sudo grub-setup /dev/sda
    
    sudo umount /boot
    
  7. After this i ran 'Boot Repair' with recommended settings.
  8. Removed the extra lines i had added in /etc/grub.d/40_custom, and did update-grub.

Now I have the boot menu with both ubuntu and windows 7.

(I am not sure, but I think I could have avoided reinstalling of windows and managed with just boot-repair, if i had made the SATA operation change in BIOS first.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.