fdisk -l
#####操作分区
fdisk /dev/sda
p
n
p
3
enter
enter
t
3
8e
w
执行parted /dev/sda3
如果报以下错误,则执行一下partprobe
,将分区信息写入磁盘
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-wGqiXpnN-1594027356928)(/Users/rubpeng/Library/Application%20Support/typora-user-images/image-20190118123406514.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-SRf8VIzq-1594027356929)(/Users/rubpeng/Library/Application Support/typora-user-images/image-20181231024242764.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-04MmqmiU-1594027356930)(/Users/rubpeng/Library/Application Support/typora-user-images/image-20181231024401607.png)]
#####验证
fdisk -l
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-DBVyMWjS-1594027356930)(/Users/rubpeng/Library/Application Support/typora-user-images/image-20181231022014945.png)]
parted /dev/sda3
mklabel gpt
I
mkpart primary 0 100%
I
I
I
print
quit
#####使用命令查看该磁盘信息
fdisk -l /dev/sda3
pvcreate /dev/sda3
y
y
y
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-0WvHgwjJ-1594027356931)(/Users/rubpeng/Library/Application Support/typora-user-images/image-20181231023329655.png)]
vgdisplay
可以看到我们需要扩容的卷组名为centos[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-OGSS4PZu-1594027356931)(/Users/rubpeng/Library/Application Support/typora-user-images/image-20181231023517319.png)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-HILmAr0Y-1594027356932)(/Users/rubpeng/Library/Application Support/typora-user-images/image-20181231023626480.png)]
使用lvextend -l +100%FREE /dev/centos/root
将余空间全部扩容到l/dev/centos/root逻辑卷中
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-I8GQf8ll-1594027356932)(/Users/rubpeng/Library/Application Support/typora-user-images/image-20181231023739669.png)]
xfs_growfs /dev/centos/root
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-tbyiD0vy-1594027356933)(/Users/rubpeng/Library/Application Support/typora-user-images/image-20181231023831882.png)]
df -h
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-xuWmSTU8-1594027356934)(/Users/rubpeng/Library/Application Support/typora-user-images/image-20181231023929590.png)]
fdisk -l
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-TbtVtkLD-1594027356934)(/Users/rubpeng/Library/Application Support/typora-user-images/image-20181231024031548.png)]