How to Reduce LVM Partition size?

In order to reduce / shrink the LVM partition you need to unmount the partition first.

for extend the LVM partition watch :   https://www.youtube.com/watch?v=2-CDwZvFn0A

or www.youtube.com/user/solutionsatexperts

/home partition is of 20GB space we are going to reduce the size from 20G to 10G as described in below steps.

[root@experts ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/vg_controller-lv_root

138G  4.0G  127G   4% /

tmpfs                 2.9G   72K  2.9G   1% /dev/shm

/dev/sda1             485M   56M  404M  13% /boot

/dev/mapper/vg_controller-lv_home

 20G  172M   19G   1% /home

Step 1: unmount /home and check the file system .

[root@experts ~]# umount /home

[root@experts ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/vg_controller-lv_root

138G  4.0G  127G   4% /

tmpfs                 2.9G   72K  2.9G   1% /dev/shm

Step 2: run e2fsck command to check the file system

Know The Volume Group

[root@experts ~]# vgdisplay

— Volume group —

VG Name               vg_controller

System ID

Format                lvm2

Metadata Areas        2

Metadata Sequence No  7

VG Access             read/write

VG Status             resizable

MAX LV                0

Cur LV                3

Open LV               2

Max PV                0

Cur PV                2

Act PV                2

VG Size               394.52 GiB

PE Size               4.00 MiB

Total PE              100996

Alloc PE / Size       42432 / 165.75 GiB

Free  PE / Size       58564 / 228.77 GiB

VG UUID               YyRCG2-IAq9-dsmH-ZtiU-Qci3-euez-SYeRrM

[root@experts ~]# e2fsck -f /dev/mapper/vg_controller-lv_home

Step:3 resize the LVM partition which was mounted on /home in order to reduce the size “from 20 GB to 10GB”, use below command

[root@experts ~]#resize2fs /dev/mapper/vg_controller-lv_home 10G

Step:4 reduce the logical volume size using  lvreduce command, use below command.

[root@experts ~]#lvreduce -L 10G /dev/mapper/vg_controller-lv_home

Step:5 remount /home, use below command

[root@experts ~]#mount /dev/mapper/vg_controller-lv_home

Step:6 check /home disk space(10G), use below command

[root@experts ~]#df -h

 

Watch out below video:


Both comments and pings are currently closed.

Comments are closed.

Copyright ©Solutions@Experts.com
Copyright © NewWpThemes Techmark Solutions - www.techmarksolutions.co.uk