linux如何初始化硬盘,Linux硬盘简易初始化(LVM)

Step 1:

用parted对磁盘进行分区:

[[email protected] ~]# parted /dev/sdb

进行分区,开启LVM:

(parted) mklabel gpt

(parted) mkpart primary xfs 0% 100%

(parted) set 1 lvm on

(parted)

扫描一次,让分区立即生效:

Step 2:

将添加磁盘进行LVM划分:

[[email protected] ~]# pvcreate /dev/sdb1

Physical volume "/dev/sdb1" successfully created.

[[email protected] ~]# vgcreate yunvg /dev/sdb1

Volume group "yunvg" successfully created

[[email protected] ~]# vgdisplay

[[email protected] ~]# lvcreate -L 999.99GB -n YunDisk yunvg

Rounding up size to full physical extent 999.99 GiB

Logical volume "YunDisk" created.

[[email protected] Exdisk]# lvcreate -l 100%FREE -n exdisk1 exdisk

Step 3:

格式化磁盘,用XFS格式:

[[email protected] ~]# mkfs.xfs /dev/

你可能感兴趣的:(linux如何初始化硬盘)