**#命令行方式
#一键磁盘格式化为gpt格式
parted /dev/vdb mklabel gpt
#初始化磁盘分区
parted /dev/vdb mkpart primary 0% 100% (需要多大磁盘就选多大)**
格式化为xfs格式,-f 是强制使用未对齐4K的设置一般上面步骤已经对齐过不需要用f
mkfs.xfs -f /dev/vdb1
#下面为正常parted分区步骤
[root@linux ~]# parted /dev/sdb
GNU Parted 3.1
Using /dev/vdb
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) p
Model: Virtio Block Device (virtblk)
Disk /dev/sdb: 44.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 30.7TB 30.7TB primary
(parted) mkpart
Partition name? []? sdb2
File system type? [ext2]? ext4
Start? 30.7TB
End? 100%
(parted) quit
Information: You may need to update /etc/fstab.
[root@linux ~]# lsblk