XFS文件系统简介:xfs 是sgi开发的IRIX系统上的高性能日志文件系统,后将其移植到linux并以GPL协议开源。


Linux环境: CentOS 5 缺省kernel不支持xfs.

1 .使用yum 升级kernel和xfs module .
编辑 /etc/yum.repos.d/CentOS-Base.repo
[centosplus]
enabled=1
2. 使用yum升级,安装相关rpm
yum update kernel-2.6.18-8.1.15.el5.centos.plus xfsprogs kmod-xfs-0.4-1.2.6.18_8.1.15.el5.centos.plus

3. 使用新内核启动后,modprobe xfs
lsmod |grep xfs
xfs 481240 1
dmesg
如果有如下信息,说明xfs module成功加载
SGI XFS with ACLs, security attributes, realtime, large block numbers, no debug enabled
SGI XFS Quota Management subsystem

4. 格式化xfs文件系统 假设原系统中sda3为/opt

停止和/opt分区相关应用,备份
cp -a /opt/* /bakcup/opt
umount /opt

mkfs.xfs -f /dev/sda3
提示如下:
meta-data=/dev/sda3 isize=256 agcount=16, agsize=789067 blks
= sectsz=512 attr=0
data = bsize=4096 blocks=12625072, imaxpct=25
= sunit=0 swidth=0 blks, unwritten=1
naming =version 2 bsize=4096
log =internal log bsize=4096 blocks=6164, version=1
= sectsz=512 sunit=0 blks, lazy-count=0
realtime =none extsz=4096 blocks=0, rtextents=0

5. 修改/etc/fstab
#LABEL=/opt /opt ext3 defaults 1 2
/dev/sda3 /opt xfs defaults 1 1

6. 手工mount
mount –t xfs /dev/sda3 /opt
将备份文件恢复

7. reboot后。系统自动mount /opt 问xfs
使用mount 可查看。

8. xfs相关信息:
xfs 项目主页:http://oss.sgi.com/projects/xfs/
 

转载自:http://blog.sina.com.cn/s/blog_467eb8ca01008c1j.html