8

Iam hosting a Ruby on Rails Application on a Linode with 96 GB storage. All the images of my application are stored on amazon and they are fetched from amazon. Thus my linode should have a minimum of 80 GB storage free.

But when the log files of the application exceed 200 Mb I get the error:

Errno::ENOSPC: No space left on device

and my website goes down.

I enabled log rotation for my application on daily basis with the following code in file /etc/logrotate.conf:

path/to/application/log/*.log {
  daily
  missingok
  rotate 1
  compress
  delaycompress
  notifempty
  copytruncate
}

But now I have started getting the same error twics a day so I changed my config settings on the basis of size as:

path/to/application/log/*.log {
  size 1M
  missingok
  rotate 1
  compress
  delaycompress
  notifempty
  copytruncate
}

I also moved the logrotate file from /etc/cron.daily to /etc/cron.hourly so that the logrotate cronjob runs each hour and rotate the log if it exceeds 1M. I restarted the apache.

But when I checked after an hour my files sizes were greater than 1M. Thus the logrotate cronjob didnt work after every hour. When I forcefully rotate the log using the command:

 sudo /usr/sbin/logrotate -f /etc/logrotate.conf

then the log files gets rotated and the files size decrease.

I am not able to figure out why this configuration doesnt work. Moreover when the space on linode is 80 GB how does it affect if log files exceeds 200 Mb. What is the way to allocate more space to log directory?

As suggested I ran df -ih to check if Iam running out of inodes. The follwoing output I get:

Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/xvda               2.2M    263K    2.0M   12% /
devtmpfs                174K    2.0K    172K    2% /dev
none                    174K       1    174K    1% /dev/shm
none                    174K      33    174K    1% /var/run
none                    174K       2    174K    1% /var/lock
none                    174K       1    174K    1% /lib/init/rw

Thus my inodes are almost free. Iam not running out of inodes.

The output of df -h is as:

Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda             9.5G  8.7G  325M  97% /
devtmpfs             1010M  112K 1010M   1% /dev
none                 1010M     0 1010M   0% /dev/shm
none                 1010M   52K 1010M   1% /var/run
none                 1010M     0 1010M   0% /var/lock
none                 1010M     0 1010M   0% /lib/init/rw

My disk space is really less. How should I proceed?

Please help.Many Thanks!

6
  • You may be running out of inodes. Check df -h and df -hi. Jan 16, 2013 at 10:44
  • @DavidSchwartz I ran the command as you suggested and added the output in question. Please check and suggest. Jan 16, 2013 at 10:59
  • 1
    Well, you're not running out of inodes. Jan 16, 2013 at 11:30
  • @DavidSchwartz What can be the issue then? Jan 16, 2013 at 11:39
  • So what is the output from df -h? Jan 16, 2013 at 14:46

4 Answers 4

2

It's true, you have very little space left.

Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda             9.5G  8.7G  325M  97% /

Only a few hundred megabytes, and your disk will be full again.

You said you expected to have much more disk space than this shows, so I would recommend you contact Linode to find out what's going on.

1
  • Yeah. I just checked out. My older release have taken all the space on disk. I have deleted them and got the issue fixed. Thanks for the help. Jan 18, 2013 at 7:14
4

I had a the same error message when trying to run an npm install.

npm ERR! nospc ENOSPC: no space left on device, open /{dir}/...

The fix for me was the following:

  • sudo rm -rf node_modules - Remove node_modules
  • df -hi - Check the available disk space
  • sudo apt-get update - Update packages
  • sudo apt-get autoremove - Use 'autoremove' to remove packages that are no longer needed
  • sudo apt-get -f install - Correct broken dependencies
2

my 2 cents here:

I found out that the output of lsof | grep -i deleted was having production.log from several ages ago. Which a restart of the service freed up all the space. I got the idea from: Disk full, du tells different. How to further investigate?

1
0

te eue ebeebehujbs s hd dpqb d diqbduqbdhedq qeqe qw eq euqwe qw je jqwiejqwelenfqlq oq8q dqwe 1 2e 12 w2 22 2 2 22j e 1 3jwuuqdqdhsidiphispidaspidhshdah'-9qjrgnerigiirjwnoir8gw kr gjrnkwegw;iienrnr rrids doeihwoeofne rogrojipfpirpirjrpwpwrpwerjpwrjpweroweoprjwepjopwejfindf d f f f ffff s ffw fow fdddd d d d d ddnqidnnonwifeowneroihweriowheriohewoirhwiehirhwoiehriower we r wer wer w er we r w er we r we r w er we r we r we rwer wer weorinoiwninwoqoqnwowqriroriowewiironinonwoninefoifoiiofosififishfdihfohosfsoidfhshoiohfoihsoihfdoishdoifhoisdfosdf sfi f fjdjfofjj sifiosf ioosd fojsdfjfi ohsfjosfojsojfdiofdioifofdfflnsfioioofiwroiw0rhfiowhuibjnoij3rihdjfkrewfheuidbjkrojw8uihdfbjkerio8uegtbhrgnjeiruehgyuhjenriuhygjker4jhubjkrj4yeghjeritgkr423urfhdjgeriueghfjertugjikerijufhjwijufhghhgfdghjhgfghgfghgfghgygygfgfgytfgvgtfcfcfcfrfcfcfrcfrfcftfcftftffcftfvftfgtgvtfvftfvftvgtvgtgvtfvftft6fgyhff wwhe9rhwoerowheirhiowheoirowehorhowherhiowerhhweoriiewhroiwehorw0ur0wqeihroqohehohqpeiohiohoffhsifioahdoihof8qr8qw8rhwhqfh[whr880wrowfhdfh98wy98whf97uwqhuothqhrwheroiqhwoirhqw8iorhoiqhoriqhworih9q8hdodosufodsf8rqyrh08hohfoh07742394237423u4y2034y032974073274023942307947293709470923794792370983-58-85-88252034-283-42042-4233534-5-345-45-5-2-4--2-34234234234235325-2-52-5-----56-06-86-304880683-4863-6-38068083-6836-3853084-2-84-234-50834-0-34-54-5834583-05-3845-3045-03485-0-83-45834-503-50-3-0384583-580-3058-08435-0-385-385-385-0385-03-58-345-34503-4504-5-34-5034-34805-3405-3-4-93495204972440124797012974071042709707017147-0-43-40702474924-4-2470840248-48-14-1471-4-184-34824-4709273094174-14730273048177324702347234-4--4--2-4-2-974-2443---8--8-28--884288---948942342oijeioewrwe9ru-ewru0wer0ew-r*

BUTTER CUP! qogruwhjhqyihkqejpqujepiqhpieqp9uenlowfblu9fihnlapjdihjbflihuvbdkjvnflemwifudvhbjndkewljrifdhvu bdfkewrljpfivhdukbfwelmjudbvkhf ekwu9fdvihbjsfmlekjrifuvhdibkjfnrwemlfouvgibhk ewlkmfji huihbdkflmeivhuibdnf kn BUTTER CUP!!!

Heading ##10101000010101001101101001010101001010101011010100010010101010010101010001010100010100101001010100101101010101011101010101000100101010101001011001010101

*NUKE!!!!!!!!!!!NUKE!!!!!!!!!!!NUKE!!!!!!!!!!!!!NUKE!!!!!!!!!!!NUKE!!!!!!!!!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .