Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 5686  / 3 Years ago, fri, august 27, 2021, 6:41:56

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

More From » 12.04

 Answers
3

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.)


[#33107] Saturday, August 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
enefiama

Total Points: 43
Total Questions: 125
Total Answers: 102

Location: Gabon
Member since Sat, Jul 25, 2020
4 Years ago
enefiama questions
;