Showing posts with label grub. Show all posts
Showing posts with label grub. Show all posts

Monday, January 11, 2010

Restoring Grub With A LiveCD

I enjoy installing different distributions that I usually find first on Distrowatch. This is the premiere Linux site for finding what's the latest on your favorite distro. I like to install the Debian derivatives like Ubuntu, Mint, Mepis, AntiX and now the most recent I have downloaded, elive. I have also cut my Linux teeth on Damn Small Linux, Zenwalk, Slax, Back Track and a few others. But the common denominator is I start looking and keep current on the Distrowatch site. This site is a great resource for the Linux enthusiast.

It was here I found the terrific article on Restoring Grub written by Jesse Smith in the Questions and Answers section. I felt it was a well written and easy to understand article that covers an important piece of information. No one wants to see the fatal message No Operating System found or Grub errors 17, 22 or 25. (These are the three I've seen in my short Linux experience.) Here is the article in its entirety re-posted with permission.

Restoring GRUB

Can't-boot-any-more asks: Distro hopping wiped out my GRUB. How can I reconstruct it?

DistroWatch answers: Sometimes when making changes to a hard drive, such as installing a new operating system, the disk's master boot record (MBR) will get wiped or corrupted. When that happens, GRUB will no longer function. This has the unfortunate side effect of preventing the user from being able to boot their operating system and, in those cases, it's important to be able to get the system up and running again, preferably without re-installing the operating system(s) from scratch.

The easiest way to get GRUB back on-line is with a live CD. It doesn't really matter which live CD, so long as it comes with a copy of GRUB. Place the live CD into the computer and boot from it. We're then going to venture into command-line territory. The next thing to do is run the "grub" command as root or, if you are running a live CD that uses sudo, run "sudo grub". This will start GRUB and provide us with a prompt.

     grub>

We'll then find out where the GRUB files are located:

     grub> find /boot/grub/stage1

The find command will return a disk location for us. Probably "(hd0,0)" or "(hd0,1)". We now know where the GRUB files are stored. Next, we'll tell GRUB to use this location in the future. In the following step, type "root", followed by the location we were given above. In my case:

     grub> root (hd0,1)

GRUB now knows where its files are located and we need to re-setup GRUB in the master boot record. To do this, we type:

     grub> setup (hd0)

The above step should work for most people, who have GRUB installed in the MBR. For folks who have installed GRUB onto a partition, the "setup" command can be modified to include the partition number. The catch is, you need to know where you originally installed GRUB. In these cases, remember that GRUB starts counting partitions from zero, not one. So, for example, if GRUB was installed on the third partition of the first hard drive, the "setup" command will look like this:

     grub> setup (hd0,2)

When we get back to the prompt again, we can quit GRUB:

     grub> quit

And then reboot the computer. Remove the live CD from the drive and we should be back to normal.

Monday, September 7, 2009

Grub Error 17

Have you found yourself booting to error 17? How about the dreaded 18 or 22? This happens when Grub cannot find the bootable Linux files either because of disk corruption (worse case scenario) or corruption of Grub's files mainly menu.lst. This is where Super Grub can be of assistance. It is a specialty distro geared for fixing Grub errors and can even be used to fix a Windows MBR too or both at the same time. This is definitely one tool you want in your toolbox before you need it. I have had to use it on three different occasions. Two for error 17 and one for error 22. Super Grub came through on both occasions and save my system without data loss and minimal effort. I found it pretty straightforward to use as it will guide you every step of the way. Download Super Grub and stick it away safely until the day comes, and it will come, when you need this great little tool. It will simply save the day. If you know of other great tools to fix the boot record let's hear about them in the comments.

Tuesday, August 18, 2009

Parted Magic Updated To 4.4

Parted Magic version 4.4 was released on the 13th of this month. I carry the live USB version with me all the time since you never know when you will need the tools. Updating the USB drive was very simple process. After downloading the pmagic-usb-4.4.zip file (mirrors here) simply unpack the files to your hard drive. Copy the folders boot and pmagic to your thumb drive replacing the current files. That's it your done with an upgrade. If you do not yet have this on a USB key follow the instructions on the documentation pages. If you prefer a bootable cd Parted Magic has an iso for that too. I did test my upgrade and the boot was clean and quick. One of the additions I noticed was Super Grub Disk in the boot menu. Super Grub Disk is a great tool for editing the Grub menu. I have used it on more than one occasion when I had a non-booting machine with a Grub error. I think Super Grub Disk deserves a post of its own so let's get back to Parted Magic. For the complete list of updates visit the homepage and drop a donation in the author's PayPal button to ensure this great set of tools will continue to be developed.