Linux--No space left on device

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/rw

varrun                  368748        56    368692   1% /var/run

varlock                 368748         0    368748   0% /var/lock

udev                    368748       108    368640   1% /dev

tmpfs                   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/rw

varrun                 92187      38   92149    1% /var/run

varlock                92187       4   92183    1% /var/lock

udev                   92187    4404   87783    5% /dev

tmpfs                  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/rw

varrun                 92187      38   92149    1% /var/run

varlock                92187       4   92183    1% /var/lock

udev                   92187    4404   87783    5% /dev

tmpfs                  92187       1   92186    1% /dev/shm
时间: 2024-10-25 18:49:37

Linux--No space left on device的相关文章

linux no space left on device的解决办法(iNode满导致)

今天在腾讯云的服务器被攻击后,apache启动报错,查找原因发现是磁盘空间不够no space left on device, 诡异的是df命令磁盘占用仅55% 继续查找原因,发现是iNode已满,即没有索引空间 这就好办了,首先定位哪个目录占用iNode最多,命令如下: find */ ! -type l | cut -d / -f 1 | uniq -c 定位完成,清理目录,整个世界都清净了 linux no space left on device的解决办法(iNode满导致),布布扣,b

linux no space left on device的解决的方法(iNode满导致)

今天在腾讯云的server被攻击后,apache启动报错,查找原因发现是磁盘空间不够no space left on device, 诡异的是df命令磁盘占用仅55% 继续查找原因.发现是iNode已满.即没有索引空间 这就好办了,首先定位哪个文件夹占用iNode最多,命令例如以下: find */ ! -type l | cut -d / -f 1 | uniq -c 定位完毕.清理文件夹,整个世界都清净了

linux服务器报No space left on device错误的解决过程记录

起因 今天在本地提交了点代码,但到服务器上git pull的时候提示No space left on device,第一反应是猜想可能硬盘满了(很有可能是log导致的),不过想想又觉得不太可能,这台服务器上只部署了一个应用,查看项目占用空间也不大. 解决过程 1.作为一个linux菜鸟,第一时间百度查关于查看硬盘使用情况的命令 [[email protected] ~]# df -h文件系统 容量 已用 可用 已用% 挂载点/dev/hda1 20G   2.4G  18G 13%  /tmpf

linux 使用systemctl 启动服务报错: Error: No space left on device

By default, Linux only allocates 8192 watches for inotify, which is ridiculously low. And when it runs out, the error is also No space left on device, which may be confusing if you aren't explicitly looking for this issue. vi /etc/sysctl.conf  增加  fs

Linux出现cannot create temp file for here-document: No space left on device的问题解决

在终端输入:cd /ho 按tab键时,显示错误: bash: cannot create temp file for here-document: No space left on device 这是由于该磁盘的空间已经满了,这时候可以进行扩容,或者将该磁盘的部分目录迁移到别的磁盘. 以下为解决思路,查找最大的文件,然后将其干掉: 1.使用命令df -h 查看硬盘空间 2.命令top查看cpu及内存 3.使用命令du -h –max-depth=1 /var/log/* 查看/var/log路

Linux XFS: "no space left on device"

创建文件时,突然报错: [[email protected] ~]# touch /var/satellite/a touch: cannot touch '/var/satellite/a': No space left on device 但文件系统剩余空间充足: Filesystem                 Size  Used Avail Use% Mounted on /dev/mapper/rootvg-rootfs   14G  6.0G  8.1G  43% / devt

关于Inodes文件被占满(如何解决linux报No space left on device错误)

原因与解决方法一,磁盘inode被用光导致/data目录下无法创建文件 touch atouch: cannot touch `a': No space left on device磁盘只使用了61%df -hFilesystem Size Used Avail Use% Mounted on.../dev/sda5 817G 466G 310G 61% /data...inode被用光df -iFilesystem Inodes IUsed IFree IUse% Mounted on.../

No space left on device: Couldn't create accept lock

原因: (1) 确认是否是硬盘空间不足:结果发现不是空间的问题: (2) 网上查看了下,发现是ipc不足.可以使用ipcs -s(|grep apache的group) 处理: (1) 可以使用$ ipcrm -s <semid>清理指定 semaphore (2) 也可以使用下面命令,清理所有的semaphore, 注:替换nobody为apache对应的用户名 for semid in `ipcs -s | grep nobody | cut -f2 -d" "`; d

gzip: stdout: No space left on device问题的解决

一.问题描述 最近安装了ubuntu14.04,并在ubuntu14.04中编译了一次内核.这之后大部分情况下用sudo apt-get install 安装应用都会出现“gzip: stdout: No space left on device”的问题.现象和[1]类似. 我的ubuntu分区大小分别是 / 60G左右,swap 4G左右,/boot 400M左右.硬盘装有win7和ubuntu双系统. 二.问题解决 从问题的描述来看,就是我给/boot分区分的空间太少了,方法一是重新给boo

java.io.IOException: No space left on device 错误

今天碰到比较奇怪的问题: 7/05/14 19:20:24 INFO util.Utils: Fetching http://192.168.31.160:33039/jars/spark_study_java-0.0.1-SNAPSHOT-jar-with-dependencies.jar to /tmp/spark-446068a4-aaa4-4277-b009-908bf0d4ecac/executor-dcc3175b-7d19-4485-81e1-bf31a83a66b4/spark-