df 文件系统出现异常
[root@abc ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 4.0G 249M 3.5G 7% / /dev/sda1 1.1G 39M 1000M 4% /boot none 4.0G 0 4.0G 0% /dev/shm /dev/sda8 130G -64Z 134G 101% /home /dev/sda6 2.1G 28M 1.9G 2% /tmp /dev/sda5 4.0G 2.4G 1.4G 63% /usr /dev/sda7 2.1G 1.2G 740M 63% /var
排查步骤:
1、 du -sh 查看/home 分区下各个目录是否有容量过大的问题(没有发现过大,一共不到40G)
2、尝试重启进程,看是否有进程hold住文件句柄导致异常(挨个重启没有好转)
3、重启主机,担心位置程序hold住文件句柄(依旧没有好转)
4、先退出session,然后nemo登录,登陆后cd / ,然后su - root
4.1、接下来操作如下,
mount -o remonut /dev/sda8
4.2、尝试重新 mount ,但是提示busy,查看下/home中还有什么文件被程序打开
lsof -n /home
发现有squid/nemo下的进程,手动进去kill掉
lsof -n /home
发现没有输出
mount -o remount /dev/sda8
依旧提示文件系统繁忙
5、直接umount掉再mount
umount /dev/sda8 成功
mount -a 重新挂载
df -h
查看文件系统失败
6、umount 掉,使用fsck -y /dev/sda8(-y 表示提示yes/no时 选yes)
fsck -y /dev/sda8
文件系统检测结果,提示clean
7、提示:直接执行fsck -y /dev/sda8 此时可能innob并没有更新,df -h是由下级inno信息逐级上传最后组合起来的,此时分区inno更新操作即可
cd /home touch 123 rm 123 -rf
再次执行fsck.ext3 -y /dev/sda8
开始提示发现异常,需要修复默认选yes
8、ps x |grep fsck 看pid 然后使用 starce pid 看是否在修复
ps x |grep fsck starce pid
看到处理信息
read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32768) = 32768 _llseek(5, 65767129088, [65767129088], SEEK_SET) = 0 read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32768) = 32768 _llseek(5, 65767161856, [65767161856], SEEK_SET) = 0 read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32768) = 32768 _llseek(5, 65767194624, [65767194624], SEEK_SET) = 0 read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32768) = 32768 _llseek(5, 65767227392, [65767227392], SEEK_SET) = 0 read(5, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32768) = 32768
正在修复中
Free inodes count wrong for group #3 (32768, counted=32752). Fix? yes Free inodes count wrong (34884309, counted=34884293). Fix? yes
/home: ***** FILE SYSTEM WAS MODIFIED ***** /home: 177467/35061760 files (26.3% non-contiguous), 11610253/35037757 blocks
等待5分钟后,修复完成
9、再次使用fsck和df 检查
[root@abc home]# fsck -y /dev/sda8 [root@abc home]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda2 4.0G 249M 3.5G 7% / /dev/sda1 1.1G 39M 1000M 4% /boot none 4.0G 0 4.0G 0% /dev/shm /dev/sda6 2.1G 32M 1.9G 2% /tmp /dev/sda5 4.0G 2.4G 1.4G 63% /usr /dev/sda7 2.1G 492M 1.5G 26% /var /dev/sda8 130G 41G 83G 33% /home [root@abc home]# fsck -y /dev/sda8 fsck 1.35 (28-Feb-2004) e2fsck 1.35 (28-Feb-2004) /dev/sda8 is mounted. WARNING!!! Running e2fsck on a mounted filesystem may cause SEVERE filesystem damage. Do you really want to continue (y/n)? yes /home: clean, 177467/35061760 files, 11610253/35037757 blocks
完成修复,GOOD