XFS文件系统碎片整理
2008-11-24 12:43
1586 查看
网上有些帖子说XFS不用做碎片整理,其实是错误的。XFS用延迟写入等技术确实可以减少碎片的出现,但是如果服务器用了几年,并且文件操作比较频繁,还是会出现碎片的,应该整理。注意:在Debian中XFS相关命令在xfsprogs包中,而xfs_fsr命令是在xfsdump包中的。所以要用xfs_fsr整理碎片,记得安装xfsdump包。 其他Linux发行版本中,包含xfs相关命令的包也应该叫类似的名字,自己google一下。
xfsdump - Administrative utilities for the XFS filesystem
xfslibs-dev - XFS filesystem-specific static libraries and headers
xfsprogs - Utilities for managing the XFS filesystem
一、查看碎片
1、查看/dev/sdc1的碎片情况:
# xfs_db -c frag -r /dev/sdc1
actual 93133, ideal 8251, fragmentation factor 91.14%
这个应该整理一下碎片了 :)
2、查看/dev/sdb1的碎片情况:
# xfs_db -c frag -r /dev/sdb1
actual 905607, ideal 900507, fragmentation factor 0.56%
这个不用做碎片整理。
3、另一种命令形式:
# xfs_db -r /dev/sdd1
xfs_db> frag
actual 117578, ideal 116929, fragmentation factor 0.55%
4、也可以通过xfs_bmap命令了解某个文件的情况:
# xfs_bmap -v case19.dat
case19.dat:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL
0: [0..9551]: 592061576..592071127 1 (103696496..103706047) 9552
1: [9552..86039]: 599312816..599389303 1 (110947736..111024223) 76488
2: [86040..170399]: 599655400..599739759 1 (111290320..111374679) 84360
3: [170400..256799]: 599751632..599838031 1 (111386552..111472951) 86400
4: [256800..340079]: 1185490752..1185574031 2 (208760592..208843871) 83280
5: [340080..592703]: 1185577976..1185830599 2 (208847816..209100439) 252624
二、整理碎片
# xfs_fsr /dev/sdc1
三、他从xfs_fsr得到了好处:) (摘自http://www.linux.com/feature/141404 )
Wow! Thanks. That'l teach me to use a non-default tech without researching it.
Over the years, my MythTV box had gotten inexplicably slow with lots of disk access for many operations like starting playback of a recorded video. With the advice here, I measured 98.6% fragmentation. A few sample files I checked that were 1-6GB captured MPEG-2 videos were stored on over 30,000 extents!
After 2 nights of de-fragmenting, I'm down to 17% fragmented and startup time of playing a video is noticeably faster with less hard drive activity.
四、参考
http://www.linux.com/feature/141404
http://www.nekochan.net/wiki/index.php/XFS_defragmentation
http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/a_man/cat1/fsr_xfs.z
xfsdump - Administrative utilities for the XFS filesystem
xfslibs-dev - XFS filesystem-specific static libraries and headers
xfsprogs - Utilities for managing the XFS filesystem
一、查看碎片
1、查看/dev/sdc1的碎片情况:
# xfs_db -c frag -r /dev/sdc1
actual 93133, ideal 8251, fragmentation factor 91.14%
这个应该整理一下碎片了 :)
2、查看/dev/sdb1的碎片情况:
# xfs_db -c frag -r /dev/sdb1
actual 905607, ideal 900507, fragmentation factor 0.56%
这个不用做碎片整理。
3、另一种命令形式:
# xfs_db -r /dev/sdd1
xfs_db> frag
actual 117578, ideal 116929, fragmentation factor 0.55%
4、也可以通过xfs_bmap命令了解某个文件的情况:
# xfs_bmap -v case19.dat
case19.dat:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL
0: [0..9551]: 592061576..592071127 1 (103696496..103706047) 9552
1: [9552..86039]: 599312816..599389303 1 (110947736..111024223) 76488
2: [86040..170399]: 599655400..599739759 1 (111290320..111374679) 84360
3: [170400..256799]: 599751632..599838031 1 (111386552..111472951) 86400
4: [256800..340079]: 1185490752..1185574031 2 (208760592..208843871) 83280
5: [340080..592703]: 1185577976..1185830599 2 (208847816..209100439) 252624
二、整理碎片
# xfs_fsr /dev/sdc1
三、他从xfs_fsr得到了好处:) (摘自http://www.linux.com/feature/141404 )
Wow! Thanks. That'l teach me to use a non-default tech without researching it.
Over the years, my MythTV box had gotten inexplicably slow with lots of disk access for many operations like starting playback of a recorded video. With the advice here, I measured 98.6% fragmentation. A few sample files I checked that were 1-6GB captured MPEG-2 videos were stored on over 30,000 extents!
After 2 nights of de-fragmenting, I'm down to 17% fragmented and startup time of playing a video is noticeably faster with less hard drive activity.
四、参考
http://www.linux.com/feature/141404
http://www.nekochan.net/wiki/index.php/XFS_defragmentation
http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/a_man/cat1/fsr_xfs.z
相关文章推荐
- XFS文件系统碎片整理
- [转]详述系统预读文件(PREFETCH)技巧透彻了解磁盘的碎片整理
- xfs磁盘(文件)碎片查看和整理
- Ubuntu下如何创建XFS文件系统的LVM详解
- ext3, reiser, xfs, jfs文件系统(磁盘格式)的简单对比
- tpcc-mysql测试mysql5.6 (xfs文件系统)
- xfs文件系统修复方法
- Linux kernel 2.6.29下安装ext4、reiserfs、jfs、xfs文件系统
- Linux如何扩展XFS文件系统以完全使用额外空间
- xfs文件系统的安装与简介
- xfs_growfs 同步文件系统
- OK6410 tftp下载内核、文件系统以及nand flash地址相关整理、总结
- XFS文件系统数据恢复实战
- xfs文件系统的备份与恢复
- Oracle数据库案例整理-Oracle系统运行时故障-断电导致数据文件状态变为RECOVER
- Oracle数据库案例整理-Oracle系统运行时故障-alert.log日志文件大小超出限制
- XFS文件系统结构分析-XFS数据恢复篇
- [转]ext2, ext3, xfs, reiserfs 文件系统性能测试
- 磁盘inode不足,使用xfs文件系统
- xfs碎片整理