Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a Linux server ( ubuntu 12.4 ) which serve my web application (20 MB) on apache httpd. 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 the Low Graphics Mode message (My screen card is Intel ). So I removed the huge folder and restarted the computer but still got the same message. when I searched here for solutions and tried some of them I got this message: No Space Left on Device then I typed: df -h, I surprised that the usage is %100 !! here is my partitions table:

Number|Start|End|Size|File System|Name Flags
1|17.4k|20.0MB|20.0MB|fat16|boot
2|20.0MB|489GB|489GB|ext4
3|489GB|500GB|10.6GB|linux-swap(v1)

I can't access the my files anymore!

Is there anyway to save me and my server without a format ?

EDIT

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

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

So, the log is huge!!

and when I try:

sudo apt-get autoclean
sudo apt-get autoremove

I got: Error! No space left on device

So, I don't know how to delete log files! I'm kinda stuck!

EDIT

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

if I tried:

sudo service cups stop

I got:

sudo: unable to write to /var/lib/sudo/username/tty2: No space left on device

So, what's next ?

NEW UPDATE

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

But I'm afraid of facing it again. I think my main problem is because of the partitions:

sudo parted -l


Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number|Start|End|Size|File System|Name|Flag
1|17.4K|20.0MB|20.0MB|fat16| |boot
2|20.0MB|489GB|489GB|ext4
3|489GB|500GB|10.6GB|linux-swap(v1)

as you see, 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 that issue again ?

LAST UPDATE

aaaand the problem is back :( I didn't do anything ! I don't know what caused it!

share|improve this question
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 –  Oxi Jan 2 '13 at 15:43
show 3 more comments

1 Answer

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?

EDIT

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.

share|improve this answer
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
    
Thanks! Updated My Post –  Oxi Jan 5 '13 at 7:22
    
Updated my answer ;-) –  André Stannek Jan 5 '13 at 14:36
    
Thanks a lot! something new happened! updated my post –  Oxi Jan 6 '13 at 6:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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