服务器用了几年,并且文件操作比较频繁,还是会出现碎片的,应该整理。注意:在Debian中XFS相关命令在xfsprogs包中,而xfs_fsr命令是在xfsdump包中的。所以要用xfs_fsr整理碎片,记得安装xfsdump包。
一、查看碎片
1、查看/dev/centos/home的碎片情况:
#这个应该整理一下碎片了
[root@st-dev4 ~]# xfs_db -c frag -r /dev/centos/home
actual 266367, ideal 108763, fragmentation factor 59.17%
Note, this number is largely meaningless.
Files on this filesystem average 2.45 extents per file
2、查看/dev/sdb1的碎片情况:
#这个不用做碎片整理。
xfs_db -c frag -r /dev/sdb1
actual 905607, ideal 900507, fragmentation factor 0.56%
二、整理碎片
[root@st-dev4 ~]# xfs_fsr -v /dev/centos/home
/home start inode=0
ino=312605443
No improvement will be made (skipping): ino=312605443
ino=312605491
No improvement will be made (skipping): ino=312605491
ino=312605453
No improvement will be made (skipping): ino=312605453
ino=312906354
No improvement will be made (skipping): ino=312906354
ino=313953957
No improvement will be made (skipping): ino=313953957
ino=805577833
ino=805577833: file modified defrag aborted
ino=807923574
ino=807923574: file modified defrag aborted
ino=1078594289
ino=1078594289: file busy
ino=1078594290
extents before:3 after:2 DONE ino=1078594290
ino=1095801468
extents before:2843 after:1 DONE ino=1095801468
ino=1095969493
extents before:2 after:1 DONE ino=1095969493
ino=1343427175
extents before:3 after:2 ino=1343427175
ino=1344700610
ino=1344700610 already fully defragmented.
ino=1345133285
extents before:666 after:1 DONE ino=1345133285
ino=1345887553
ino=1345887553 already fully defragmented.
ino=1610729587
extents before:3 after:1 DONE ino=1610729587
ino=1611023216
ino=1611023216 already fully defragmented.
您在 /var/spool/mail/root 中有邮件
[root@st-dev4 ~]#