Get this book -> Problems on Array: For Interviews and Competitive Programming
In this article, we have explained the source of the error "E514: write error (file system full?)" which you may encounter while editing a file and have presented a fix for it.
Table of contents:
- Understanding the error
- Fix for E514: write error (file system full?)
Understanding the error
vi code.c or while saving the file with :wq
E514: write error (file system full?)
There are two possible reasons for the error that is:
- No space left in the segment your file is located.
- The file is located in a virtual filesystem.
Fix for E514: write error (file system full?)
The first check is to check if your file is located in a virtual or physical filesystem.
For example, if you are editing a file in /sys, it is not possible as the filesystem at /sys is a virtual filesystem and there is no usable memory available.
You can check the location at which the file is placed using the following command:
df -h location
df -h /sys
This will show that it is mounted on sysfs which is system filesystem and hence, cannot be used. If the filesystem is like "/dev/sda1", then it is a physical filesystem and you can edit the file.
If it is a virtual filesystem: There is no option.
If it is a physical filesystem: We need to free some space so that you can edit the file. Check which segments have free space using the following command:
It shows the percentage of memory that is in used. If a segment has 100% usage, you cannot edit the file.
- Fix 1: Ask other users to free space
If the system is shared among multiple users, each user will have its own user account on the system. Use the following command:
cd /home sudo du -sch *.
This will list the space used by different users on the system. Ask the users who are using maximum space to free memory.
- Fix 2: Clear cache
Use the following command to clear cache in your system:
cd /home/<username> sudo rm -rf .cache
This can clear several GBs depending on how frequently do you use the system.
- Fix 3: Delete files you do not need
Use this command to find the space occupied by different directories in the current working directory:
sudo du -sch *.
Identify the directory or file consuming maximum space and delete them.
Following this, you will be able to free some space and finally, edit your file by fixing this error.
With this article at OpenGenus, you must be able to fix the error E514: write error (file system full?).