-   Linux - Newbie (
-   -   compilation error, no free space, how to clean up? ( 05-29-2012 02:38 AM

compilation error, no free space, how to clean up?
I am unable to compile my codes. When I try I get this error:


fatal error: error writing to /tmp/ccU2CdiZ.s: No space left on device
compilation terminated.

If I do

df -h
I get


Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6            188G  187G    0 100% /
none                  3.9G  288K  3.9G  1% /dev
none                  4.0G    0  4.0G  0% /dev/shm
none                  4.0G  80K  4.0G  1% /var/run
none                  4.0G    0  4.0G  0% /var/lock
none                  4.0G    0  4.0G  0% /lib/init/rw
/dev/sda1            184M  25M  151M  14% /boot
/dev/sda7            267G  222G  32G  88% /home

which means there is plenty of space in my /home directory.
Only place seems to be occupied is /dev/sda6. Should that be cleared?

My /tmp has nothing in it.

Can anyone help?


EricTRA 05-29-2012 02:50 AM


Your / directory is at 100% and that's why you're getting the error. Since /var/log is in there too, I'd start by looking there and do some cleaning up by removing old log files that might be taking up lots of space over time. Assuming you're using Ubuntu you might also remove all downloaded packages in /var/cache/apt by using

sudo apt-get clean
That for starters. Next look at whatever 'old' files you might have that can be deleted. There's nobody but you who knows what exactly you have on your system. Just 'compiling away' without cleaning up the house results in this.

Kind regards,


pan64 05-29-2012 02:50 AM

/ should be freed anyway, otherwise your system will die soon....
in the linux world there is a variable TMPDIR to define the dir to be used instead of /tmp.
see: 05-29-2012 03:04 AM

Thanks. Actually the system is screwed up by some other users and I am not in a position right now to find out what they have done exactly. I am trying to clean it up and avoid a fresh installation. But I do not know what are the files that can be safely deleted. I did a

sudo apt-get clean
, but did not make any difference.

EricTRA, you suggested deleting old files. Could you also suggest which directories I should look at to delete these files?

pan64, Thanks for your suggestion on TMPDIR. However I should free up my system anyway.


pan64 05-29-2012 03:08 AM

you can try du -sh * in any dir to find which subdir contains most of that 188 GB 05-29-2012 03:18 AM

I did a du -sh * to find out the biggest directory. Except /home and /media everything else looks alright. Could you have a look and suggest what am I missing?

7.8M        /bin
19M        /boot
4.0K        /cdrom
288K        /dev
17M        /etc
222G        /home
0        /initrd.img
150M        /lib
13M        /lib32
0        /lib64
16K        /lost+found
169G        /media
4.0K        /mnt
4.9G        /opt
du: cannot access `/proc/3395/task/3395/fd/4': No such file or directory
du: cannot access `/proc/3395/task/3395/fdinfo/4': No such file or directory
du: cannot access `/proc/3395/fd/4': No such file or directory
du: cannot access `/proc/3395/fdinfo/4': No such file or directory
du: cannot access `/proc/6956': No such file or directory
du: cannot access `/proc/7019': No such file or directory
du: cannot access `/proc/7020': No such file or directory
0        /proc
8.9G        /root
8.3M        /sbin
4.0K        /selinux
200K        /srv
0        /sys
20K        /tmp
3.5G        /usr
273M        /var
0        /vmlinuz


pan64 05-29-2012 03:24 AM

what is in /media? 05-29-2012 03:34 AM

It is an external hard drive connected. Could that be the issue?

pan64 05-29-2012 03:42 AM

no, an external drive cannot be the issue, just I'm not sure. In your original post you sent the result of df -h and there is no /media. 05-29-2012 03:47 AM

It was always connected. df -h shows the same output, i.e, without /media. What could be wrong?

pan64 05-29-2012 03:52 AM

so try: df -h /media/.

Babertje 05-29-2012 04:57 AM

Look like /media is not mounted to an external drive, it's just filling up your / (/dev/sda6) 05-29-2012 05:11 AM

This is what I get.

df -h /media/
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6            188G  187G    0 100%

How to go ahead now?

pan64 05-29-2012 05:13 AM

so yes, it is not an external drive. Here is an idea:
You may mount your drive to /media1 or whatever and move the important content from /media. 05-29-2012 06:34 AM

I deleted some 8 GB stuff from /media and now this is what it looks like

df -h /media/
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6            188G  180G    0 100% /

Can you imagine what is happening?

Arun_kumar_k 05-29-2012 01:04 PM


Try "updatedb" and then check df -h again.


Babertje 05-29-2012 05:07 PM

Check if the external drive is really mounted on /media/some_external_drive/ where "some_external_drive" is the real name of this external drive. You can check this with the command "mount" in a terminal. What you probably do is that you store your data meant to store externally ends up in /media and (thus stored local on /dev/sda6) and not in /media/some_external_drive/ outside your Linux-box

chrism01 05-29-2012 06:59 PM


cat /etc/mtab

suicidaleggroll 05-29-2012 07:23 PM

There is no external hard drive mounted on the system. Everything in /media is being stored on your main boot and OS partition, same as everything else in / (except /home/, which is on sda7). You should mount this external drive you want to be using for media, and move everything in /media onto it.

As for your above output of df, the discrepancy between total, used, and available space is probably due to root's reserved sectors, which by default is 5% of the drive (9.4GB in your case). The "available" space will always give you the result of total minus used minus reserved. Total is 188, used is 180, and reserved is 9.4, so there is zero space "available" for general use. You can reduce the amount of reserved space with tune2fs, but you really should be moving that media directory off of the main OS partition. 05-29-2012 10:29 PM

Resolved. It turns out that one of the user stored huge amounts of data in / and it has nothing to do with the external drive in /media. By removing this data everything works fine now

pan64 05-30-2012 01:51 AM


If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.
Happy with solution ... mark as SOLVED
(located in the "thread tools")

EricTRA 05-30-2012 01:52 AM


If you allow your users 'uncontrolled' use of your system you can always encounter problems like this. Either tell them how to use the system and what not to do or enforce quota on the home partition for example to allow one (or more) users to block everything by uploading large data. If you consider your problem solved then please mark the thread as such.

Kind regards,


All times are GMT -5. The time now is 10:54 PM.