How to resize LVM logical volume
Posted: 02 Mar 2020, 18:12
1) Use resize2fs to increase and decrease a filesystem size
http://fibrevillage.com/storage/315-use ... ystem-size
2) Removing a Disk from a Logical Volume
https://access.redhat.com/documentation ... _remove_ex
3) LVM Resize – How to Decrease an LVM Partition
https://www.rootusers.com/lvm-resize-ho ... partition/
Use lvresize to resize both lv and filesystem size
The following command will shrink reduce by 10GB the size of both the logical volume and the filesystem:
Check what (and how much) physical disks are being used in a volume group
Remove a physical disk (/dev/sdb1) from a volume group (myvg)
Identify a virtual disk (i.e. a VHD or a VMDK) no more in use and safely remove it from the hypervisor
In modern Linux distros you can use this command to.
For instance you could have results similar to the following:
From that info you will be able to know that the disk sdj is attached to the controller (either physical or virtual) 1 at number 6
http://fibrevillage.com/storage/315-use ... ystem-size
2) Removing a Disk from a Logical Volume
https://access.redhat.com/documentation ... _remove_ex
3) LVM Resize – How to Decrease an LVM Partition
https://www.rootusers.com/lvm-resize-ho ... partition/
Use lvresize to resize both lv and filesystem size
The following command will shrink reduce by 10GB the size of both the logical volume and the filesystem:
Code: Select all
lvresize -r -L -10g /dev/mapper/vg0-lvol0
Code: Select all
pvs -o+pv_used
Code: Select all
vgreduce myvg /dev/sdb1
In modern Linux distros you can use this command to.
Code: Select all
sudo ls /sys/block/sd*/device/*
Code: Select all
/sys/block/sdj/device/scsi_device:
1:0:0:6