I am SSHing into an Ubuntu machine where I use Bash as the shell. I used to be able to edit my ~/.vimrc file very easily. Now, whenever I try to write to it, I get a warning

E297 write error in swap file

and also after typing in text, I cannot save the changes. Vim tells me that

E667: Fsync failed. 

In order to exit the file, I simply have to type the :q! (force quit command).

This also happens to my ~/.bashrc file, and any other ~/.file that I access. However, I can successfully edit files in any directory outside of /usr2/.

This is an NFS file system and ls -ld ~ outputs that I have rwx permissions on that directory, and that I am the owner of it:

drwxrwxrwx 9 my_name users ... /usr2/my_name

It is odd because I am the owner of the file and have reading and writing permissions:

ls -l ~/.vimrc
-rwxr----- 1 my_name users 172 Aug 18 14:18 /usr2/my_name/.vimrc

I also have only used 54% of my allotted disk space by my system admin, so it cannot be a disk space issue. I also cannot find any .vimrc.swp files.

  • Are there perhaps permission problems with other directories? For instance, does ls -ld ~ show you correct permissions to your home directory itself?
    – filbranden
    Commented Aug 22, 2020 at 17:02
  • (Not the source of your problem, but note that I'd expect your .vimrc file shouldn't have the "execute" bit set... But that's just a minor hygiene issue, probably not really the source of the issue you're having.)
    – filbranden
    Commented Aug 22, 2020 at 17:04
  • See also :swapname which will tell you the name (and location) of the swap file for the file you're editing. What does :set directory? tell you? (That configures where swap files are supposed to be stored...)
    – filbranden
    Commented Aug 22, 2020 at 17:08
  • Hello @filbranden, I have rwx permissions on /usr2/my_name directory, as shown by the ls -ld ~ command. Running :swapname shows me that there actually is indeed a swap file in /usr2/my_name/.vimrc.swp. Runnnig :set directory? shows directory=.,~/tmp,/var/tmp,/tmp. Should I delete the swap file? Commented Aug 22, 2020 at 17:56
  • I'm wondering if this /usr2 directory is a weird filesystem... You can see that with df -Th ~ which will tell you the filesystem type. Please edit the question to add more information, it's hard to follow information from comments... (Also include the aforementioned ls -ld ~ output shen you edit the question...)
    – filbranden
    Commented Aug 22, 2020 at 18:00

1 Answer 1


It turns out that I had installed a version control tool called "repo" on the home directory of the company computer (/usr2/user_name) that had a very small disk partition allocated to it by the system admin. It took up 5GB of space. I removed it and already had it installed in a different directory.

After the removal and freeing up of disk space, I was able to edit my ~/.vimrc and ~/.bashrc files that are in the home directory.

It also turns out that my company has a special tool for checking users disk quota, and running df command was not accurate enough (I had not used 54% of quota, I had used 100%). Pretty much, just make sure to have enough disk space available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.