Question:
Linux hard disk hda3 full, cannot compile anymore?
achatte_88
2007-07-20 09:34:46 UTC
I am compiling and running my code on a linux cluster (currently using only one node).
Recently when compiling my fortran code i got this error message,
f771: No space left on device: error writing to /tmp/cczhAO6G.s

I did a df -k command to see the disk usage and found one of the disks is 100% used up /dev/hda3.
Last time this happened someone helped me to remove a large file from this disk. I cannot recall the name of the file.
Would appreciate any help in locating the file that needs to be deleted.
Thanks!
Four answers:
Dilbert's Desk
2007-07-20 09:46:54 UTC
Ok...Here's what you need to do...



1 - Using the df -k command you located the problem disk which is /dev/hda3. Good job.



2 - Now you need to find out what file system is mounted on that disk. So back to the df -k command and look to the far right of the /dev/hda3 and notice the mount point. From your comments, I would bet that it is somewhere in the /tmp directory.



3 - cd to that mount point and run this command

du -sk * | sort -n

this will help you locate any large files out there by finding out how much space each directory is taking up at that mount point. The largest will be at the bottom.



4 - Now cd to that directory taking up the most space and repeat step 3. look for log files and the like as they will be good candidates for removal.



In general, most anything in the /tmp directory should be considered volatile and can be deleted or truncated. But if you have a log file that is active...(execute ls -ltr and see if it has a current time stamp) then you may not want to delete it. You may want to truncate it instead. This is easy using this command...



cat /dev/null > file



That will effectively wipe out the file but leave the i-node intact so that if something is actively writing to it, it will not break the file handle.



Good Luck andhope that helps. Email me and I will walk you through it if you need more assistance.
Vincent G
2007-07-23 04:17:02 UTC
The physical drive used by /tmp is usually shared by several other mount points. To see if your hda3 corresponds to your /tmp, go to /tmp and issue the command "df ."

(that is dk with a period) this is to request the stas on the mount point where you are at this time. If you see the same device /dev/hda3, that is your smoking gu.

If you run a "du -k -s ." command form there, you will see how much space /tmp is taking. If that value is equal to what you have with "df -k", this means /tmp is alon on the drive, and you problem is there, if not, you have other mount points on the same drive, and perhaps more of an investigation to do and find which partition is taking all the space. It can be /var, for instance.

Compilation of large program require scratch space, for temporary files, those can go to several places, and a routine clean up of the /tmp and/or /var partition should be implemented. After months of arguing, I managed to get the sysadmins to implement an automatic housekeeping script that took care of removing large old file from our corresponding disk at my former employer. Perhaps you should have a similar conversation with your sysadmins.
csanon
2007-07-20 09:42:38 UTC
Contact the cluster administrator. Really.
Fab A
2007-07-20 09:43:39 UTC
cd /

find . -size +100M -print



where 100M is the minum size of a file


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...