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 10-06-2006, 07:03 AM   #1
biruhh
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Rep: Reputation: 0
Question how can I restore /etc/fstab


Hi all,

I am somewhat of a newbie just introfucing Linux to colleagues. I am having a problem where Fedora core 4 was installed and running fine for some time; recently, some minor modifications were made to /etc/fstab, to automatically mount windows partition at boot time. A copy of /etc/fstab was also placed on /root/Desktop for practice (if you will?) and when the user could not mount a flash disk, the system was restarted.

At which time, /etc/fstab could not be found; X server would not start but was able to log in through CLI. The file in /etc has been renamed as fstab~ for some reason, which would explain why the system cannot find it. I tried to replace it with the copy which was placed on /root/Desktop but /etc is 'Read-only file system.' Have tried chmod to change permissions but it doesn't allow it; it seems the whole / partition was mounted as a Read-only file system, probably cuz /etc/fstab was not found. I also tried Linux rescue but it doesn't even find Linux partitions to mount to /mnt/sysimage. I mounted the partition with the / directory manually but all I can find inside is 'rhinstall-stage2.img'. Can anyone help???
 
Old 10-06-2006, 07:34 AM   #2
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
Sounds to me like you might want to reinstall! You mentioned that /etc/fstab was copied to /root/Desktop - does this mean that someone was regularly logging in as root? That would be bad!

I suggest installing Fedora 5 (or, if you don't mind waiting until next week, Fedora 6). Apart from anything else, this should include hal/ivman support so you can automatically mount flash disks.

As a side note, when a file is modified, a backup is saved automatically, with the name 'old_filename~'. This is almost certainly why you found the file /etc/fstab~. The creation of the backup won't interfere with the new version of the file. Are you totally sure that /etc/fstab was only copied to /root/Desktop and not moved accidentally?
 
Old 10-06-2006, 08:07 AM   #3
biruhh
LQ Newbie
 
Registered: Oct 2006
Posts: 3

Original Poster
Rep: Reputation: 0
That is also what I suspected, so you're probably right and yes the logging in as root all the time bothered me too.

Any idea why it mounts as Read-only, and more importantly, why root can't change the priviledge and write to /etc ???
 
Old 10-06-2006, 11:12 AM   #4
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
There a several possibilities as to why the partition might be mounted ro. I'm pretty confused about what's going on. One possibility is that the computer wasn't shut down properly, and the filesystem hasn't been fscked. You'd probably get a boot message about this though, and the system should run fsck on boot if any drives weren't properly unmounted.

If you have one available, you could try booting the computer with a live CD such as Knoppix and see if you have any luck fixing the file from that.
 
Old 10-06-2006, 11:22 AM   #5
EdR
LQ Newbie
 
Registered: Sep 2004
Distribution: RHEL AS3, AS4 / Vector
Posts: 22

Rep: Reputation: 15
Boot to a cd. make a temp directory and mount the root partition from your hard drive to it. cd into the directory and chroot it. cd into the etc dir and mv the fstab~ file to fstab. make sure the entries are correct. cd to / and type exit to exit the chroot. cd out of the mounted dir and unmount it and reboot/remove the live cd.
 
Old 10-06-2006, 12:51 PM   #6
Sepero
Member
 
Registered: Jul 2004
Location: Tampa, Florida, USA
Distribution: Ubuntu
Posts: 734
Blog Entries: 1

Rep: Reputation: 32
Enter `mount` to see what drives you have mounted.

To remount a drive as read+write, enter this:
mount -o remount,rw /dev/hda3 /etc

(assuming hda3 is the correct partition)
 
  


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
fstab problem: mount: can't find dvd in /etc/fstab or /etc/mtab Nikon01 Slackware 5 11-17-2006 06:15 AM
Restore chris2pher_28 Linux - Newbie 1 09-04-2005 10:37 PM
restore cd paul62 Slackware 11 03-17-2005 02:32 PM
newbie vs fstab. fstab wins :( blop Linux - Newbie 3 01-07-2005 05:54 AM
(version 5.1 chapter 08 fstab) vs (man fstab) rgiggs Linux From Scratch 2 06-03-2004 05:55 PM

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

All times are GMT -5. The time now is 10:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration