LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   compilation error, no free space, how to clean up? (https://www.linuxquestions.org/questions/linux-newbie-8/compilation-error-no-free-space-how-to-clean-up-947333/)

sumesh.pt 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:

Code:

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

If I do
Code:

df -h
I get

Code:

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?

Thanks

EricTRA 05-29-2012 02:50 AM

Hello,

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
Code:

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,

Eric

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: http://gcc.gnu.org/onlinedocs/gcc/En...Variables.html

sumesh.pt 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
Code:

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.

Thanks

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

sumesh.pt 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?
Code:

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

Thanks,

pan64 05-29-2012 03:24 AM

what is in /media?

sumesh.pt 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.

sumesh.pt 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)

sumesh.pt 05-29-2012 05:11 AM

This is what I get.
Code:

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.

sumesh.pt 05-29-2012 06:34 AM

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

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

Can you imagine what is happening?


All times are GMT -5. The time now is 06:45 PM.