I have Ubuntu 12.04 which serves my web application (20 MB) on apache httpd. Here is my partitions table:

$ sudo parted -l

Disk /dev/sda: 500GB
Partition Table: gpt

Number|Start|End|Size|File System|Name|Flag
1|17.4K|20.0MB|20.0MB|fat16| |boot

A few days ago I upgrade it to 12.10. Then copied one folder (30 GB) to www folder. Suddenly the server hang and I got a Low Graphics Mode message. I removed the huge folder and restarted the computer but still got the same message and No Space Left on Device

$ sudo du -h /var --max-depth=1

4.0K  /var/tmp
235M  /var/www
444G  /var/log

So, the /var/log is huge.

I tried:

$ sudo apt-get autoclean;sudo apt-get autoremove
**Error! No space left on device**

I did delete the archives logs but nothing changes the largest file is /var/log/cups and when I list its files, I got:

-rw-r----- 1 root adm 758 DEC 30 07:37 access_log.1.gz
**-rw-r----- 1 root adm 444G JAN 5 08:09 error_log**
-rw-r----- 1 root adm 245 DEC 29 13:17 error_log.1.gz

I tried:

$ sudo service cups stop
sudo: unable to write to /var/lib/sudo/username/tty2: No space left on device

When I unplugged the computer then replugged it. it works fine and problem gone. The /var size is completely normal.

I'm afraid of facing it again. I think my main problem is because of the partitions. The /home and /root are together and not separated. Do I have to create a new partition for /home? Anyone has another idea how to avoid the disk from filling up again?

  • 3
    Your disk is full. What makes you believe it isn't? Boot into recovery and remove some files. After you get the system up, use du or ncdu to see what files are eating all your space. For servers I highly recommend monitoring applications for disk space to prevent system outage. – gertvdijk Jan 1 '13 at 17:43
  • Free monitoring software, xymon: xymon.sourceforge.net – user8290 Jan 1 '13 at 17:47
  • Is that a remote server? If you can still access it please post the results of df -h and du -s /* so that we can assist with finding the "lost" space. – guntbert Jan 1 '13 at 18:20
  • 1
    "Is there anyway to save me and my server without a format ?" Who gave you the idea that a full disc requires a format of a disc? – Rinzwind Jan 1 '13 at 20:40
  • 1
    Updated my Post – Shadin Jan 2 '13 at 15:43

As you noticed yourself, your log folder is huge. You probably want to delete some old logs. Old logs are being archived periodically. If you look into your log folder by

cd /var/log
ls -lh

you will see a lot of files ending in .gz. Those files are the archives logs. They have a number before that indicating how old the archive is. .1.gz is the newest. If you are sure you don't need the old logs any more, delete them:

sudo rm *.gz

Before you do so you might want to check why your logs are that huge. Take a look which log files and corresponding archives are huge. If you find some look into them. What are the log entries? Are some of them very frequent? What process/program/event is responsible? Can you safely lower the log level for that?


Look into the error_log. You should use tail for showing the last few lines and hope that it can process such a huge file. You could also delete that file to free up the space but we should find out why it is that big.

  • 2
    Additionally it would be a good idea to check if logrotate is properly configured (see /etc/logrotate.conf and files in etc/logrotate.d) – guntbert Jan 3 '13 at 20:58
  • Updated my answer ;-) – André Stannek Jan 5 '13 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.