我无法更新Ubuntu,因为我的inode使用率达到99%。有什么最简单的方法可以解决这个问题吗?
谢谢您的帮助。
谢谢您的帮助。
#!/bin/bash
# count_em - count files in all subdirectories under current directory.
echo 'echo $(ls -a "$1" | wc -l) $1' >/tmp/count_em_$$
chmod 700 /tmp/count_em_$$
find . -mount -type d -print0 | xargs -0 -n1 /tmp/count_em_$$ | sort -n
rm -f /tmp/count_em_$$
chmod +x ~/bin/count_em
count_em
sudo du -a -d 1 --inodes . | sort -nr | head -20
。 - Charles Greendu --inodes -d 3 / | sort -n | tail
从那里,你可以确定要删除的目录。--inodes
选项则是在2013年7月才被添加进去的,哈哈。 - ZN13df --inodes
而不是 du --inodes
。 - Rick James-i bytes-per-inode
Specify the bytes/inode ratio. mke2fs creates an inode for every bytes-per-inode
bytes of space on the disk. The larger the bytes-per-inode ratio, the fewer inodes
will be created. This value generally shouldn't be smaller than the blocksize of
the file system, since in that case more inodes would be made than can ever be
used. Be warned that it is not possible to change this ratio on a file system
after it is created, so be careful deciding the correct value for this parameter.
Note that resizing a file system changes the number of inodes to maintain this
ratio.
-N number-of-inodes
Overrides the default calculation of the number of inodes that should be reserved
for the file system (which is based on the number of blocks and the bytes-per-inode
ratio). This allows the user to specify the number of desired inodes directly.
使用默认的inode数(每个inode大小为16384字节),格式化设备时,使用以下普通命令:(对于1TB磁盘,这将创建大约6000万个inodes)
sudo mke2fs -t ext4 /dev/sda1
要创建比以前多一倍的i节点分区,请使用以下命令:(请注意,字节/ i节点的值必须减半 - 对于一个1 TB的磁盘,这将创建大约1.2亿个i节点)
sudo mke2fs -i 8192 -t ext4 /dev/sda1
最后,要手动设置特定数量的i节点,请使用以下命令:(创建具有2亿个i节点的文件系统)
sudo mke2fs -N 200000000 -t ext4 /dev/sda1