Need to reinstall a desperately fouled-up GRUB

Hi all

Running openSUSE 11.3. I have utterly ruined my GRUB setup and can not boot into Linux at all. I will explain more, first some background.

A few weeks ago I reinstalled on my new 1TB SATAII drive. When I did so I unplugged and forgot to reattach my old IDE drive that houses Windows, but was too lazy to do it straight away. Instead I continued using Linux, getting everything set up the way I wanted, until a couple of weeks later when my fiancée got the Sims 3 itch.

I reattached the IDE drive, which became hd0 to GRUB, which is when the trouble started. I had to manually edit files to get GRUB to boot anything; when in Linux the first time I tried fixing the setup with Yast but it didn’t work, so all changes were manual.

For a week or two I had it working fine. I could boot Linux and Windows. Then, on a whim, I decided to change the bootloader menu entry “Windows” to “Windows 6.1”. I did this in Yast.

Suddenly, my Linux bootloader entries had vanished. I don’t know why. At least, the CURRENT ones had. The entry for the previous installation still exists, but attempting to use that merely results in a GRUB loop where it keeps returning to the menu.

Windows also wouldn’t boot.

I tried a few things. I tried editing the GRUB instructions through its editing feature. I tried the Rescue option on the installation disk, but nothing that I tried worked. I tried SuperGrub2. I wanted to try rescatux but don’t have a CD onto which I can burn it and can’t figure out bootable USB sticks.

I eventually resorted to running an update of openSUSE, although it was more of a sidedate, wherein I just told it to update but without actually changing from 11.3. The effect was odd, in that now I can boot into Windows. However, my current Linux installation still does not appear in GRUB.

I’m at a total loss now. All I want is to have GRUB reinstalled and pristine, booting into Linux and, for games, also Windows. I’d be happy to write it to the MBR of any drive, I just want it working.

Unfortunately, I have no idea how to achieve that.

btw, my root partition is Ext4. I have no working floppy drive.

Someone, please, help!

Hi, Here is what I would do:

  1. Create a CD or USB Flash drive to boot into linux with a partition editor. Check out GParted Live CD.
  2. Check BIOS boot order and set your cd or usb before the hard drive.
  3. Boot into your cd or usb stick, Mount your 1T drive and backup all your data.
  4. Attempt repair of GRUB.
  5. If the repair does not work or it is taking too long, run your original installation cd for 11.3. Keep your Windoze partions intact. (Don’t change)

Some caveats are that you can only have 4 Primary partitions per HD. (You can use one primary as extended and then put logical partitions inside.) I am running 11.3 and Vista on 1 machine and 11.3 and XP on another. MBR usually is the first 512 bytes on the drive and may contain your partition table. This can be backed up with dd command or other programs. Check out:
Master boot record - Wikipedia, the free encyclopedia
List of disk partitioning software - Wikipedia, the free encyclopedia.
I just recently ran out of space on one of the windows partitions and one of the Linux partitions, since I’ve been running these two machines since Jan. 2010. I booted both with a debian gparted live cd and resized the full partitions. One worked and one partially worked. One of the linux ext4 partition got messed up in Grub, so had to boot from 11.3 original install and wipe the / , swap, and /boot partitions. Good thing I had my data backed up.

HTH (Hope this helps) … DGo … (-:

Thanks for trying, but limitations prevent me from following your suggestions :frowning:

Meanwhile, I’ve made a new, minimal installation over a disused partition (just as well that I hadn’t sorted out my partitions properly!) and that gave me a mostly-working GRUB, so I’ve been able to boot into my proper installation. Next is fixing GRUB completely.

I’d still like to come up with a method to just flat out reinstall GRUB, for the benefit of others if nothing else.

Then you should make it easier for potential respondents by not withholding pertinent information. If you want help with GRUB the colour of the box your processor came in is irrelevant. Details of the hard drive partitioning and filesystem installations are very relevant.

If you have a “good” installation, save the boot loader, then the first/easiest thing to try is using YaST > “Boot Loader Settings” to “Propose New Configuration”.

SuSE/openSuSE installation DVDs and CDs contain a “Rescue” option at the startup screen.
Boot the system from your install media
At the Install Menu
Select your keyboard layout – usually <F2>
Select "Rescue System
At the Login prompt
Type “root”
<enter>
You will have to know where your root (/) partition is. If you need to check the partition layout
*** fdisk -l***
I am assuming that there is no separate boot bartition for the installation you are trying to repair
Assuming the root partition in question is /dev/sdb1
*** mount /dev/sdb1 /mnt
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc
chroot /mnt
yast***
Then navigate to System > Boot Manager <enter>
Look for “Other”. Yo can choose “Propose Net w Configuration”
90% of the time no further editing is required.
Navigate out of YaST
*** <ctrl>d***
Will take you bac from chroot to the Rescue System
*** init 6***
Will restart the machine.

You may be interested in
updategrub for openSUSE Legacy Grub (not update-grub!)

or

Re-Install Grub Quickly with Parted Magic

It’s not a matter of withholding information, but of not knowing what information is pertinent. That said, I don’t believe I mentioned cpu box colour (outside of my signature).

Also I wanted to include the broken GRUB configuration but couldn’t find a way to access the files. Had I been able to access them, however, I would have simply edited them!

Not much use at the stage where I couldn’t access openSUSE and thus couldn’t get to YaST. Curiously, however, when I did have access to the system I tried this option and it proposed only the broken configuration.

Thank you! This looks like exactly what I needed. I had no idea that I could do any of this from the rescue system.

Given that beautifully generic solution, I do think that perhaps my partition information is not so important. However, it is as follows.

sda (hd0) PATA IDE
sda1 (hd0,0) NTFS
sda2 (hd0,1) ext2 (used for virtual machines)
sdb (hd1, formerly hd0) SATA II
sdb1 (hd1,0) ext4, /
sdb2 (hd1,1) ext4, /home
sdc (hd2, formerly hd1) SATA II
sdc1 (hd2,0) ext4 (former /home, currently going spare)
sdd (hd3, formerly hd2) SATA II
sdd1 (hd3,0) ext4 (former /, new installation / for attempted rescue)
sdd2 (hd3,1) swap