When you get a message that a disk is full, first find out which filesystem is affected.

When a filesystem is full, you find out the hard way. For me, it always happens when I’m editing a file in vi. I try writing the file and I get the message:

Write failed, filesystem is full!

Or I’m just typing away, and suddenly I get placed in the colon prompt with the message:

No space left on device

These two messages may sound like the same thing, but they signify space problems in different parts of the filesystem.

When you get an error message (Write failed, filesystem is full!) trying to write a file, it means that the filesystem in which the file resides is out of space. For example, if you’re trying to write the file to /work/sysbook/ch01, it means that the filesystem /work or /work/sysbook is full.

When this happens, how can you save your work? Well, one way is to try to clear up some space on /work — for example, if you know you have a big PostScript file there that you don’t need any longer, you can delete it. Once you clear up some space, write the file immediately.

Another way to save your work is to write it to another filesystem. You’ll probably want to move it back once space frees up again, but at least you know that you haven’t lost an hour of editing. For example, if you know that the /home filesystem is separate from /work, you can just save the file under the /work filesystem. Again, assuming you use vi, you would type:

:w /home/ch01.save

When you get the No space left on device message while trying to edit the file itself, then it’s a more serious problem. Remember that vi keeps temporary files in /tmp. The message means that /tmp is out of space. Although you can probably write the file, beware that you probably don’t want to — your buffers in /tmp might be corrupted. You shouldn’t write the file until you clear up space in /tmp and restore your buffers.

Look in /tmp to see if there are any files there that belong to you. For example, I know that my mailer keeps mail folders in /tmp and that after a system crash they aren’t cleaned up — so if any of those files belong to me, I remove them and then try to get vi working again long enough to write my file and get the heck out of there. However, often you just have to wait for the system administrator to clear up space for you.

You can follow a similar strategy when working in programs other than vi. If you keep track of where you’re working and where your programs keep temporary files, then you have a better chance of saving work when your system runs low on disk space.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset