LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-07-2005, 09:57 PM   #1
infornography
Member
 
Registered: Oct 2003
Location: Australia
Distribution: Xubuntu 6.10
Posts: 73

Rep: Reputation: 15
Grub is gone, how to get it back?


I just installed Zen Linux (100% Debian unstable compatible) to my hard drive on hda3, replacing Ubuntu. I also have a Windows partition on hda1, and a fat partition on hda2.

Anyway after installing Zen, grub no longer comes up and I can't boot into any OS (using live CD now.) How can I boot into my new Zen (Debian) install so I can then reinstall grub? The CD doen't seem to have an option for it.

Any help would be appreciated.
 
Old 03-07-2005, 10:24 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,289

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
In the LiveCD, mount your root partition, chroot into it and run grub-install /dev/hda (assuming you're using /dev/hda, replace as appropriate). This should give you your grub back.
 
Old 03-07-2005, 10:33 PM   #3
infornography
Member
 
Registered: Oct 2003
Location: Australia
Distribution: Xubuntu 6.10
Posts: 73

Original Poster
Rep: Reputation: 15
Thanks for the help so far, I just have some follow up questions.

My root partition is an ext3 partition on /dev/hda3. What is the command to mount it?

Also, I don't understand what you mean by "chroot into it" can you tell me that command too?

Thanks again.
 
Old 03-07-2005, 10:59 PM   #4
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
From the man page:
NAME
chroot - run command or interactive shell with special
root directory

SYNOPSIS
chroot NEWROOT [COMMAND...]
chroot OPTION


So, if your normal root is, say, /dev/hda3, and after booting from CD/DVD you mounted it on /mnt/myhdd do this:

chroot /mnt/myhdd grub-install

or just chroot /mnt/myhdd and then run grub-install

--Kim
 
Old 03-07-2005, 11:12 PM   #5
infornography
Member
 
Registered: Oct 2003
Location: Australia
Distribution: Xubuntu 6.10
Posts: 73

Original Poster
Rep: Reputation: 15
Ok, I have got that far, but when I run grub-install /dev/hda I get this error:

/dev/hda does not have any corresponding BIOS drive.

I usually install grub to the MBR, does that have anything do so with this?
 
Old 03-08-2005, 12:15 AM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,289

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Hmmm ... can you do a "ls -l /dev/hda" and make sure that the result is the same as in your "real" /dev directory on the CD. It should be, but worth a check.
 
Old 03-08-2005, 12:52 AM   #7
infornography
Member
 
Registered: Oct 2003
Location: Australia
Distribution: Xubuntu 6.10
Posts: 73

Original Poster
Rep: Reputation: 15
Yeah they are the same.

I did do some more googling though and found out that the error was because I didn't have the line "(hd0) /dev/hda" in my /boot/grub/device.map file. Once I added the line I got a new error though:

df: Warning: cannot read table of mounted filesystems: No such file or directory
df: Warning: cannot read table of mounted filesystems: No such file or directory
Could not find device for /boot: Not found or not a block device.

Any ideas on this one?
 
Old 03-08-2005, 01:07 AM   #8
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
You need a section similar to this in menu.lst:

Code:
###Don't change this comment - YaST2 identifier: Original name: Linux - UniProcessor###
title Linux - UniProcessor
    kernel (hd1,0)/boot/vmlinuz root=/dev/hdb1 vga=0x31a splash=silent desktop resume=/dev/hdb2 showopts nosmp
    initrd (hd1,0)/boot/initrd
Notice the kernel(hd1,0)/boot/vmlinuz bit -- and root=/dev/hdb1

You need to inform grub where the kernel us, and then use the Linux nomanclature for the HDD device name because the root= portion is a kernel argument.

Why GRUB uses a different device naming scheme, I have no idea. Maybe they're trying to copy one of Windows' bad ideas? I mean, come on! If you refer to /dev/hda in Linux, it's understood that it's the first IDE device, and if you refer to /dev/sda it's understood that it's the first SCSI device, etc. but when referring to drive(0)partartition(0) or in GRUB's case hd(0,0) what exactly is drive 0? Is it the drive hanging off of the controller with the lowest hardware I/O address? Is it the drive reported as being first in the boot sequence by the BIOS? Is it dictated by the phase of the moon and whether you have more mass planted on your left or right buttcheek at the time of installation? (note that was a rhetorical question just to illustrate that it's certainly not intuitive!)
 
Old 03-08-2005, 01:24 AM   #9
infornography
Member
 
Registered: Oct 2003
Location: Australia
Distribution: Xubuntu 6.10
Posts: 73

Original Poster
Rep: Reputation: 15
I don't think I'm understanding you correctly. This is the command I type:

grub-install /dev/hda

And then I get this output:

df: Warning: cannot read table of mounted filesystems: No such file or directory
df: Warning: cannot read table of mounted filesystems: No such file or directory
Could not find device for /boot: Not found or not a block device.


I cant even find a menu.lst file at the moment.

Again, thanks for all the help so far all.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want GRUB Back! 1veedo Linux - Software 4 02-02-2005 06:32 PM
how to get grub back vijaysh Linux - General 4 12-07-2004 10:55 PM
getting grub back viniosity Linux - Newbie 3 11-30-2004 09:40 AM
help in getting grub back varunk123456 Red Hat 2 05-03-2004 12:08 PM
*sigh* getting grub back. lsgroup Linux - Software 3 03-16-2002 03:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:10 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