首页 > 代码库 > 挂载xfs分区

挂载xfs分区

(1)安装需要的包
yum --disablerepo=* --enablerepo=c6-media install xfs* -y

(2)格式化并挂载
fdisk /dev/sdb
n p 1 回车 +200M w
mkfs.xfs -f -i attr=2 -l lazy-count=1,sectsize=4096 -b size=4096 -d sectsize=4096 -L data /dev/sdb1
mkdir /data1
mount -o rw,noatime,nodiratime,noikeep,nobarrier,allocsize=100M,attr2,largeio,inode64,swalloc /dev/sdb1 /data1

(3)重启生效设置
# df -h
/dev/sdb1 199M 11M 188M 6% /data1
# mount
/dev/sdb1 on /data1 type xfs (rw,noatime,nodiratime,noikeep,nobarrier,allocsize=100M,attr2,largeio,inode64,swalloc)
# vim /etc/fstab
/dev/sdb1 /data1 xfs defaults 0 0

然后reboot,发现已经没有那些我们自己加的参数了
# df -h
/dev/sdb1 199M 11M 188M 6% /data1
# mount
/dev/sdb1 on /data1 type xfs (rw)

修改fstab文件,把default变成
# cat /etc/fstab
/dev/sdb1 /data1 xfs rw,noatime,nodiratime,noikeep,nobarrier,allocsize=100M,attr2,largeio,inode64,swalloc 0 0


再次reboot系统
# df -h
/dev/sdb1 199M 11M 188M 6% /data1
# mount
/dev/sdb1 on /data1 type xfs (rw,noatime,nodiratime,noikeep,nobarrier,allocsize=100M,attr2,largeio,inode64,swalloc)

 

挂载xfs分区