Expanding a Cloud Server with Block Storage

1). After adding the Block Storage and assigning it to your VM in the Cloud Panel login to the server with SSH.

2). From here run fdisk -l to ensure the new drive shows (it should be sdb), if not reboot the server.

3). Run pvs to show your current volume group:

PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a– <159.00g 0

4). Using the volume group name from the previous step run: vgdisplay centos | grep “PE Size”

PE Size 4.00 MiB

5). Run the command: pvcreate /dev/sdb

6). In referencing step 4, Run the command: vgcreate -s 4 new /dev/sdb

7). Run the command: vgmerge centos new

After running this pvs should now show the merged volumes:

PV VG Fmt Attr PSize PFree
/dev/sda2 centos lvm2 a– <499.47g 0
/dev/sdb centos lvm2 a– <499.97g <499.97g

8). You can now use: lvextend -L and resize2fs (ext4) or xfs_growfs (xfs) to resize your partitions.


Marv has written 28 articles

One thought on “Expanding a Cloud Server with Block Storage

Cancel reply

Leave a Reply to Hair Styles

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>