Home > OS >  The LVM disk capacity
The LVM disk capacity

Time:11-09

Linux server newly added a piece of hard disk, can be directly to the disk formatting mount can use, such as mount at/usr/local directory, but it has a drawback, that if the disk is full, the subsequent want capacity, cannot continue to mount the/usr/local mount point, cause some trouble to increase, so we suggest to use LVM, so that we can support dynamic flash disk, below is the detailed operation way,
1, increase the disk partition
Fdisk - c/dev/sda


2, after restart the server, and then expanded vgextend




3, one of two ways: 1, lvextend -l + 7680/dev/mapper/centos - root (in this case)
2, lvextend -l + 100 g/dev/mapper/vg_group - vg_user

4, after using resize2fs updated
Resize2fs/dev/mapper/vg_group - vg_user
Can be expanded to complete

5, if resize2fs error:
Resize2fs 1.42.9 (28 - Dec - 2013)
Resize2fs: Bad magic number in super - block while trying to open/dev/mapper/vg_group - vg_user
Couldn 't find valid filesystem superblock.
The
using the following waysXfs_growfs/dev/mapper/vg_group - vg_user

Expansion error, can use a command partprobe solve

Partprobe


6, remove the logical volume LV
Lvremove/dev/mapper/vg_sdb - vg_sdb0



7, delete the physical volume PV
Pvremove/dev/sdg5
Labels on physical volume "/dev/sdg5" successfully wiped




8, delete vg
Vgremove vg_group

CodePudding user response:

The LVM can be expanded, before you have to say is how to format the partition
  • Related