LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-30-2014, 04:29 PM   #1
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Rep: Reputation: Disabled
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?
 
Old 01-30-2014, 04:35 PM   #2
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 614

Rep: Reputation: 32
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 ?
 
Old 01-30-2014, 04:44 PM   #3
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by saavik View Post
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 ?
I tried rebooting a couple of times. I just tried to vi my netconfig file and it is behaving the same way. So I guess it's some larger vi issue or corruption
 
Old 01-30-2014, 05:32 PM   #4
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
I tried nano instead of vi and that worked.
 
Old 01-30-2014, 07:21 PM   #5
myatthu
Member
 
Registered: Jan 2014
Distribution: CentOS, Fedora, Ubuntu
Posts: 108

Rep: Reputation: 18
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.
 
Old 01-30-2014, 10:18 PM   #6
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by myatthu View Post
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.
Thanks
 
Old 02-10-2014, 12:49 PM   #7
Ryanms3030
Member
 
Registered: Jan 2014
Distribution: Debian, Mint, CentOS, Ubuntu
Posts: 261

Original Poster
Rep: Reputation: Disabled
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.
 
Old 02-13-2014, 09:43 AM   #8
myatthu
Member
 
Registered: Jan 2014
Distribution: CentOS, Fedora, Ubuntu
Posts: 108

Rep: Reputation: 18
Cool. Glad to hear that you are doing well. Good luck
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
not able to edit the /etc/fstab ramesh mohite Linux - General 3 12-06-2007 02:29 PM
Can't edit fstab?? hulk321 Linux - Software 12 07-04-2007 01:42 PM
How to edit Fstab Robert Diggs Linux - Newbie 2 12-22-2006 09:47 AM
fstab edit craigers Linux - Software 15 12-03-2004 06:02 AM
edit fstab LinuxOG Linux - Distributions 2 09-01-2003 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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