Can't edit my fstab
I'm trying to edit my fstab to so my samba shares will auto mount. When I vi /etc/fstab , I get the following message:
E325: ATTENTION Found a swap file by the name "/etc/.fstab.swp" owned by: root dated: Thu Jan 30 13:28:02 2014 file name: /etc/fstab modified: YES user name: root host name: endor process ID: 4595 While opening file "/etc/fstab" dated: Thu Jan 30 13:33:12 2014 NEWER than swap file! (1) Another program may be editing the same file. If this is the case, be careful not to end up with two different instances of the same file when making changes. Quit, or continue with caution. (2) An edit session for this file crashed. If this is the case, use ":recover" or "vim -r /etc/fstab" to recover the changes (see ":help recovery"). If you did this already, delete the swap file "/etc/.fstab.swp" to avoid this message. "/etc/fstab" 16 lines, 599 characters Press ENTER or type command to continue I've tried the suggestions in the message. There is no swap file in the directory. If I continue and hit "i" to enter insert mode I get weird results. When I hit arrow up and down to navigate it starts typing a, b , c in the lines and I can't backspace to delete them. It seems like I am not really entering insert mode but something weird is happening. Any thoughts? |
seem weird to me too.
Well i have often had a file left open in vi, leaving the console to the way it should be done, but there always was a file at the stated directroy and after deleting it, everything was fine. What would happen if you just open an new file with vi ? Maybe the harddisk is full ? Curruption of the filesystem, some other hardware error? I do not like it, as this is not WinXXXX but reboot ? |
Quote:
|
I tried nano instead of vi and that worked.
|
There will be .swp file at that directory. You can verify with below command
ls -al /directory Since you edit with nano for your desired content You can simply delete vi swp file rm /directory/xxx.swp Now you can edit again that file with vi editor. |
Quote:
|
So, I was reading another tutorial for something all together different and it was mentioned by the author that debian based distros have a problem with vi and solution is to install:
apt-get install vim-nox I haven't tried this yet but I will. |
Cool. Glad to hear that you are doing well. Good luck
|
All times are GMT -5. The time now is 10:18 PM. |