LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 06-29-2004, 12:01 AM   #1
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Rep: Reputation: 15
Trouble with fstab


In this thread I was trying to turn my single Linux drive into a setup where the Linux drive was now slave to the Windows drive, and the Linux drive would boot when the boot floppy was inserted.

In that thread, I got a lot of great help, and I was able to successfully copy grub onto a floppy, and grub starts from floppy.

The problem is with the device settings. As you can see at the tail end of that thread, I am supposed to edit the menu.lst on the floppy and the /etc/fstab on the hard drive to refer to hdb instead of hda since the drive is now slave. Well, I didn't do something right on the floppy (menu.lst) because it wouldn't boot. (if you see in the linked thread, I had questions about what to do with the (hd0,0) references) Fine. So I thought I would just boot the old way & then figure things out. But of course now, the /etc/fstab points to a slave drive, so it gave me this:

***An error occurred during the fsck
***Dropping you to a shell; the system will reboot
***When you leave the shell
(Repair filesystem) 1#"

I logged in as root & tried to edit the /etc/fstab back the way it was (or copy the fstab.old file which I had created before editing the fstab file in the first place). But it wouldn't let me copy or edit! It kept complaining that the repair filesystem is read only. All I had done was change three instances of /dev/hda# to /dev/hdb#, so it would have been an easy change.

What should I do next?

Last edited by NickC; 06-29-2004 at 12:02 AM.
 
Old 06-29-2004, 12:53 AM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
try this

kernel (fd0)/boot/vmlinuz rw root=/dev/hdb1 init=/bin/sh


if hdb1 is the root fs, and adjust for the name and path of the kernel on the floppy.


or use something like this


kernel (hd1,0)/boot/vmlinuz rw root=/dev/hdb1 init=/bin/sh

Last edited by DavidPhillips; 06-29-2004 at 12:55 AM.
 
Old 06-29-2004, 08:14 AM   #3
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Original Poster
Rep: Reputation: 15
Thanks - I'll try that. Are you referring to editing the boot command within Grub by hitting "E" ? It sounds like your solution is for allowing the drive to boot up from floppy with the hard drive as slave. Because last night when I realized I did something wrong I tried to go back to the old way just so I could get into Linus - that is, I plugged the drive as master and tried to boot directly off the hard drive. I'm sure if I could somehow change /etc/fstab to show hda again it would work.

And you bring up a good point that I had in my linked thread: are hd0 and hd1 the same as hda and hdb, respectively? Because that's a big confusion I had going from the single drive mode to the boot-only-from-floppy mode. In /floppy/grub/menu.lst and /etc/fstab, do I change all the references to hda into hdb AND all references to hd0 into hd1 ?
 
Old 06-29-2004, 01:46 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
I was speaking from the grub> prompt.

You can tell grub where the kernel is (fd0) or (hd?,?) this is device and partition, and path to kernel and kernel name. (hd0,0)/boot/vmlinuz

If /boot is a partition and you are having trouble with that partition mounting use something like this..

(hd0,3)/vmlinuz

instead of (hd0,0)/boot/vmlinuz with an fstab mounting /dev/hda4 on /boot

you also tell grub where the root filesystem is (where /bin is located) using root=/dev/hda1

init=/bin/sh or init=/bin/bash will get you in without running any startup scripts and bypass login on most systems giving you a command line as root.

rw will mount the filesystem where you can edit files and reinstall grub.



fstab uses /dev/hda1 where grub uses (hd0,0), /dev/hdb1 = (hd1,0) , /dev/hdb2 = (hd1,1).

It's (device# "starting at 0",partition# "starting at 0") as apposed to /dev/device[a-z] "starting with a followed by the partition starting at 1"

(hd0,0) and /dev/hda1 would be the first partition on the primary master harddrive.

(hd, = /dev/hd

0, = a

0) = 1


Last edited by DavidPhillips; 06-29-2004 at 01:56 PM.
 
Old 06-29-2004, 11:21 PM   #5
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Original Poster
Rep: Reputation: 15
Thanks for clearing up the hard drive definitions!

Okay, I tried out what you suggested. At this point, what I'm trying to do is simply go back to the way it was - that is with the Linux drive as standalone. Since the only change I did to that config to make it hose up was to declare three partitions within /etc/fstab from hda to hdb, I figured I just want to change that back.

