SparkyLinux Forums

Software & hardware support => Applications => Topic started by: dhinds on February 04, 2014, 12:11:49 AM

Title: [SOLVED] Rebuilding Grub
Post by: dhinds on February 04, 2014, 12:11:49 AM
What's the code to rebuild Grub on the mbr of /sda?



TIA
Title: Re: Rebuilding Grub
Post by: pavroo on February 04, 2014, 01:15:43 AM
If you run Sparky installed on a hard drive, find package 'grub' in Synaptic, mark all installed grub packs for reinstalling.

There are 4 or 5 packages installed already so reinstall theme. That's all.

This is the easiest way.
Title: Re: Rebuilding Grub
Post by: dhinds on February 04, 2014, 04:48:14 PM

Quote:

Quote from pavroo on February 4, 2014, 01:15

If you run Sparky installed on a hard drive, find package 'grub' in Synaptic, mark all installed grub packs for reinstalling.

There are 4 or 5 packages installed already so reinstall theme. That's all.

This is the easiest way.




Thanks pavroo.  You are right - it was easy to do.  However, the problem has not been resolved.  To start from the beginning:



The power supply of a desktop computer failed after 3.5 years and was replaced.  However, the 2 identical hard drives were connected in the reverse order (what had been sda was recognized as sdb, which prevented Sparky Ultra from recognizing the user account's /home partition).



Meanwhile I entered openSUSE (which I hadn't been using), which updated it's system and took over the Grub.



But - I then reconnected the hard drives so that the original disk identities were restored (sda as sda etc. - which allowed Sparky Ultra to return to normal) and proceeded to reinstall Grub as you recommended.  Four files were reinstalled:



Quote:

  • grub-common
  • grub-pc
  • grub-pc-bin (and)
  • grub2-common



At the end of the re-installation I was asked where I wanted the Grub installed and I checked sda (although Sparky Ultra is on sdb15, the grub had always been on the mbr of sda).



But that didn't work.  Using a SuperGrub2 boot disk for 2011, I re-entered Sparky and reinstalled grub once again.  And again.  But with the same results (except I wasn't asked where I wanted the grub installed again), which reads as follows:



Quote:

Welcome to Grub

error: unknown file system.

Entering rescue mode...

grub rescue>




Apparently, I am still goiing to have to code - or install an alternative bootloader.  (At present, I must use a Super Grub2 boot disk to load the OS).



(I attempted to change the boot preference order for the two hard drives in the BIOS - Award BIOS v. F7 for a Gigabyte X58A-UD7  but observed no change - of course the drives are identical).



Recommendations?



(openSUSE Gnome is about the only other system I ever use on that computer, although LMDE, Solus, Point and Neptune -all Debian deriitives- are also installed).

Title: Re: Rebuilding Grub
Post by: pavroo on February 04, 2014, 08:49:27 PM
What OS have you installed as the last one?
Title: Re: Rebuilding Grub
Post by: dhinds on February 04, 2014, 09:05:40 PM

Quote:

Quote from pavroo on February 4, 2014, 20:49

What OS have you installed as the last one?




The last one was Sparky Ultra but as I mentioned, I went into openSUSE and it was updated/upgraded, which captured the Grub.  This was complicated additionally because the hard drives were removed before taking the computer in to intall a new power supply and when they were reinstalled again later, the order was wrong.  And I think openSUSE was updated before I changed them back.



What I don't understand is why reinstalling the Grub from Sparky Ultra to the correct sda didn't resolve this issue.



As I said, I can get in by using a SuperGrup2 boot disk, but I'd prefer to fix this and avoid doing that every time I boot the computer.
Title: Re: Rebuilding Grub
Post by: pavroo on February 04, 2014, 10:31:34 PM
Alright, I just want to make sure.

Connect your disks as before you were installing Sparky Ultra.

Run Boot-Repair-Disk (LiveCD) or Sparky 3.2.1 Xfce Live. Both of theme feature 'boot-repair' tool can recover GRUB automatically.

I don't have more ideas in this moment.
Title: Re: Rebuilding Grub
Post by: dhinds on February 04, 2014, 10:53:39 PM

Quote:

Quote from pavroo on February 4, 2014, 22:31

Alright, I just want to make sure.

Connect your disks as before you were installing Sparky Ultra.

Run Boot-Repair-Disk (LiveCD) or Sparky 3.2.1 Xfce Live. Both of theme feature 'boot-repair' tool can recover GRUB automatically.

I don't have more ideas in this moment.




OK. I'll try that.  I already downloaded both so I'll burn one or the other to a cd / dvd and see how it works.  Hopefully it's highly configurable and will allow me to choose where to put the grub and which bootable images (OS's) it will contain.



Since the XFCE version is the latest I assume the next version of Ultra will include it also.  It might be helpful to run it directly from Sparky Ultra.



I noticed that Synaptic shows something called grub-coreboot in the repositories which is intended to replace both the present version of grub2 and the bios, and that Gigabyte supports this.



Well, I fixed it; and it worked out exactly as I thought:  I bothered to read the startup screen and remembered that F12 summons a boot menu.  After choosing HD, it let me choose the second drive instead of the first and sure enough that brought up the Sparky Ultra Boot Menu screen, with no cd needed.  For some reason the Gigabyte Award BIOS wouldn't let me change the boot order of the two hard drives and the rest of their BIOS's are beta.  (The next Motherboard I buy is not going to be from Gigabygte).