Author Topic: How to move GRUB to mbr [Solved]  (Read 710 times)

Offline TonyK

  • Jr. Member
  • **
  • Posts: 15
How to move GRUB to mbr [Solved]
« on: November 12, 2012, 01:25:49 PM »
I had GAG (Graphical Boot Manager) installed in the Master Boot Record.  I had to remove it because it would not allow for me to boot from my CD drive.  I don't know what happened but somehow something changed in the BIOS settings which would not allow for me to boot the CD.  Since GRUB was installed into the partition in which PCLinuxOS resides, after uninstalling GAG i can only boot into my Windows7 partition because GAG restored the original mbr.  GAG is able to boot Linux from any partition by turning over the boot process to GRUB. I have a perfectly working Linux installation but would like to move GRUB to the mbr in order to boot it.  I don't want to reinstall GAG to boot into my Linux system but if I can move GRUB to the mbr, I should be able to boot without using GAG.

There is also a second problem which I will have to fix after I move GRUB to the mbr and that is the fact that when I first installed it, the menu option to boot Windows 7 would not work.  So, if I move it to the mbr I will have to work this out in order for everything to work properly.

I don't want to re-install my Linux system and the image I made of it will probably contain GRUB in the Linux partition.  Restoring the image would not help if that happens.

Any ideas?
« Last Edit: November 13, 2012, 07:24:20 PM by TonyK »

Offline agmg

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1888
  • Certified Windows Hater
For the whole world, you are someone.
For someone, you are the whole world.

Offline TonyK

  • Jr. Member
  • **
  • Posts: 15
Re: How to move GRUB to mbr
« Reply #2 on: November 13, 2012, 03:14:11 PM »
Thanks for the help.  I was able to get GRUB installed in the mbr using the information in one of the links you provide.  Now I need help in getting GRUB to boot my Windows 7 installation.  For some reason, when GRUB was installed it did not get the menu entry for my Windows partition correct.  I get some graphical screen that wants to do a memory check.  Here is what fdisk -l shows:


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: 0x117d34e4

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63       80324       40131    6  FAT16
Partition 1 does not start on physical sector boundary.
/dev/sda2   *       80325    30800324    15360000    7  HPFS/NTFS
Partition 2 does not start on physical sector boundary.
/dev/sda3        30800325   625140399   297170037+   7  HPFS/NTFS
Partition 3 does not start on physical sector boundary.
/dev/sda4       625141758   976771071   175814657    5  Extended
Partition 4 does not start on physical sector boundary.
/dev/sda5       625141760   683786239    29322240   83  Linux
/dev/sda6       683788288   972865535   144538624   83  Linux
/dev/sda7       972867584   976771071     1951744   82  Linux swap / Solaris

The main Win 7 partition is the sda3 and sda2 I believe is the Dell recovery partition.  I don't know what the sda1 partition is and it is listed as fat16.  However, here is my menu.lst file's contents.

timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,4)/boot/gfxmenu
default 0

title linux
kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=ccdfddd7-d0c5-4fc8-8527-75f8222d6683 quiet nokmsboot vmalloc=256M acpi=on resume=UUID=d14209a2-5924-445d-9ce6-8060ab8aeccb splash=silent vga=788
initrd (hd0,4)/boot/initrd.img

title linux-nonfb
kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=linux-nonfb root=UUID=ccdfddd7-d0c5-4fc8-8527-75f8222d6683 quiet nokmsboot vmalloc=256M acpi=on resume=UUID=d14209a2-5924-445d-9ce6-8060ab8aeccb
initrd (hd0,4)/boot/initrd.img

title failsafe
kernel (hd0,4)/boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=ccdfddd7-d0c5-4fc8-8527-75f8222d6683 quiet nokmsboot failsafe vmalloc=256M acpi=on
initrd (hd0,4)/boot/initrd.img

title windows
root (hd0,0)
chainloader +1

title memtest-4.20
kernel (hd0,4)/boot/memtest-4.20 BOOT_IMAGE=memtest-4.20

Is there anything there that you can spot that should be changed?

Thanks for your help.


Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10644
  • MLUs Forever!
Re: How to move GRUB to mbr
« Reply #3 on: November 13, 2012, 03:58:31 PM »
Quote
title windows
root (hd0,0)
chainloader +1

Edit the second zero in (hd0,0) to correspond to the partition on which Windows is installed.

The first partition is zero, the second is 1, the third is 2 and so on.

I expect you need that line in the menu.lst file to read

root (hd0,1)

***

If you had more than one HDD in the PC you might also have to edit the first zero - which corresponds to the first HDD - if the Windows install was on the second HDD .....  it would then become (hd1,?   for the second HDD.
That situation does not appear to be relevant, but I thought to mention it for information.  ;)

« Last Edit: November 13, 2012, 04:00:03 PM by Just17 »
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline TonyK

  • Jr. Member
  • **
  • Posts: 15
Re: How to move GRUB to mbr
« Reply #4 on: November 13, 2012, 06:33:35 PM »
Yea!!!!!!  That did it!  Just one more reason to love PCLinuxOS is the great support you are able to receive.  Thanks a lot once again.   All is well.


Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10644
  • MLUs Forever!
Re: How to move GRUB to mbr
« Reply #5 on: November 13, 2012, 06:40:05 PM »
Glad you have it working  :D

Can you please modify your first post of this thread by putting [SOLVED] in the title?  Thank you  ;)

MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT