LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Unable to restore /etc/fstab (https://www.linuxquestions.org/questions/linux-server-73/unable-to-restore-etc-fstab-907955/)

ragatinavin 10-13-2011 08:28 AM

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!!!!!!!

phaemon 10-13-2011 08:52 AM

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.

ragatinavin 10-13-2011 08:58 AM

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

druuna 10-13-2011 08:58 AM

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.

phaemon 10-13-2011 09:08 AM

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?

ragatinavin 10-13-2011 09:51 AM

thanks!!!
 
Hi mate the second command has worked successfully...thanks

madams 10-13-2011 02:21 PM

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


All times are GMT -5. The time now is 09:55 PM.