Reinstalling Grub

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

Reinstalling Grub

Postby rcdeacon on Fri Mar 21, 2008 4:24 am

How can I just reinstall grub. I am not dual booting. I tried to load another distro for testing purposes AFTER my initial Mint install and now I have that distro's grub but I will be deleting that partition (the distro was a failure in my view) but I want to reinstall the Mint grub. Is that possible and how do I go about it?
Neither is there in any other: for there is no other name under heaven given among men, whereby we must be saved. Acts 4:12.
Dell Dimension 4600, 1g, Nvidia 5500, Mint 4.0, Mepis 7.0, XP
Acer Aspire 5002 WLMi, 1g, Sis 760, Mint 4.0
rcdeacon
Level 3
Level 3
 
Posts: 138
Joined: Fri Jun 29, 2007 5:25 pm
Location: Murfreesboro, North Carolina, USA

Linux Mint is funded by ads and donations.
 

Re: Reinstalling Grub

Postby Husse on Fri Mar 21, 2008 7:49 am

There is a good wiki (must be as I've written it :)) about grub
http://www.linuxmint.com/wiki/index.php ... _your_grub
That's all you need (I hope)
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Reinstalling Grub

Postby rcdeacon on Fri Mar 21, 2008 12:12 pm

Thank you for the reply Husse. I also found out that SuperGrub will restore the Mint grub as well. Didn't know that at the time I posted. I keep learning. One day I will be very dangerous in the linux world.
Neither is there in any other: for there is no other name under heaven given among men, whereby we must be saved. Acts 4:12.
Dell Dimension 4600, 1g, Nvidia 5500, Mint 4.0, Mepis 7.0, XP
Acer Aspire 5002 WLMi, 1g, Sis 760, Mint 4.0
rcdeacon
Level 3
Level 3
 
Posts: 138
Joined: Fri Jun 29, 2007 5:25 pm
Location: Murfreesboro, North Carolina, USA

Re: Reinstalling Grub

Postby McLovin on Fri Mar 21, 2008 1:08 pm

Husse wrote:There is a good wiki (must be as I've written it :)) about grub
http://www.linuxmint.com/wiki/index.php ... _your_grub
That's all you need (I hope)

I really am a putz, I'm getting a "Error 15: File not found" error, it seems that the MBR is all kinds of messed up, I have it on the dist the mint is installed on, but I have 2 disk, sda, hda, sdb, sda is the master HDD, a sata, the second, (where mint is installed) is hda, an ide HDD, and the third sdb, is an external HDD. I can easily bott, but I have to enter the boot options from my bios by hitting f12 during boot, but would like to be able to reinstall the grub to the 1st MBR on sda.I'm not really sure what I did, or how I messed this up so badly. Can I just do
Code: Select all
grub> setup (sd0)
to get it back the the proper partition?
User avatar
McLovin
Level 5
Level 5
 
Posts: 788
Joined: Thu Aug 23, 2007 6:53 pm

Re: Reinstalling Grub

Postby Fred on Fri Mar 21, 2008 2:29 pm

McLovin,

First, I would like to thank you for all that fine artwork you do. I have no taste, no sense of color, and no talent. Even my stick figures look broken and abnormal. :-)

If you will tell me what disks and partitions your installs are on; what disk you want to boot from; and what disk and partition the menu you want to use is on; I will be glad to tell you how to get it all back together.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Reinstalling Grub

Postby Fred on Fri Mar 21, 2008 2:54 pm

rcdeacon,

The info that Husse pointed you to is very good. There is a lot of useful information there.

If you are going to be testing and playing, so to speak, with different distros, you might want to look at the thread below. There is also some additional information there about chainloading and grub in general.

viewtopic.php?f=46&t=10043&start=30

Fred

Edit: Where is Murfreesboro. I live west and a bit north of Charlotte. Out in the sticks, so to speak. :-)
Last edited by Fred on Fri Mar 21, 2008 5:14 pm, edited 1 time in total.
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Reinstalling Grub

Postby McLovin on Fri Mar 21, 2008 2:55 pm

ok, I think I really messed something up, I am triple booting, Vista (I know I know, but I do alot of gaming and graphic design, plus I have a home business for computer repair and custom building, so I need it) which is on sdb2&3, which is the main HDD, (not sure why it shows as sdb as it is the main partition of the computers bios, but it does) I have a second internal HDD, that is an ide but shows up as sda, and mint is install on sda5&6 with sda1 as the extended, and then I have Ubuntu 8.04 for testing installed on sdb6&7, (the primary partition) I installed mint on the second disk as I want to utilize that one for Mint and OSx86 ,(I have another 30 gigs on the dist set aside and unformatted just for that purpose) Ubuntu installed a grub to BOTH mbr's, the sda and the sdb, but when I boot, if I use the main MBR, it says disk not found, hmmmmm, so I have hit f12 when booting to boot from the second HDD, the ide, and then I get the same Ubuntu grub, and all works fine. For some reason when i run
Code: Select all
fdisk -l
in console it only shows my external drive (sdc) so I have to go to Gparted to get my partition labels. Grub should install itself to the primary partition by default, but it installs to sda, (the second drive), do you think maybe I have a drive jumper set wrong? I'll look into that, and if you can give any kind of advice, I would appreciate it, as I am at a loss atm.
Edit: I tried to get into the root by enter
Code: Select all
root (hd0)
and got
Code: Select all
error:filetype unknown, using entire disk
I stopper right there, as I have lost entire installs that way.
User avatar
McLovin
Level 5
Level 5
 
Posts: 788
Joined: Thu Aug 23, 2007 6:53 pm

Re: Reinstalling Grub

Postby Fred on Fri Mar 21, 2008 4:05 pm

McLovin,

First, do you have Supergrub laying around? If not I would go download and burn it. You can always us it to boot into an install, if all else fails. I usually don't try to fix stuff with it, because depending on what is wrong it can cause more problems. But it makes a great all purpose boot disk.

Ok, I am assuming that the default boot disk is sdb. Also that the partition the menu you want to use is on is sda5. If this is not correct don't follow my instructions until you correct me.

Boot into the Mint install that I am assuming / is on, sda5. Check in Gparted and make sure the disks and partitions are shown as you said they are. Since it seems the disk designations are backwards, you need to check carefully that the partitions and drives are as you say they are. If it is correct, open a terminal and type:

sudo grub

root (hd0,4)

setup (hd1)

quit

This will boot grub from the drive Windows is on. If you want it to boot from the other disk, sda, then use setup (hd0) above.

If this menu doesn't work right for you let me know and we can fix that too.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Reinstalling Grub

Postby McLovin on Fri Mar 21, 2008 4:39 pm

that got into my actual mbr, but i got an Error 15: no grub found error. And yes, those partitions I listed are correct, so we are on th right path, now to get grub actually installed.
and to answer your first ?, yes I have supergrub.
User avatar
McLovin
Level 5
Level 5
 
Posts: 788
Joined: Thu Aug 23, 2007 6:53 pm

Re: Reinstalling Grub

Postby Fred on Fri Mar 21, 2008 4:56 pm

Like I said, I am assuming sda5 is the / directory of Mint. Look in the /boot directory on that partition and see if you have a grub folder. If you do open it and see if you have a menu.list file. Also check for a stage 1, 1.5 and stage 2 kernel.

Let me know if you do or don't to any of the above.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Reinstalling Grub

Postby Fred on Fri Mar 21, 2008 5:01 pm

McLovin,

I am sure your Mint UUIDs are scrambled if you installed Kubuntu after Mint. But we can get to that in due time. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Reinstalling Grub

Postby McLovin on Fri Mar 21, 2008 5:37 pm

I can still boot, I have all the option to get into any distro, I just have to enter the boot options screen to do so, not too big a deal, but I would like to get it straitened out at some point.
User avatar
McLovin
Level 5
Level 5
 
Posts: 788
Joined: Thu Aug 23, 2007 6:53 pm

Re: Reinstalling Grub

Postby Fred on Fri Mar 21, 2008 5:57 pm

Well of course it is up to you. But I will pursue it with you if you want me too. It can be fixed, just a matter of finding all the pieces. Course it might take a bit to find it all.

When you decide you want to take the time to play with it let me know and I'll be happy to work with you. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Reinstalling Grub

Postby Husse on Fri Mar 21, 2008 6:59 pm

which is the main HDD, (not sure why it shows as sdb as it is the main partition of the computers bios, but it does) I have a second internal HDD, that is an ide but shows up as sda,

sda is the first master in IDE obviously
sdb is a SATA
On newer motherboards SATA "goes before" IDE which makes me think that you either have an old mobo or that disk is not connected to the first SATA connector - it does not help to change boot order. In most cases Linux can "read" the mobo and it uses the physical connector to decide the "dev", not how you changed in BIOS - BIOS is largely ignored by the operating system.
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Reinstalling Grub

Postby McLovin on Fri Mar 21, 2008 7:08 pm

thanx guys, I have to do some work in Windows for a few hours, I have some things I have to check out, and some network issues to fix for someone, as soon as I finish those things I'll post back and see if we can get this sorted out,.....I feel so noob. In the meantime when I finish what I have to do in Windows, I'm gonna open up my case and check the jumers, and input connections and see if maybe thing is haywire hardware wise and let you know what I find out.
User avatar
McLovin
Level 5
Level 5
 
Posts: 788
Joined: Thu Aug 23, 2007 6:53 pm

Re: Reinstalling Grub

Postby Fred on Fri Mar 21, 2008 10:19 pm

Husse,

Good points. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Reinstalling Grub

Postby McLovin on Sat Mar 22, 2008 12:21 am

ok, i think we may be making some progress here, I have the drives lugged into the right ports, there is only 1 ide port so no issue there (though the dvd rom drove was set to CS, so I changed that to master to guarantee the HDD would be slave) and the sata is in sata port 1. And then when I booted up I got an error about
Code: Select all
/dev/sda6-fsck unable to resolve
and grabbed this from /var/log/fsck/ckeckfs
Code: Select all
Log of fsck -C -R -A -a
Sat Mar 22 00:01:09 2008

fsck 1.40.2 (12-Jul-2007)
/dev/sda6: clean, 134093/2501856 files, 586980/5000223 blocks (check after next mount)
fsck.ext3: Unable to resolve 'UUID=f099817f-4a0f-4821-94be-428acea2fa6b'

fsck.ext3: Unable to resolve 'UUID=00fc4dea-1c0b-49da-8fd8-b215b1a35792'

fsck died with exit status 8

Sat Mar 22 00:01:09 2008
----------------
never encountered this before, so any help would be appreciated.
User avatar
McLovin
Level 5
Level 5
 
Posts: 788
Joined: Thu Aug 23, 2007 6:53 pm

Re: Reinstalling Grub

Postby Fred on Sat Mar 22, 2008 4:07 pm

McLovin,

It might be easier at this point to go ahead and correct your UUIDs in your Mint and Kubuntu installs.

From either of your Linux installs, or from a live cd open a terminal and type:

sudo vol_id -u /dev/sdxx

Replacing sdxx with the drive letter and partition number of each of your partitions as now shown in Gparted. You will need to edit the /etc/fstab of Mint and probably Kubuntu also. Replace the old UUIDs with the new ones. Check to see they are labeled correctly also. You will probably need to do this in both /boot/grub/menu.lst also.

Then you can start fresh with installing grub. Let me know if you need some help installing grub. Install from the Mint install through a terminal, for both the Mint and Kubuntu installs. Don't panic if the menu isn't right. We can fix that, and will probably have to.

Think BIOS to kernel to menu to kernel. So you install the grub kernel to the booting disk mbr and tell it where the menu you want it to look at is. Then through the menu you tell it were the kernel is you want it to boot. Either the Linux kernel or another grub kernel.

The root command tells the kernel where the menu is that you want associated with that grub kernel.

The setup command tells where you want the grub kernel installed. It can be to a hard disk mbr or to a partition.

The format is:

sudo grub

root (hd0,1) ----------- the menu is on the 1st drive, 2nd partition.

setup (hd0) ----------- the grub kernel is installed to the mbr of the 1st drive.

quit

Other root and setup examples:

root (hd1,4) ----------- the menu is on the 2nd drive, 5th partition.

setup (hd1,4) --------- the grub kernel is installed to the 2nd drive, 5th partition.

If you want to learn more about grub look at the link Husse gave above or I have an example and some commentary in the below link.

viewtopic.php?f=46&t=10043&start=30

Fred
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Reinstalling Grub

Postby McLovin on Sat Mar 22, 2008 5:10 pm

thanx, I'll give that a try. I'm actually going to try to screw myself again, I'm removing Ubuntu 8.04, (still too buggy, and the new features just aren't worth the trouble) and install Debian Lenny, I kind of want to play with a pure disrto, and then try to mess it all up, I like to break things :mrgreen:
User avatar
McLovin
Level 5
Level 5
 
Posts: 788
Joined: Thu Aug 23, 2007 6:53 pm

Re: Reinstalling Grub

Postby Fred on Sat Mar 22, 2008 7:08 pm

If you like KDE you might try "Sidux." It is a cleaned up "sid" derivative. I put it on a couple weeks ago and kinda like it. Not as polished as Mint but nice just the same. And fast.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Linux Mint is funded by ads and donations.
 
Next

Return to Installation & Boot

Who is online

Users browsing this forum: konrad and 14 guests