LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-13-2011, 08:28 AM   #1
ragatinavin
LQ Newbie
 
Registered: Jul 2011
Posts: 14

Rep: Reputation: Disabled
Unable to restore /etc/fstab


HI Team,

I'm facing a problem in restoring my /etc/fstab file in the server i have a backup in /etc/fstab. bak but when i try to boot the server in emergency mode and give the command

cat /etc/fstab.bak > /etc/fstab
it says read only file.

I'm not able to restore it i tired even remounting the filesystem using the command

mount -o remount,rw /

It says /etc/fstab not found..


can any 1 help me out with this.???

thanks in advance!!!!!!!
 
Old 10-13-2011, 08:52 AM   #2
phaemon
Member
 
Registered: Jul 2011
Posts: 40

Rep: Reputation: 5
Hi there,

Could you try:
Code:
mount -n -o remount,rw /
Or you might need:
Code:
mount -n -o remount -t ext2 /dev/sda1 /
..or whatever instead of sda1.

The important thing being the "-n" option.

Last edited by phaemon; 10-13-2011 at 08:53 AM. Reason: Added the "important" bit!
 
Old 10-13-2011, 08:58 AM   #3
ragatinavin
LQ Newbie
 
Registered: Jul 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
hi...i tried the command suggested by you but there is no success

the following message is getting displayed

waring cannot open file no file or directory
 
Old 10-13-2011, 08:58 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

If (re)mounting doesn't work for you: Boot from a liveCD and fix the problem that way.

- boot from liveCD
- mount partition that holds /etc/fstab.bak
- copy /etc/fstab.bak to /etc/fstab
- reboot (do eject the liveCD ).

Hope this helps.
 
Old 10-13-2011, 09:08 AM   #5
phaemon
Member
 
Registered: Jul 2011
Posts: 40

Rep: Reputation: 5
If you have a livecd, then I'd go with that option. Just remember that it's the "etc/fstab" on the mounted drive you'll be replacing, not /etc/fstab (which will be the one on the livecd itself).

If not, repost and we'll try something else. The second command I gave you shouldn't have looked for an fstab so I'm not sure why it didn't work. Are the partition names correct?
 
Old 10-13-2011, 09:51 AM   #6
ragatinavin
LQ Newbie
 
Registered: Jul 2011
Posts: 14

Original Poster
Rep: Reputation: Disabled
thanks!!!

Hi mate the second command has worked successfully...thanks
 
Old 10-13-2011, 02:21 PM   #7
madams
LQ Newbie
 
Registered: Jan 2006
Posts: 1

Rep: Reputation: 0
fstab

We have had to use the liveCD method before in situations like this and it's worked perfectly. Quite a lifesaver.
 
  


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
unable to restore grub chessonly Debian 1 07-08-2011 08:40 PM
unable to restore sql_ascii in postgresql high_density Linux - Server 1 05-02-2011 04:08 AM
how can I restore /etc/fstab biruhh Linux - Newbie 5 10-06-2006 12:51 PM
how can I restore /etc/fstab biruhh Linux - Desktop 2 10-06-2006 09:30 AM
unable to restore lilo even using Knoppix thas Mandriva 4 04-05-2004 07:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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