LinuxQuestions.org
Register a domain and help support LQ
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 12-07-2005, 05:22 PM   #1
loninappleton
Member
 
Registered: Oct 2004
Distribution: red hat fedora core 2
Posts: 61

Rep: Reputation: 15
Using and editing Grub or boot with System Rescue cd


Hello again,

I have an installed version of Mepis Linux on a hard drive. If I move the drive from one plug to another I get the
kernel panic error.

I would like to salvage what is on that drive and need to either successfully edit grub or in some way such as System Rescue cd.. recue the drive and tell it where to boot from.

I used Esc to get out of the grub splash screen to edit the needed line and was lost. While I could 'e' to\edit line, I did not see how to save it anywhere. The grub manual was to complex. I just want to be able to restart the drive and have it recognize where it is with no kernel panics. Grub
manual mentioned a fall back routine so that if the drive is not found in one place it will look in another.

So i need step by step instructions to do this.

Below is the detailed info I have copied out:

Mepis at hdb3, kernel 2.6.12
Memtest

> esc

Line 1: Kernel (Hd0,2)/boot/vmlinuz-2.6.12 roor=/dev/hdb3 nomce quiet splash= (more read off end of screen)

Line 2:initrd(hd0,2)/boot/initrd.splash


A test of running System Rescue Cd and
running Qtparted in that showed that the actual location hdd was recognized as where the drive is installed.

I need help in being able to define in the bootloader where the drive is and
how to boot it there.

What happens when the drive is cold booted is the following message:

Kernel Panic: not synching: VFS: Unable to mount root fs on unknown- block (0,0)

And remember to say how to save it.


lon
 
Old 12-08-2005, 11:54 AM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,536

Rep: Reputation: 178Reputation: 178
"I have an installed version of Mepis Linux on a hard drive. If I move the drive from one plug to another I get the kernel panic error."

When you move a drive you need to edit /boot/grub/grub.menu.lst and /etc/fstab. You will also have to run grub-install after you edit /boot/grub/grub.menu.lst so that the MBR points to the new /boot/grub/grub.menu.lst.

To do the editing you boot a rescue CD. Then mount your Mepis partition (/dev/hdb3). Some rescue CDs mount every partition as read only when they book so you should umount a partition before you mount it in case it is already mounted read only. So mounting Mepis from a rescue system would look something like this:

umount /dev/hdb3
mkdir /fixMepis
mount -t ext3 /dev/hdb3 /fixMepis

Then use an editor to edit /fixMepis/boot/grub/grub.menu.lst and /fixMepis/etc/fstab. grub uses relative addressing. If you have added a second hard drive to /dev/hda then your drive on /dev/hdb is called hd1 by grub. If you still have only one hard drive then the drive on /dev/hdb is still called hd0 by grub. The two lines that you quoted from menu.lst should be changed to:

Line 1: Kernel (hd1,2)/boot/vmlinuz-2.6.12 root=/dev/hdb3 nomce quiet splash= (more read off end of screen)

Line 2:initrd(hd1,2)/boot/initrd.splash


Once the two files are set up correctly then you need to run grub-install to fix the MBR. Remove the rescue CD. Assuming that you are booting from /dev/hda the commands are:

chroot /fixMepis
/sbin/grub-install /dev/hda
shutdown -r now

--------------------
Steve Stites
 
Old 12-08-2005, 02:54 PM   #3
loninappleton
Member
 
Registered: Oct 2004
Distribution: red hat fedora core 2
Posts: 61

Original Poster
Rep: Reputation: 15
I see that I still have a long way to go.

:-/

Thanks for answering.


Can you address the "fallback" procedure in grub to have a way to find the drive on other channels?
 
Old 12-08-2005, 05:17 PM   #4
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,381

Rep: Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109
When you've got a Rescue CD up and running, you're in a complete Linux environment. But none of your hard-drives are mounted as a root filesystem, so you can edit them at will. And you've got a lot of tools with which to do it, although they're probably not GUI-graphics programs.

So, as you saw, you create a mount-point directory and mount one of the drives onto it. That'll give you access to, say, the boot partition (probably #1), the regular root-partition (maybe #3), and so on.

There will be a learning curve to go through; that's unavoidable and it's steep the first time. Maybe the best way to approach it is to shut-down a working-well system, boot up a rescue-CD, and then (carefully) look around. See what's on it. Much better to do that when you know that you can simply reboot, than to wait until ... ... the point at which, I daresay, every single one of us did wait-until ... to actually stick the CD into a drive and try it out.
 
Old 12-08-2005, 05:31 PM   #5
loninappleton
Member
 
Registered: Oct 2004
Distribution: red hat fedora core 2
Posts: 61

Original Poster
Rep: Reputation: 15
I noticed that the System Rescue Cd starts out with a nice menu of stuff but then is anxious to dump the user off into the command line where it's very difficult to know what's going on.


Do you have a preferred rescue cd program to do these operations?


Is there a scripted fall back routine that can find and boot a drive on any channel?


Why is this not part of the grub bootloader in the first place?
 
Old 12-08-2005, 06:19 PM   #6
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,536

Rep: Reputation: 178Reputation: 178
"Do you have a preferred rescue cd program to do these operations?"

If you are asking about a command line editor I prefer mp. I doubt that your rescue CD has mp so try vi or vim. Almost all rescue CDs provide vi or vim.

"Is there a scripted fall back routine that can find and boot a drive on any channel?"

Not that I know of.

"Why is this not part of the grub bootloader in the first place?"

Boot loaders run in a very primitive programming environment. Programming without having an underlying operating system is painstakingly slow. So I guess that nobody has ever become enthusiastic enough about these ideas to go through all of the work necessary to create such functions in grub. Perhaps you would like to do so.

------------------
Steve Stites
 
  


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
Do you still need grub if you have a single boot system? LinuxPadawan Linux - General 4 04-14-2005 03:39 PM
Editing Grub to get Mandrake to boot... rrfish72 Linux - General 1 12-16-2004 05:51 PM
Editing grub to get Mandrake to boot. rrfish72 Mandriva 1 10-26-2004 02:44 PM
help! grub does not boot the system! dual HD, 3 OS parv Fedora 3 08-31-2004 08:40 AM
GRUB Multi boot system JSThePatriot Linux - Newbie 11 07-30-2004 08:04 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration