Linux--no space left on device

Source: Internet
Author: User

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 this claimed "No space left on device", although partition is not NE Arly full. If you ever run to such trouble–most likely you had too many small or 0-sized files on your disk, and when you had Enough disk space, you are exhausted all available inodes. Below is the solution for this problem.

1. Check available disk space to ensure this still have some

$ dfFilesystem 1k-blocks used Available use% mounted on/dev/xvda 33030016 10407780 22622236 32%/tmpfs 368748 0 368748 0%/lib/init  /rwvarrun 368748 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             &NBSP ;    92187       3   92184    1%/lib/init/rwvarrun         &NBS P        92187      38   92149    1%/var/runvarlock                92187       4   92183    1%/var/lockudev       & nbsp           92187    4404   87783    5%/devtmpfs       &NB Sp          92187       1   92186    1%/dev/shm 
If you had iuse% at or near, then huge number of small files are 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 would list directories and number of files in them. Once a directory with unusually high number of files (or command just hangs over calculation for a long time), rep Eat the command for this directory to see where exactly the small files is.

$ 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-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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.