Re-Install Grub Quickly with Parted Magic

**Fix Grub Bootloader Quickly
**

If grub breaks, here is a quick and easy way to re-install it. If you have another computer to work with alongside this is a great benefit. This will put grub on the MBR of the first HD (hd0)

Step 11. Get yourself Parted Magic- Burn it to a cd. (EDIT) (I’m adding a link to download a working version of Parted Magic as the current version uses grub2 not legacy.)
DOWNLOAD THIS VERSION: **** Grub Legacy version of Parted Magic

Here is a sure way to boot Parted magic without fail (not all options for boot will work so do it this way, it’s sure to work)
Using Parted Magic an Introduction - openSUSE Forums

Step 22. Once in the live desktop start a RoxTerm, this has root power by default. I have included a video of this being done. We need to start grub, find the menu.lst file, setup grub.

You type: grub
Terminal: grub>

You type: find /boot/grub/menu.lst
Terminal: (hd0,1) (N.B. You may get different, replace your numbers in the next step)

You type: root (hd0,1) (Or different depending what previous step gave for you)
Terminal: Filesystem type is ext2fs, partition type 0x83

You type: setup (hd0)
Terminal: Checking if /boot/grub/stage1 exists … yes Computer finally returns this-- Succeeded…Done

You type: quit
reboot

Download the Video
**grub in term.mpeg.zip - Windows Live

**Grub of course is quite complicated and installs can be equally so. Which means this fix might not be suitable for your setup. Learn more about grub here: All About Grub - openSUSE

@swerdna has great help too
Linux HOWTOs and Tutorials: Suse Linux 10.0, 10.1 openSUSE 10.2, 10.3, 11.0, 11.1

For me, the ‘find’ step returns two items.

find /boot/grub/menu.lst
 (hd0,1)
 (hd1,0)

Which should I use?

That would suggest you have two distros and bootloaders on two different hard disks. Choose the one you want to write to hd0.

I am trying to get a better overall understanding of my 11.2 system. Following the preceding and using Parted Magic:

I found this code and have two questions:

grub>

grub> find /boot/grub/menu.lst

(hd2,1)

grub> root (hd2,1)

Filesystem type is ext2fs, partition type 0x83

Using Parted Magic and looking at the flags, I have a boot flag checked on one drive and another has boot, lba.

Can you help me understand the difference? I’d like to keep notes on where grub is for the future. The flags correspond to drives /dev/sdb1 and /dev/sdc/sdc5.

How do I understand the way system monitor sees the drive compared to grub? It looks like hd2,1 is /dev/sdc5. There is no boot flag on my 11.2 drive.

I hope the questions do not seem too dumb?

We would need to see

fdisk -l

You can get that with Parted Magic if you like.
Some explanation of the output would be good.

Thanks much for fast response:

linux-zbo5:/home/phil3 # fdisk -l

Disk /dev/sda: 300.1 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0008cb31

Device Boot Start End Blocks Id System
/dev/sda1 1 262 2104483+ 82 Linux swap / Solaris
/dev/sda2 263 2873 20972857+ 83 Linux
/dev/sda3 2874 36481 269956260 83 Linux

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0388a221

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 182401 1465136001 7 HPFS/NTFS

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x62229326

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 16322 131106433+ c W95 FAT32 (LBA)
/dev/sdc2 16323 60801 357277567+ 5 Extended
/dev/sdc5 16323 34604 146850133+ 7 HPFS/NTFS
/dev/sdc6 34605 60801 210427371 bc Unknown

I think it boots from sdc1 as I have the bios set to boot from that drive

thanks

sda then is SUSE?

what is it in the boot order?
If you go to sda2 and /boot/grub/menu.lst (post the content)

Explain the other drives and boot order.

sda3 is Suse

sdc1 is win 98
sdc5 is winXP
sbc1 is NTFS storage drive. I do not know why it has a boot flag

boot is:
opensuse 11.2
windows 2 (winXP) I deleted windows 1 as it was 98 and not usable
opensuse safe

How do I do this?:

If you go to sda2 and /boot/grub/menu.lst (post the content)

sda3 I think is SUSE /home - All sda is dedicated to SUSE by the looks of it.

When I asked for your boot order I meant in the BIOS, the HD’s will be set in a certain order.
But leave this for now.

Boot parted Magic and you need to mount sda2, which I’m sure is SUSE root. In there navigate to /boot/grub/menu.lst

Post the content here, because it will tell me stuff about SUSE’s HD in the BIOS when SUSE was installed.

In Parted Magic I was not able to view the file with sda2 mounted or unmounted. The Suse install is recent and my boot order is:
IDE:Sony CD-RW CRX
IDE: WD5000AAJB
Removable device

was able to get to the file in terminal:

Modified by YaST2. Last modification on Sat Jun 19 21:25:32 EDT 2010

THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader

Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 0
timeout 8
gfxmenu (hd2,1)/boot/message

###Don’t change this comment - YaST2 identifier: Original name: linux###
title Desktop – openSUSE 11.2 - 2.6.31.12-0.2
root (hd2,1)
kernel /boot/vmlinuz-2.6.31.12-0.2-desktop root=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U0_WD-WXD0C7949084-part2 resume=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U0_WD-WXD0C7949084-part1 splash=silent quiet showopts vga=0x31a
initrd /boot/initrd-2.6.31.12-0.2-desktop

###Don’t change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe – openSUSE 11.2 - 2.6.31.12-0.2
root (hd2,1)
kernel /boot/vmlinuz-2.6.31.12-0.2-desktop root=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U0_WD-WXD0C7949084-part2 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a
initrd /boot/initrd-2.6.31.12-0.2-desktop

###Don’t change this comment - YaST2 identifier: Original name: windows 2###
title windows 2
rootnoverify (hd0,0)
chainloader +1

The boot info suggests the SUSE HD was / is (hd2,1) which is I’m sure sda2

Follow the Parted Magic Guide to reinstall grub
it find grub at (hd2,1)

But the last part should install grub to (hd0)
So like this:
**setup (hd0)
**
Which should install grub to the first HD

I misunderstood when a device was mounted in Parted MAgic, here is the info:

Modified by YaST2. Last modification on Sat Jun 19 21:25:32 EDT 2010

THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader

Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

default 0
timeout 8
gfxmenu (hd2,1)/boot/message

###Don’t change this comment - YaST2 identifier: Original name: linux###
title Desktop – openSUSE 11.2 - 2.6.31.12-0.2
root (hd2,1)
kernel /boot/vmlinuz-2.6.31.12-0.2-desktop root=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U0_WD-WXD0C7949084-part2 resume=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U0_WD-WXD0C7949084-part1 splash=silent quiet showopts vga=0x31a
initrd /boot/initrd-2.6.31.12-0.2-desktop

###Don’t change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe – openSUSE 11.2 - 2.6.31.12-0.2
root (hd2,1)
kernel /boot/vmlinuz-2.6.31.12-0.2-desktop root=/dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U0_WD-WXD0C7949084-part2 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a
initrd /boot/initrd-2.6.31.12-0.2-desktop

###Don’t change this comment - YaST2 identifier: Original name: windows 2###
title windows 2
rootnoverify (hd0,0)
chainloader +1

and BTW:
(hd2) /dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U0_WD-WXD0C7949084
(hd1) /dev/disk/by-id/ata-ST31500341AS_9VS32EM8
(hd0) /dev/disk/by-id/ata-WDC_WD5000AAJB-00YRA0_WD-WCAS86352573

(hd2) /dev/disk/by-id/ata-WDC_WD3000HLFS-01G6U0_WD-WXD0C7949084
(hd1) /dev/disk/by-id/ata-ST31500341AS_9VS32EM8
(hd0) /dev/disk/by-id/ata-WDC_WD5000AAJB-00YRA0_WD-WCAS86352573

That’s fine. Same as before isn’t it.
Just try as above

Actually I am not having any problems I am just trying to follow what is happening. I have a boot flag on hd0 and hd1 and bios set to boot from hd0 and grub is on hd2?

I don’t follow.
If you are merely experimenting with multi-boot, go ahead.

But my advice for what it’s worth. Keep Linux on a separate HD, (which you have.) Install Win OS’s first.
Then set the HD you plan to install SUSE to as 1st in the BIOS and install SUSE, placing grub on that HD, either to the MBR or the extended partition if you have one.

Hi caf4926

Great thread…was exactly what I was looking for !!!:slight_smile:

Cheers Otto

Excellent. Thank you

Echoing earlier replies, this is an invaluable thread. Great work!

For my clarity, the original post stated

Step 1

1. Get yourself Parted Magic Downloads - Burn it to a cd. (EDIT) (I'm adding a link to download a working version of Parted Magic as the current version is not) http://dl.dropbox.com/u/10573557/pmagic-4.5.iso

Is the download site version (5.6, as of 10.24.2010) a “non-working” version ? I ask prior to using Parted Magic to avoid any potential problem(s).

Yes new version doesn’t work. Use the drop box version here.

Regards,