【Linux基础】大硬盘xfs格式化和挂载注意
时间:2015-09-10 03:09:59 作者:vaster 标签: Linux xfs 分类: Linux Linux基础
每个项目都会有专用和共用的日志服务器,通常日志服务器上的磁盘容量非常大,下面介绍一下关于大硬盘(>2T)的xfs挂载和格式化
1、 fdisk –l 查看
Disk /dev/sdb: 1934.2 GB, 1934295564288 bytes 255 heads, 63 sectors/track, 235164 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
2、 安装xfs包(一般服务器上没有需拷)
# rpm -ivh xfsprogs-2.9.4-4.el5.x86_64.rpm warning: xfsprogs-2.9.4-4.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e42d547b Preparing... ########################################### [100%] 1:xfsprogs ########################################### [100%] # rpm -ivh xfsprogs-devel-2.9.4-4.el5.x86_64.rpm warning: xfsprogs-devel-2.9.4-4.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e42d547b Preparing... ########################################### [100%] 1:xfsprogs-devel ########################################### [100%] # rpm -vih kernel-module-xfs-2.6.18-128.el5-0.4-4.slc5.x86_64.rpm warning: kernel-module-xfs-2.6.18-128.el5-0.4-4.slc5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1d1e034b Preparing... ########################################### [100%] 1:kernel-module-xfs-2.6.1########################################### [100%] # locate xfs.ko /lib/modules/2.6.18-128.el5/kernel/fs/freevxfs/freevxfs.ko /lib/modules/2.6.18-128.el5/kernel/fs/xfs/xfs.ko /lib/modules/2.6.18-128.el5_cyou_1.0/kernel/fs/freevxfs/freevxfs.ko /lib/modules/2.6.18-128.el5debug/kernel/fs/freevxfs/freevxfs.ko
3、 加载模块(公司的内核是被定制过的)
# mkdir /lib/modules/2.6.18-128.el5_cyou_1.0/kernel/fs/xfs # cp /lib/modules/2.6.18-128.el5/kernel/fs/xfs/xfs.ko /lib/modules/2.6.18-128.el5_cyou_1.0/kernel/fs/xfs # insmod /lib/modules/2.6.18-128.el5_cyou_1.0/kernel/fs/xfs/xfs.ko # lsmod |grep xfs xfs 508360 0
4、格式化操作
# mkfs.xfs /dev/sdb mkfs.xfs: /dev/sdb appears to contain an existing filesystem (xfs). mkfs.xfs: Use the -f option to force overwrite. # mkfs.xfs -f /dev/sdb (有时候需要加 –f 参数 强制格式化) meta-data=/dev/sdb isize=256 agcount=32, agsize=14757504 blks = sectsz=512 attr=0 data = bsize=4096 blocks=472240128, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 2 bsize=4096 log =internal log bsize=4096 blocks=32768, version=1 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0
5、再挂载成功了
# mount -t xfs /dev/sdb /data/ # mount /dev/sdb on /data type xfs (rw)