- parted /dev/vdb
- (parted) mktable gpt //指定分区模式为gpt
- (parted) mkpart primary ext4 0 3GiB
- 警告: The resulting partition is not properly aligned for best performance.
- 忽略/Ignore/放弃/Cancel? Ignore
- (parted) print
- ……
- Number Start End Size File system Name 标志
- 1 17.4kB 3221MB 3221MB primary
- (parted) quit
2)命令行查看分区信息
- [root@server0 /]# lsblk
- NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
- ……
- └─vdb1 252:17 0 3G 0 part ln -s
3)查看分区设备文件
- [root@server0 /]# ls /dev/vdb1
- /dev/vdb1
- vgcreate 卷组名 物理设备.. ..
- lvcreate -L 大小 -n 逻辑卷名 卷组名
2.3 步骤
实现此案例需要按照如下步骤进行。
步骤一:创建卷组
1)新建名为systemvg的卷组
- [root@server0 ~]# vgcreate systemvg /dev/vdb1
- Physical volume "/dev/vdb1" successfully created
- Volume group "systemvg" successfully created
2)确认结果
- [root@server0 ~]# vgscan
- Reading all physical volumes. This may take a while...
- Found volume group "systemvg" using metadata type lvm2
步骤二:创建逻辑卷
1)新建名为vo的逻辑卷
- [root@server0 ~]# lvcreate -L 180MiB -n vo systemvg
- Logical volume "vo" created
2)确认结果
- [root@server0 ~]# lvscan
- ACTIVE '/dev/systemvg/vo' [180.00 MiB] inherit
步骤三:格式化及挂载使用
1)格式化逻辑卷/dev/systemvg/vo
- [root@server0 ~]# mkfs.ext4 /dev/systemvg/vo
- .. ..
- Allocating group tables: done
- Writing inode tables: done
- Creating journal (4096 blocks): done
- Writing superblocks and filesystem accounting information: done
2)挂载逻辑卷/dev/systemvg/vo
- [root@server0 ~]# mkdir /vo //创建挂载点
- [root@server0 ~]# mount /dev/systemvg/vo /vo //挂载
- [root@server0 ~]# df -hT /vo/ //检查结果
- Filesystem Type Size Used Avail Use% Mounted on
- /dev/mapper/systemvg-vo ext4 171M 1.6M 157M 1% /vo
pvcreate /dev/sdc1
vgextend /dev/sdc1
lvextend -l +100%FREE /dev/mapper/centos-home
xfs_growfs /dev/mapper/centos-home 针对xfs
resize2fs /dev/mapper/data-yida 针对 ext2 ext3 etxt4
标签:parted,步骤,systemvg,server0,dev,vo,磁盘分区,root From: https://www.cnblogs.com/Lqdream/p/16918055.html