IBM Support

Reduce or increase a /depot partition in LVM logical volume

Troubleshooting


Problem

Reduce or increase a /depot partition in LVM logical volume

Resolving The Problem

When installing the head node in Platform HPC, there is a default partition schema, / root and /depot only have small size respectively and /home is set to use all the remaining disk space.
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

1- Use lvdisplay to display the current data on /home

# 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
2. Unmount the file system /home
#umount /dev/mapper/vg_suppocs03-lv_home
3- use lvm vgchange to activate the volume group

# 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
 
4-Use resize command to resize /home file system

# 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.
 
5- Use the lvreduce command to reduce the size of volume group
#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
6- Check with lvdisplay


# 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

7- Mount the file system /home and check with df command


# 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

[{"Product":{"code":"SSZUCA","label":"IBM Spectrum Cluster Foundation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF016","label":"Linux"}],"Version":"1.0;2.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Product":{"code":"SSZUCA","label":"IBM Spectrum Cluster Foundation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":null,"Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 September 2018

UID

isg3T1016221