Linux--No space left on device

來源:互聯網
上載者:User

標籤:des   style   http   io   os   ar   for   sp   div   

http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html
No space left on device – running out of Inodes

One of our development servers went down today. Problems started with deployment script that claimed that claimed “No space left on device”, although partition was not nearly full. If you ever run into such trouble – most likely you have too many small or 0-sized files on your disk, and while you have enough disk space, you have exhausted all available Inodes . Below is the solution for this problem.

 

1. check available disk space to ensure that you still have some

$ df Filesystem           1K-blocks      Used Available Use% Mounted on /dev/xvda             33030016  10407780  22622236  32% /tmpfs                   368748         0    368748   0% /lib/init/rwvarrun                  368748        56    368692   1% /var/runvarlock                 368748         0    368748   0% /var/lockudev                    368748       108    368640   1% /devtmpfs                   368748         0    368748   0% /dev/shm

2. check available Inodes

$ df -i Filesystem            Inodes   IUsed   IFree IUse% Mounted on /dev/xvda            2080768 2080768       0  100% /tmpfs                  92187       3   92184    1% /lib/init/rwvarrun                 92187      38   92149    1% /var/runvarlock                92187       4   92183    1% /var/lockudev                   92187    4404   87783    5% /devtmpfs                  92187       1   92186    1% /dev/shm
If you have IUse% at 100 or near, then huge number of small files is the reason for “No space left on device” errors.

3. find those little bastards

$ for i in /*; do echo $i; find $i |wc -l; done

This command will list directories and number of files in them. Once you see a directory with unusually high number of files (or command just hangs over calculation for a long time), repeat the command for that directory to see where exactly the small files are.

$ for i in /home/*; do echo $i; find $i |wc -l; done

4. once you found the suspect – just delete the files

$ sudo rm -rf /home/bad_user/directory_with_lots_of_empty_files

You’re done. Check the results with df -i command again. You should see something like this:

Filesystem            Inodes   IUsed   IFree IUse% Mounted on/dev/xvda            2080768  284431 1796337   14% /tmpfs                  92187       3   92184    1% /lib/init/rwvarrun                 92187      38   92149    1% /var/runvarlock                92187       4   92183    1% /var/lockudev                   92187    4404   87783    5% /devtmpfs                  92187       1   92186    1% /dev/shm

Linux--No space left on device

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.