LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2010, 06:37 PM   #1
LinuxFrusss
LQ Newbie
 
Registered: Mar 2010
Posts: 13

Rep: Reputation: 0
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

Last edited by pixellany; 03-28-2010 at 07:02 PM.
 
Old 03-28-2010, 07:05 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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
 
Old 03-28-2010, 07:07 PM   #3
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
Mention your Linux distribution
 
Old 03-28-2010, 07:17 PM   #4
LinuxFrusss
LQ Newbie
 
Registered: Mar 2010
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by amani View Post
Mention your Linux distribution
Linux Mint 8 Main Edition
 
Old 03-28-2010, 07:20 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by pixellany View Post
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........
 
Old 03-28-2010, 07:21 PM   #6
LinuxFrusss
LQ Newbie
 
Registered: Mar 2010
Posts: 13

Original Poster
Rep: Reputation: 0
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
 
Old 03-28-2010, 07:24 PM   #7
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
(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)
 
Old 03-28-2010, 07:24 PM   #8
LinuxFrusss
LQ Newbie
 
Registered: Mar 2010
Posts: 13

Original Poster
Rep: Reputation: 0
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 ?
 
Old 03-28-2010, 07:26 PM   #9
LinuxFrusss
LQ Newbie
 
Registered: Mar 2010
Posts: 13

Original Poster
Rep: Reputation: 0
ohh...so my linux partition is (hd0,5)
what's next ?
 
Old 03-28-2010, 07:28 PM   #10
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
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.
 
Old 03-28-2010, 07:31 PM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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.
 
Old 03-28-2010, 08:02 PM   #12
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,887

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
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.
 
Old 03-28-2010, 08:03 PM   #13
LinuxFrusss
LQ Newbie
 
Registered: Mar 2010
Posts: 13

Original Poster
Rep: Reputation: 0
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 ?
 
Old 03-28-2010, 08:18 PM   #14
LinuxFrusss
LQ Newbie
 
Registered: Mar 2010
Posts: 13

Original Poster
Rep: Reputation: 0
I installed the grub....then entered grub and then root (hd0,5)
and it says
error 21, selected disk does not exist
 
Old 03-28-2010, 08:22 PM   #15
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Partial upgrade of KDE 3.5 to 4.2 (grrrrr) in Squeeze jdkaye Debian 2 05-18-2009 07:13 AM
Xine codecs....Grrrrr.... kc0ltv SUSE / openSUSE 7 04-27-2006 07:13 PM
Kaffeine keeps loading!! GRRRRR help Mystical Itachi SUSE / openSUSE 5 10-17-2004 02:14 AM
grrrrr why its dont working!? hunter_one Linux - Software 18 09-05-2003 03:38 PM
Internet Dial up is grrrrr crap. dannyflounders Slackware 3 07-30-2003 12:04 PM


All times are GMT -5. The time now is 07:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration