Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I modified the fstab file and while saving a file, I made the mistake of naming it fstg. Because of this mistake, my system is not able to boot. It just boots into a maintenance shell. I am unable to change the name of fstg back to fstab. I tried doing this with su but nothing changes. Any idea of how to correct this?

share|improve this question

migrated from stackoverflow.com Apr 29 '11 at 22:37

This question came from our site for professional and enthusiast programmers.

1  
1) Not programming related. 2) Please accept some questions. –  Byron Whitlock Apr 29 '11 at 22:16
    
fstag? Are you sure you didn't mean fstab? –  Greg Hewgill Apr 29 '11 at 22:16
    
oh sorry it is fstab. –  agent.smith Apr 29 '11 at 22:21
    
Question needs clarification. What exact error messages do you get when the system boots? How did you attempt to move the file back (what exact command)? What exact error did you get? By the way, you should not need to su when you are already in a root ("maintenance") shell. Also, the drive might be mounted read-only. –  Mike Apr 29 '11 at 22:26

3 Answers 3

The easiest way is to rename it from a liveCD because your system can't mount the root filesystem right now.

share|improve this answer
    
how do u go about in vm? I am running ubuntu in a virtual box. I shud have taken a snapshot –  agent.smith Apr 29 '11 at 22:27
1  
@agent, you can run a live cd in a VM. Just download it and mount it in the virtual cd rom drive. –  dsolimano Apr 29 '11 at 23:57

What you need to do is to mount the root filesystem read-write. The maintenance shell has it mounted read-only.

One way to do this is:

mount / -o remount,rw

Or maybe:

mount -n -o remount,rw /

After that you can rename the file back to its proper name.

Before rebooting you should run sync. Possibly you should remount / read-only again or the filesystem will need a fsck or journal replay on boot.

share|improve this answer

Are you sure that the file was named fstag? Or do you mean /etc/fstab? Also, it would help if you could state the distribution you are using.

Either way, try to use the distribution LiveCD or SystemRescueCd which is a Linux system rescue disk that enables you to perform administration tasks.

I hope this helps.

share|improve this answer
    
it is ubuntu maverik in sun vbox. It is /etc/fstab. –  agent.smith Apr 29 '11 at 22:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.