I have a hard drive with some partition for windows (NTFS) and 1 partition for linux and 1 partition for linux swap.
Recently, I tried Norton Partition Magic Pro 8.05 (comes with Hiren Boot CD). It suggested me something related to ExtendedX. I choose [Fix] and then boom, after restart, my grub is corrupted (What's a magic!!!).
When I boot up using Ubuntu Live CD, this is the result of fdisk -l
on my computer:
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4ffe4ffd
Device Boot Start End Blocks Id System
/dev/sda1 * 1 2615 21004956 7 HPFS/NTFS
/dev/sda2 2616 14593 96213285 f W95 Ext'd (LBA)
/dev/sda5 2616 4619 16097098+ 7 HPFS/NTFS
/dev/sda6 4620 11459 54942268+ 7 HPFS/NTFS
/dev/sda7 11460 11982 4200966 7 HPFS/NTFS
/dev/sda8 11983 14344 18972733+ 83 Linux
/dev/sda9 14345 14593 2000061 82 Linux swap / Solaris
I find and follow an article here:
http://gadgetmix.com/index/how-to-restrore-grub-bootloader-in-ubuntu-9-10-standard-and-netbook-remix/
But on my computer, when I try grub-install --root-directory=/mnt /dev/sda8
(which is my ubuntu main partition), the terminal returns error:
root@ubuntu:~# grub-install --root-directory=/mnt /dev/sda8
grub-probe: error: Cannot find a GRUB drive for /dev/sda8. Check your device.map.
Auto-detection of a filesystem module failed.
Please specify the module with the option `--modules' explicitly.
What is that error? How can I fix that?
Thanks.
Best Answer
Try this:
About installing grub to a specific partition
If you do this, your boot loader needs to be aware that the partition has something interesting. Microsoft's bootloader is configured by editing
c:\boot.ini
. You do this by first copying the bootloader into a file:Then saving
grub.bin
ontoc:\grub.bin
then add something like this to yourc:\boot.ini
:If you don't understand any of that, don't bother. Read the next section.
About installing grub to the master boot record
Grub is the better boot loader. Putting it in the master boot record lets you use it to start Windows, instead of the other way around.
Before you continue, check your grub configuration file after running
update-grub
to make sure it "knows" about Windows:Whatever you're using, look for lines that indicate something about Windows, and your
(hd0,0)
device. When you're satisfied, simply chroot like before and then:When you reboot, Grub will start, and you can pick Windows. If you had entries to boot Linux/Grub in your
boot.ini
file, you can delete them now.The only downside to this method is that Microsoft Windows may delete grub as part of a system update, or general incompetence. Using the ubuntu disk and simply re-running
update-grub
andgrub-install
may be easier than dealing withgrub.bin