先在zstack管理平台给机器扩容
-
root@10-80-80-25:~# fdisk /dev/vda
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition type
p primary (0 primary, 1 extended, 3 free)
l logical (numbered from 5)
Select (default p): p
记着这里的数字, 设为N
Partition number (3,4, default 3): N
输入一个很大的数字2000000,就会跳到后面
First sector (2048-145845141, default 2048): 2000000
这里两个回车用默认的
First sector (209715200-251658239, default 209715200):
Last sector, +sectors or +size{K,M,G,T,P} (20969472-104857599, default 104857599):
Created a new partition 1 of type 'Linux' and of size 40 GiB.
Command (m for help): t
这里是上面的N
Partition number (1,2,5, default 5): N
Partition type (type L to list all types): 8e
Changed type of partition 'Linux' to 'Linux LVM'.
p检查一下
w保存退出

1.png
2.
root@10-80-80-25:~# partprobe
这个N是上面的
root@10-80-80-25:~# pvcreate /dev/vdaN
Physical volume "/dev/vda1" successfully created

2.png
3.
lvdisplay |egrep "Name|Size" 这个返回的VG Name 设为X
注意这里的X和N
vgextend X /dev/vdaN

3.png
4.
lvdisplay 找到LV Name为root的 LV Path, 设为Y
注意这里的 Y
lvextend -L +20G Y

4.png
5.
检查一下lvdisplay

5.png
6.
注意这里的 Y
resize2fs Y

6.png
7.
完成, 这里从8G到48G是因为第4步连续执行了两次, 等于是加了40G

7.png
网友评论