Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 {
  rotate 1

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
  rotate 1

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!

share|improve this question
You may be running out of inodes. Check df -h and df -hi. – David Schwartz Jan 16 '13 at 10:44
@DavidSchwartz I ran the command as you suggested and added the output in question. Please check and suggest. – Swati Aggarwal Jan 16 '13 at 10:59
Well, you're not running out of inodes. – David Schwartz Jan 16 '13 at 11:30
@DavidSchwartz What can be the issue then? – Swati Aggarwal Jan 16 '13 at 11:39
So what is the output from df -h? – Michael Hampton Jan 16 '13 at 14:46
up vote 1 down vote accepted

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.

share|improve this answer
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. – Swati Aggarwal Jan 18 '13 at 7:14

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?

share|improve this answer

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
share|improve this answer

Your Answer


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.