Virtual machine hard disk space is not enough. Add a new hard disk LVM and expand it to the root directory online.
The company has a virtual machine, the hard disk is only 100G, slowly using space is not enough, so it is necessary to add a new hard disk, fortunately, the virtual machine is more convenient to add a hard disk, remember one operation
Newly added hard disk
View the volume names of PVS and VG
Directly expand the newly added hard disk to the volume group
If there is no error, the increase should be successful.
Then
Lvextend-L + 140g / dev/ubuntuzm3-vg/root
Add 140g of capacity to the root directory. / dev/ubuntuzm3-vg/root is the path of the root directory, and the parameter-L is capitalized.
After the command succeeds, the space does not change and resize2fs / dev/mapper/ubuntuzm3--vg-root needs to be executed again.
The format of the root partition is EXT4, so use resize2fs