Resizing LVM

Published: Monday, Feb 18, 2008 Last modified: Tuesday, Nov 26, 2024

So what is your disk’s capacity?

x61:~% sudo pvscan
  PV /dev/sda5   VG x61   lvm2 [111.55 GB / 0    free]
  Total: 1 [111.55 GB] / in use: 1 [111.55 GB] / in no VG: 0 [0   ]

Not sure wtf is on sda1

x61:~% cat /proc/partitions 
major minor  #blocks  name

   8     0  117220824 sda
   8     1     248976 sda1
   8     2          1 sda2
   8     5  116969233 sda5
 254     0    7000064 dm-0
 254     1    2719744 dm-1
 254     2  107245568 dm-2
   7     0     102400 loop0
 254     3     101372 dm-3
   8    16    2015232 sdb
   8    17     184716 sdb1

To find out about your logical volumes:

x61:~% sudo lvscan
  ACTIVE            '/dev/x61/root' [6.68 GB] inherit
  ACTIVE            '/dev/x61/swap_1' [2.59 GB] inherit
  ACTIVE            '/dev/x61/home' [102.28 GB] inherit

Remember in order to reduce say home, you first need to resize2fs home down and then you can think about sudo lvreduce -L-10g /dev/x61/home.