要使用 xfs 文件系统,先分区,后格式化
安装 xfs 套件
yum install xfsprogs
通过 fdisk 或 parted 进行分区
parted /dev/vdb (parted) print Error: /dev/vdb: unrecognised disk label Model: Virtio Block Device (virtblk) Disk /dev/vdb: 1563GB Sector size (logical/physical): 512B/512B Partition Table: unknown Disk Flags: parted /dev/vdb mklabel gpt mkpart primary xfs 0% 100% print quit
自动脚本 auto_parted.sh
parted /dev/vdb << EOF mklabel gpt mkpart primary xfs 0% 100% print quit EOF
格式化为 xfs
[root@localhost ~]# mkfs.xfs /dev/xvdb1
meta-data=/dev/xvdb1 isize=256 agcount=4, agsize=7864318 blks
= sectsz=512 attr=2, projid32bit=0
data = bsize=4096 blocks=31457270, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal log bsize=4096 blocks=15359, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
mkfs.xfs
自动生成 fstab
uuid=$(blkid -s UUID -o value /dev/sdb1) echo "UUID=$uuid /data xfs defaults 0 0" >> /etc/fstab
Leave a Reply