So, I plugged the Linux drive as standalone (master). I then got into grub and typed in:
Code:
grub> kernel (hd0,0)/boot/vmlinuz rw root=/dev/hda1 init=/bin/sh
as you suggested. The change took place - I was able to verify that these settings were in the default line. But when I tried to boot, it gave me the same thing - somehow it's still complaining about the file system not existing on /dev/hdb1. I have a feeling I'm missing something simple - can you suggest further?

I also tried to use (hd0,#)/vmlinuz in case /boot was a separate partition. But I kept getting error messages. When I just typed in kernel (hd0, <TAB> it listed 3 partitions: 0, 4, and 5. But none of these would accept. Only kernel (hd0,0)/boot/vmlinuz was accepted.

P.S. thanks for being patient with this newbie!
 
Old 06-30-2004, 01:12 AM   #6
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Ok, it sounds like your editing the kernel line. That is ok but there may be a line like this..

root(1,0)

that would cause a problem.



try it like this..


at the menu type c

then you will be at the command prompt, use these these two commands..

grub> kernel (hd0,0)/boot/vmlinuz rw root=/dev/hda1 init=bin/sh

grub> boot


or you could actually use edit and change the lines to

root (hd0,0)
kernel /boot/vmlinuz rw init=/bin/sh

and remove any other lines with d
 
Old 06-30-2004, 08:37 AM   #7
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Original Poster
Rep: Reputation: 15
After typing in kernel (hd0,0)/boot/vmlinuz rw root=/dev/hda1 init=/bin/sh I didn't use the "boot" command - I will try that.

Instead I just hit <ESC> which put me back to the boot loader screen. When that didn't work the first time, I hit "E" to edit the line. And I noticed it had properly changed the kernel definition to (hd0,0) and root to /dev/hda1. So I wonder why when it tried to boot it was looking in /dev/hdb1 ? Maybe it's because I didn't actually execute "boot" at the grub> prompt?

Or do you think that by not explicitly stating root (hd0,0) it still somehow is looking in (hd1,0) even when I had specified root=/dev/hda1 ?

I will try your suggestion when I get home this evening & post back.
 
Old 06-30-2004, 12:03 PM   #8
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
By using the grub prompt you enter the info on one line. If it's accepted you will be returned to the grub prompt.

Then you enter the boot command

The system will start to boot up with the kernel, root filesystem, and init you specified at the prompt. No other grub settings from the menu will be used.

Last edited by DavidPhillips; 06-30-2004 at 12:05 PM.
 
Old 06-30-2004, 06:38 PM   #9
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Original Poster
Rep: Reputation: 15
Back in!

I'm up and running again! Thanks for all the help!!

It was the boot command at the grub> prompt that did it.

Now I can go back and try to get the boot-from-floppy option working again!
 
Old 06-30-2004, 11:00 PM   #10
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
If you install grub to the mbr of the primary master you can use that to boot all of your os'es
 
Old 07-01-2004, 08:48 AM   #11
NickC
Member
 
Registered: Nov 2003
Location: Portland, OR, USA
Posts: 111

Original Poster
Rep: Reputation: 15
That's true. But being that Windows XP is still my & my family's main build, I'm hesitant to play with the MBR of that until I'm more experienced in Linux.

Toward that end, I thought the floppy option would be perfect. Windows drive would be primary master; Linux would be primary slave. Then the machine would always boot into Windows, so as long as the Linux boot floppy is not in, then no one is the wiser: Any of my family who turns on the machine will simply boot into Windows XP like usual.

Then when I want to boot into Linux, I can just power down & fire up with the boot floppy which should override and jump me into the primary slave Linux drive.

As I said, here I didn't do my definitions correctly. From what I understood my other thread that I referenced, I simply need to change the menu.lst in /floppy/boot/grub to reference hd1 instead of hd0 and the /etc/fstab on my hard drive to reference /hdb instead of /hda. I need to try that again now that you've helped me get out of the mess I had created the first time!
 
  


Reply



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
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 06:15 AM
The trouble with fstab/auto/user/s Rudibot Mandriva 1 11-26-2004 07:02 AM
trouble mounting my dvd-rw - can someone check my fstab? sasquatch Linux - Hardware 21 09-27-2004 06:50 AM
(version 5.1 chapter 08 fstab) vs (man fstab) rgiggs Linux From Scratch 2 06-03-2004 05:55 PM
fstab trouble Randall Linux - Newbie 6 12-30-2001 04:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 06:22 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
Open Source Consulting | Domain Registration