LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need help restoring grub (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-restoring-grub-798501/)

LinuxFrusss 03-28-2010 06:37 PM

Need help restoring grub
 
Hello everyone,
I'm a Linux Newbie
I like the software and everything, but there's 1 thing that got me totally frustrated.
I went to format an external harddisk using Xp CD, and that apparently wiped out my grub.
Now, I've searched thousands of sites on how to restore that.
And I can't even seem to understand that thing....
a lot of them contains stuff like (hd0,0) with some sudo dev/sda something and grub, and a lot of things I can't find my way around them.
Isn't there an easier way to do this ?
I got completely frustrated, and now I'll just reformat and install the damn thing again.
GRRRRRR

pixellany 03-28-2010 07:05 PM

I fixed your title (I'm sure it made you feel better, but it did not help us understand your issue......;))

To restore GRUB, you can boot from any Linux live CD (eg the one you used to install Linux).

Please tell us more about your system---eg drive and partition setup, and which version of Linux

amani 03-28-2010 07:07 PM

Mention your Linux distribution

LinuxFrusss 03-28-2010 07:17 PM

Quote:

Originally Posted by amani (Post 3915964)
Mention your Linux distribution

Linux Mint 8 Main Edition

pixellany 03-28-2010 07:20 PM

Quote:

Originally Posted by pixellany (Post 3915960)
Please tell us more about your system---eg drive and partition setup,

To give the specific commands to restore grub, we need to know the details of your setup........

LinuxFrusss 03-28-2010 07:21 PM

Drive and Partition Setup ??? Uggg

I just have Winows Vista, Windows 7 and supposedly Linux Mint 8
I went to a program in Linux, that's call Gparted
I saw that my linux partition ( or I dunno how to call it) is dev/sda/6
there's was something else called linux swap. I understand that is used as a memory by linux....or something like that
But that thing about hd0,0 or hd0,3
i just dunno what the heck that is

damgar 03-28-2010 07:24 PM

(hd0,0)is the first partition on the first disk. If you only have one disk every partion will be (hd0,something)

/dev/sda6 = (hd0,5)

LinuxFrusss 03-28-2010 07:24 PM

If it serves as any help
My laptop came with Vista....then I installed Windows 7, and then Linux Mint 8 ME

Also, is there a way to lock that grub so that it won't go anyway anymore ?

LinuxFrusss 03-28-2010 07:26 PM

ohh...so my linux partition is (hd0,5)
what's next ?

damgar 03-28-2010 07:28 PM

Grub didn't just go away. You said you used a windows install disk to partion something. Windows always behaves as though it were the only OS in the world, so if you install windows after you have linux installed you are generally going to lose Grub, because Windows will overwrite the MBR which holds stage 1 of Grub. It's a better idea to use something like Gparted or your favorite windows based partition editor (so long as it understands that there is a world beyond windows) to manipulate partitions. The exception to this rule would be resizing a windows partition from inside windows, with it's built in utitlity.

pixellany 03-28-2010 07:31 PM

sda6 and (hd0,5) are equivalent. the latter is the GRUB terminology.

To restore grub:

boot from the Linux install CD, and get into a terminal.
enter "grub" to start the GRUB shell.
enter "root (hd0,5)", and then "setup (hd0)"

take out the CD, reboot, and you should be back in business.

Quote:

Also, is there a way to lock that grub so that it won't go anyway anymore ?
Don't install Windows!! Otherwise, NO.

bigrigdriver 03-28-2010 08:02 PM

The closest you can come to a lock on the MBR is to do as pixellany says, or use the dd command to make a copy of it in your home directory. Next time windows overwrites the MBR, just copy your grub MBR back to the MBR. Search thes forums for instructions.

LinuxFrusss 03-28-2010 08:03 PM

When I type grub and hit enter
it says that grub is not installed....etc, and to install it, type
sudo apt-get install grub

Is this normal ?

LinuxFrusss 03-28-2010 08:18 PM

I installed the grub....then entered grub and then root (hd0,5)
and it says
error 21, selected disk does not exist

damgar 03-28-2010 08:22 PM

Code:

fdisk -l
will show you your partitions as the live environment sees them. You might need sudo before the fdisk command.


All times are GMT -5. The time now is 05:01 PM.