• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

RHEL / CentOS : How to shrink LVM volume

by admin

Unlike increasing the LVM volume size, to shrink the volume we need to umount the filesystem. Shrinking LVM volume can not be done online.

Before shrinking the volume make sure you have taken the backup of the mount point. Shrinking volume has a chance of data corruption. Example given in this post applies to both RHEL 6 and 7

1. In the example for this post we have a volume /dev/data_vg/lv_data01 mounted on the mount point /data01 :

# df -hP | grep data01
/dev/mapper/data_vg-lv_data01  976M  2.6M  907M   1% /data01
# lvs
  LV         VG      Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert
  root       centos  -wi-ao----  17.51g
  swap       centos  -wi-ao----   2.00g
  lv_data01  data_vg -wi-ao----   1.00g

2. Before shrinking the volume, umount the mount point and run fsck on it.

# umount /data01
# e2fsck -f /dev/data_vg/lv_data01
e2fsck 1.42.9 (28-Dec-2013)
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/data_vg/lv_data01: 11/65536 files (0.0% non-contiguous), 12955/262144 blocks

3. Shrink the file system to the desired size. In our case we will reduce the volume from 1G to 800MB.

# lvreduce -r -L 500M /dev/data_vg/lv_data01
fsck from util-linux 2.23.2
/dev/mapper/data_vg-lv_data01: clean, 11/65536 files, 12955/262144 blocks
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/mapper/data_vg-lv_data01 to 128000 (4k) blocks.
The filesystem on /dev/mapper/data_vg-lv_data01 is now 128000 blocks long.

  Reducing logical volume lv_data01 to 500.00 MiB
  Logical volume lv_data01 successfully resized

4. Mount the filesystem again and verify the new size.

# mount -t ext4 /dev/data_vg/lv_data01 /data01
# df -hP | grep data01
/dev/mapper/data_vg-lv_data01  460M  1.6M  424M   1% /data01
# lvs
  LV         VG      Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert
  root       centos  -wi-ao----  17.51g
  swap       centos  -wi-ao----   2.00g
  lv_data01  data_vg -wi-ao---- 500.00m
CentOS / RHEL : How To Shrink LVM Root File System

Filed Under: Linux

Some more articles you might also be interested in …

  1. git commit: Commit files to the repository
  2. ceph: command not found
  3. hashid Command Examples
  4. ptx: command not found
  5. fluxctl: Command-line tool for Flux v1
  6. aws ec2: CLI for AWS EC2 (Command Examples)
  7. aws lambda: CLI for AWS lambda (Command Examples)
  8. fossa: CLI for the Fossa service
  9. pkcon Command Examples in Linux
  10. cargo clippy: A collection of lints to catch common mistakes and improve your Rust code

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright