LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 05-11-2004, 02:10 AM   #1
MillyFish
LQ Newbie
 
Registered: Apr 2004
Location: UK - East Midlands
Distribution: RH9 - Shrike
Posts: 8

Rep: Reputation: 0
Messed up my fstab, now wont boot! Help, please.


Hi all,

I rather stupidly messed around my fstab file to automount some file systems. Now when I boot, (even in Rescue mode) I am told that certain filesystems can't mount and I am dropped to a "shell".

I understand this is the linux equivalent of a "msdos prompt" but I dont know any of the commands needed to edit the fstab file. Part of the problem is "...no blank line at the end of the file."

If I could get a text editor running I could probably (though not definitely) have a go at fixing it myself. I'm having to post this from my work computer (Windows!!) so if you need any other info I'll have to check when I get home tonight.

Sorry to be a pain with what is probably a stupid newbie question. (Running Fedora Core 1 by the way)

Thanks in advance, Millyfish
 
Old 05-11-2004, 03:35 AM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
cd /etc
ls -a # there should be a copy of your old fstab called fstab~
mv fstab~ fstab

Last edited by Andrew Benton; 05-11-2004 at 03:37 AM.
 
Old 05-11-2004, 03:55 AM   #3
MillyFish
LQ Newbie
 
Registered: Apr 2004
Location: UK - East Midlands
Distribution: RH9 - Shrike
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks Andrew,

Just to recap (in case I'm as thick as I sometimes think!)

cd /etc ... changes to /etc directory

ls -a # ... lists all files in the directory ?

Supposing fstab~ exists...

mv fstab~ fstab ... overwrites fstab with the copy (fstab~) which existed as a backup when I messed up the original fstab.

Am I understanding correctly??


MillyFish
 
Old 05-11-2004, 03:57 AM   #4
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
i think you do understand.

vi, nano, and pico are text editors you may have access to to edit the file. vi is pretty tough to use. run cat on the file to look at it before overwriting and see if it looks like your old one, if you don't want to try to edit.
run mount
with no options to see where your partition is mounted. then you'll have to cd there to get at the etc/ like cd /mount/sysimage/etc or something like that.

Last edited by whansard; 05-11-2004 at 04:01 AM.
 
Old 05-11-2004, 04:00 AM   #5
Qucho
Member
 
Registered: Mar 2004
Location: Colorado, US
Distribution: Debian "Sarge"
Posts: 228

Rep: Reputation: 30
Yes, you have !!!

[edit] I deleted wrong info.

Last edited by Qucho; 05-11-2004 at 04:01 AM.
 
Old 05-11-2004, 04:09 AM   #6
MillyFish
LQ Newbie
 
Registered: Apr 2004
Location: UK - East Midlands
Distribution: RH9 - Shrike
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks all.

Yes, when I boot in rescue mode, the system is mounted on /mount/sysimage so I'll need to cd to it there. "mv" refers to "move" then.

I'll have a "stab" at this when I get home - pun intended!

Cheers

Millyfish
 
Old 05-11-2004, 04:56 AM   #7
Grymme
Member
 
Registered: Apr 2004
Location: Sweden
Distribution: Slackware
Posts: 44

Rep: Reputation: 15
Incase you don't have an old working version of fstab you can also cd to the directory where fstab is and do a cat fstab.

Paste the output here, and we could perhaps help you correct the errors.
 
Old 05-13-2004, 02:07 AM   #8
MillyFish
LQ Newbie
 
Registered: Apr 2004
Location: UK - East Midlands
Distribution: RH9 - Shrike
Posts: 8

Original Poster
Rep: Reputation: 0
Hello All

Problem sorted now - couldn't find ftab~ anywhere and when I did I couldn't move, copy or delete anything (wrong permissions) However, I got hold of a knoppix cd and (after a few boots, eventually in failsafe mode) I was able to unmount the original filesystem with fstab on it, then remount in read/write and correct the error.

Just in case you are interested, the original fstab which caused the problem had three spurious characters right at the front (%$¬). Dont know how they got there, but they're gone now and everything boots fine!

Thanks for everyone's help.

Millyfish
 
Old 05-13-2004, 05:18 AM   #9
xanas3712
Member
 
Registered: Apr 2004
Distribution: Slackware/Mandrake/Debian (sarge)
Posts: 266

Rep: Reputation: 30
As soon as you can I recommend trying to find your way around the console as you'll probably end up there at some point again. That's one of the best things that I got used to when I switched from mandrake to slackware.. not to say I'm in anyway super at it but I can find my way around without x fairly well.
 
Old 05-13-2004, 05:31 AM   #10
MillyFish
LQ Newbie
 
Registered: Apr 2004
Location: UK - East Midlands
Distribution: RH9 - Shrike
Posts: 8

Original Poster
Rep: Reputation: 0
Sound advice xanas3712

I'll have a bash at it later - (Damn it, there goes another of those puns!)

Cheers

Millyfish
 
Old 05-13-2004, 06:07 AM   #11
xanas3712
Member
 
Registered: Apr 2004
Distribution: Slackware/Mandrake/Debian (sarge)
Posts: 266

Rep: Reputation: 30
heh.. at least you say that properly.. you don't know how many time I've heard "no pun intended" when pun was intended.. lol..
 
Old 05-13-2004, 07:37 AM   #12
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
the command for remounting a partition rw is,
mount -o remount,rw (mountpoint or device. doesn't matter)
like
mount -o remount,rw /dev/hda5
 
  


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
Need with messed up fstab. Tiyogi Linux - General 11 03-26-2008 12:57 AM
[mtent] line 7 in /etc/fstab is bad (CD Drives wont Mount) shof515 Linux - Hardware 1 11-24-2005 08:57 AM
RH9 - won't boot - messed up fstab amanu1 Linux - Newbie 1 05-06-2004 07:52 PM
fstab got messed up after adding cd burner drrnsk8ter4 Linux - Software 3 04-24-2004 05:49 PM
messed up my fstab file aditya Linux - Newbie 1 10-07-2002 12:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:22 PM.

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