Troubleshooting
Problem
Reduce or increase a /depot partition in LVM logical volume
Resolving The Problem
This can cause problems as no space left on /depot to install 3rd party software.
First start to reduce /home from 80 GB to70 GB as example
# lvdisplay
--- Logical volume ---
LV Name 0; /dev/vg_suppocs03/lv_home
VG Name 0; vg_suppocs03
LV UUID 0; sPH5jt-MjOE-xf37-9NyJ-0LdB-ADBV-Kb4S0e
LV Write Access read/write
LV Status &# 160; available
# open 0; 0
LV Size 0; 80.37 GiB
Current LE 20574
Segments 1
Allocation 0; inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
#umount /dev/mapper/vg_suppocs03-lv_home
# lvm vgchange -a y
# e2fsck -f /dev/mapper/vg_suppocs03-lv_home
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/vg_suppocs03-lv_home: 14413/5267456 files (0.4% non-contiguous), 1655350/21067776 blocks
# resize2fs -f /dev/mapper/vg_suppocs03-lv_home 70G
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/mapper/vg_suppocs03-lv_home to 18350080 (4k) blocks.
The filesystem on /dev/mapper/vg_suppocs03-lv_home is now 18350080 blocks long.
#lvm lvreduce -L70G /dev/mapper/vg_suppocs03-lv_home
WARNING: Reducing active logical volume to 70.00 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_home? [y/n]: y
Reducing logical volume lv_home to 70.00 GiB
Logical volume lv_home successfully resized
# lvdisplay--- Logical volume ---
LV Name 0; /dev/vg_suppocs03/lv_home
VG Name 0; vg_suppocs03
LV UUID 0; sPH5jt-MjOE-xf37-9NyJ-0LdB-ADBV-Kb4S0e
LV Write Access read/write
LV Status &# 160; available
# open 0; 0
LV Size 0; 70.00 GiB
Current LE 17920
Segments 1
Allocation 0; inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
# mount /dev/mapper/vg_suppocs03-lv_home /home# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_suppocs03-lv_root
; 51606140 8877156 40107544 19% /
tmpfs 1961516 0 1961516 0% /dev/shm
/dev/sda1 &# 160; 495844 36530 433714 8% /boot
/dev/mapper/vg_suppocs03-lv_home
; 72248648 5294980 63283656 8% /home
Now you can use the same step to add 10 G to /root or /depot by using the command lvexte to extend the volume with the follwoing syntax;
# lvextend -L+1G /dev/mapper/vg_suppocs03-lv_root
lvextend -- extending logical volume /dev/mapper/vg_suppocs03-lv_rootl" to 10 GB
Was this topic helpful?
Document Information
Modified date:
16 September 2018
UID
isg3T1016221