Since I use LVM, this was pretty painless. First I shrunk my ext3 partition, which took a couple hours:
# e2fsck -f -C 0 /dev/storage/main
# resize2fs -p /dev/storage/main 400G
# lvresize -L 400G storage/main
Then I created a new logical volume:
# lvcreate -l 100%FREE -n xfs storage
# mkfs.xfs /dev/storage/xfs
# mkdir /xfs
# mount /dev/storage/xfs /xfs
I copied all my files from the ext3 to the XFS volume, which took about 22½ hours:
# time cp -av /storage/* /xfs
Now that I had two filesystems equally populated with directory entries, I ran bonnie++ and got very similar benchmarks on both volumes, suggesting that the change didn't really affect raw speed much. Then I tried something that would have to traverse the directory tree, with pretty drastic results:
# time du -sh /storage/backup-lithium
90G /storage/backup-lithium
real 56m40.618s
# time du -sh /xfs/backup-lithium
86G /xfs/backup-lithium
real 12m0.409s
The time it took to determine the total size of that folder went from 56 minutes to 12 minutes. To be even more sure of that result, I ran it again, giving me the same numbers within just a few seconds difference. I also noticed that XFS seems a bit more efficient at allocating files, since I confirmed that the contents of the directories were the same.
All in all, I think I'm going to mount the XFS volume as /storage and let the change be pretty much transparent. I've already checked to make sure that there were no files on /storage that were modified during the move. I'm not going to wipe the ext3 volume quite yet, since I still have plenty of space in the XFS partition — I'll do that when I actually fill up the disk.
This is really a nice and informative, containing all information and also has a great impact on the new technology. Thanks for sharing it, A1 Pioneer
ReplyDelete