System

Defragment XFS File-system

EcusE 2006. 11. 28. 21:41

xfs 파일시스템 단편화 제거에 관한 질문과 답변내용입니다.
xfs파일시스템을 아주 좋아하는듯 보이는군요.. 저도 사용중이고 만족스럽네요.
------------------------------------------------------------------

출처 : http://bitubique.com/content/view/45/50/

I have been using XFS file-system for all my Linux box for quite some time now.
Why? Because I personally feels it a bit faster than either ext2, ext3, or ReiserFS.
On top of that, XFS have some fancy features such as live file-system defragmenting.
Let's cover how to do that.

First, make sure you have the xfsdump utilities install. For Ubuntu, simply issue this
command:

sudo apt-get install xfsdump
Then, optionally you can check how fragmented your file-system is by this command:

sudo xfs_db -r /dev/hda1
xfs_db> frag
actual 300086, ideal 299315, fragmentation factor 0.26%
xfs_db> quit
In my case, my root is /dev/hda1. You need to reply with the device node containing your file-system you want to check.

How to defragment? Simple. Just invoke this command:

sudo xfs_fsr -v /dev/hda1
/ start inode=0
ino=1278965
extents before:2 after:1 DONE ino=1278965
ino=2114947
extents before:2 after:1 DONE ino=2114947
ino=3912996
...
ino=254717564
extents before:2 after:1 DONE ino=254717564

That's it. See...you should really be using XFS

---------------------------------------------------------------------------

xfs_fsr man page.

http://www.penguin-soft.com/penguin/man/8/xfs_fsr.html