Hi everyone,
I find myself having to administer a linux web proxy server, and I have hardly any knowledge of linux whatsoever. So far google has given me a huge helping hand, but I've come across a little problem I cannot get round, so I desperately need your help now.

When I try to modify a file with vi editor, I get the following errors
E297 Write error in swapfile
E303 Unable to open swapfile for "resolv.conf" (which is the file i'm trying to modify)

After googling the topic I realised that it might be a full disk issue, which would be quite likely analysing the circumsntances, but I was completely unable to check the free/used space in my disk.
df command only displays the headings to the columns, but nothing below. Nor do df -h or df -k.
df -a returns the following output:
Filesystem / 1K-blocks / Used / Available / Use% / Mounted on
proc / 0 / 0 / 0 / - / /proc

Distro is Slackware 9.1.0

How can I check the free space without the df command? Or how can I make df work?
Couldn't find anything on the topic.

Sorry if the thread is in the wrong category - appreciate if you move it to the right one. Just couldn't find a more suitable one.

Any help will be greatly appreciated !!!!

Thanks in advance


Can you list directories with ls -l or du? These will show space used. If you can find a large file you do not need, you can free up space. Most file systems will have space reserved for "root". If you have used that up you may have to boot with SystemRescueCD and delete files from there.

It can happen that you run out of space as you are trying to add stuff to a PC. There is almost certainly a solution. The rm command will remove files you do not need. You may also be able to clear out the /tmp directory. Boot to "single" and clear it out. cd /tmp;rm -fr [a-z]* will remove all files and directories in /tmp starting with "a" to "z".

Look for old .iso or useless backups and .tar or .tgz files in /root or your /home/user directory. Delete unneeded accounts and their /home directories. Empty caches that may be stale. Some packaging systems keep the downloads. Empty them. In apt, apt-get clean does it. I have not used RPM for years but there is probably a similar option. You may also be able to delete old /var/log/files.

With updates there may be some old kernels hanging around. If you find one you know you do not need, uninstall it.

Thanks a lot for your help !!
The server runs a daily backup and stores it in the disk, and the disk was full indeed. I removed a few thousands of tar backups and I got rid of the error to open files with vi.
The tip on how to use the rm command was really helpful!
Only after rebooting did df start to work again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.