No space left on device
2014-01-12 00:13
369 查看
#df
/dev/sdc1 20799540 19751436 0 100% /home/sluo
无论怎么删除文件,剩余空间都为0,并没有增加。
网上很多人遇到的是硬盘还有空间,但是也报错:No space left on device. 显然他们的问题是因为inode耗尽了。
Linux上创建文件需要对应的inode如果inode 耗尽也无法写入文件,inode可以通过df -i查看。通常由于<2K的小文件过多,而每个小文件又占用一个inode,这样就会出现硬盘空间还有,却无法继续写入。
A few hours ago my root partition filled up, I moved files away from it and df reports:
So there should be 9GB free, but avail reports 0 and Use is still at 100%.
I tested as root, e.g.
it works as expected; however as a normal user, I still get the error:
The root home directory where I conducted the positive test and my home directory are on the same partition.The fstab entry is:
yuan@lihacker-laptop:~/tools/arm-2009q3/bin$ arm-linux-gcc
ccache: failed to create /home/yuan/.ccache_4.2.2 (No space left on device)
第一步:
yuan@lihacker-laptop:~/tools/arm-2009q3/bin$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 15773312 14972440 0 100% /
tmpfs 254724 0 254724 0% /lib/init/rw
varrun 254724 124 254600 1% /var/run
varlock 254724 0 254724 0% /var/lock
udev 254724 152 254572 1% /dev
tmpfs 254724 1460 253264 1% /dev/shm
lrm 254724 2392 252332 1% /lib/modules/2.6.28-11-generic/volatile
/dev/sr0 32780 32780 0 100% /media/cdrom0
f_DRIVE 142327832 82981080 59346752 59% /mnt/shared
第二步:
yuan@lihacker-laptop:~/tools/arm-2009q3/bin$ sudo tune2fs -l /dev/sda1 | grep -i reserved
Reserved block count: 120186
Reserved GDT blocks: 978
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
第三步:
yuan@lihacker-laptop:~/tools/arm-2009q3/bin$ sudo tune2fs -m 3 /dev/sda1
[sudo] password for yuan:
tune2fs 1.41.4 (27-Jan-2009)
Setting reserved blocks percentage to 3% (120186 blocks)
第四步:
yuan@lihacker-laptop:~/tools/arm-2009q3/bin$ arm-linux-gcc hello.c
执行成功!
/dev/sdc1 20799540 19751436 0 100% /home/sluo
无论怎么删除文件,剩余空间都为0,并没有增加。
网上很多人遇到的是硬盘还有空间,但是也报错:No space left on device. 显然他们的问题是因为inode耗尽了。
Linux上创建文件需要对应的inode如果inode 耗尽也无法写入文件,inode可以通过df -i查看。通常由于<2K的小文件过多,而每个小文件又占用一个inode,这样就会出现硬盘空间还有,却无法继续写入。
A few hours ago my root partition filled up, I moved files away from it and df reports:
# df -h Filesystem Size Used Avail Use% Mounted on /dev/hda1 183G 174G 0 100% /
So there should be 9GB free, but avail reports 0 and Use is still at 100%.
I tested as root, e.g.
# echo test >a ; cat a test
it works as expected; however as a normal user, I still get the error:
$ echo test >a ; cat a bash: echo: write error: No space left on device
The root home directory where I conducted the positive test and my home directory are on the same partition.The fstab entry is:
/dev/hda1 / ext3 noatime,defaults,errors=remount-ro 0 1
例子:
yuan@lihacker-laptop:~/tools/arm-2009q3/bin$ arm-linux-gcc
ccache: failed to create /home/yuan/.ccache_4.2.2 (No space left on device)
第一步:
yuan@lihacker-laptop:~/tools/arm-2009q3/bin$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 15773312 14972440 0 100% /
tmpfs 254724 0 254724 0% /lib/init/rw
varrun 254724 124 254600 1% /var/run
varlock 254724 0 254724 0% /var/lock
udev 254724 152 254572 1% /dev
tmpfs 254724 1460 253264 1% /dev/shm
lrm 254724 2392 252332 1% /lib/modules/2.6.28-11-generic/volatile
/dev/sr0 32780 32780 0 100% /media/cdrom0
f_DRIVE 142327832 82981080 59346752 59% /mnt/shared
第二步:
yuan@lihacker-laptop:~/tools/arm-2009q3/bin$ sudo tune2fs -l /dev/sda1 | grep -i reserved
Reserved block count: 120186
Reserved GDT blocks: 978
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
第三步:
yuan@lihacker-laptop:~/tools/arm-2009q3/bin$ sudo tune2fs -m 3 /dev/sda1
[sudo] password for yuan:
tune2fs 1.41.4 (27-Jan-2009)
Setting reserved blocks percentage to 3% (120186 blocks)
第四步:
yuan@lihacker-laptop:~/tools/arm-2009q3/bin$ arm-linux-gcc hello.c
执行成功!
相关文章推荐
- No space left on device on xfs filesystem with 2.4T
- No space left on device
- 如何解决No space left on device问题?
- Write error: No space left on device-解决办法
- no space left on device
- Ubuntu - No space left on device Is it a lie or have I run out of inodes
- No space left on device
- TFS部署:create_block allocate space error. ret: -1, error: 28, error desc: No space left on device
- Ramdisk 上的 "No space left on device" 问题
- .[No space left on device]问题解决
- 磁盘空间满导致oracle不能正常使用:错误关键字ORA-09817 No space left on device
- no space left on device
- java.io.FileNotFoundException.csv (No space left on device)
- cannot create temp file for here-document: No space left on device
- 提示如下错误:No space left ondevice,通过 df -h 查看磁盘空间,发现没满,请问可能原因是什么?
- Linux:No space left on device
- Docker error : no space left on device
- Linux inode空间占满 “no space left on device”
- 运行cartographer提示inotify_add_watch no space left on device设备上没有空间
- BTRFS下的No space left on device