Get the App
SLTechnology News&Howtos  ›  Servers  › 

Virtual machine hard disk space is not enough. Add a new hard disk LVM and expand it to the root directory online.

Shulou Source: shulou.com Published: 2022-06-03 04:52:24 09月21日 Update

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

Tags: Hard disk root directory space success not enough company parameters only name command uppercase capacity format path change online Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Apple MariaDB Redmi Microsoft