PDA

View Full Version : fstab.swp file



kjaada
02-02-2007, 10:47 AM
How do I delete an /etc/fstab.swp file

Graham L
02-02-2007, 10:53 AM
That will be a File System TABle file (see, *nix file names are meaningful). I'm not sure why the system would want a swap file for that, but I'd suggest caution.

How big is it? Is it causing a problem (error messages?) ? If it's not a problem,. I'd leave it alone. Unless you know what you're doing, playing around in the /etc directory can do a lot of damage.

It will be owned by root, and might be in use or have one of the subtle protection bits set as well. You might even need to start in single user mode to delete it.

kjaada
02-02-2007, 11:25 AM
It was caused by a crash when I was editing the Fstab file and now I can not enter the new line in fstab until I restore or delete the corrupt file.I will not proceed until I have a clear safe path.

Erayd
02-02-2007, 12:59 PM
Try just renaming the .swp file to something else, then edit fstab again. If it has issues, then put the file back.

What filesystem are you using (for /etc), and with what mount options? Most of the decent linux filesystems are journalling, so you should never end up with corrupted data.

Graham L
02-02-2007, 02:21 PM
It might be a workfile (vimdoc.sourceforge.net/htmldoc/recover.html)
from the editor. Some editors have a recovery mode, but if you have a good fstab file, you should be able to rename the ".swp" one and start the edit again. You'll probably have to su to root to dothe rename.

kjaada
02-02-2007, 06:06 PM
Thanks guys.The rename went a treat all is normal after editing.