0
[root@tst-01 puppet]# lvs
  LV     VG   Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  lvhome vg00 -wi-ao  2.00g
  lvroot vg00 -wi-ao 38.75g
  lvswap vg00 -wi-ao  4.00g
  lvtmp  vg00 -wi-ao  1.00g
  lvvar  vg00 -wi-ao  4.00g
[root@tst-01 puppet]# vgs
  VG   #PV #LV #SN Attr   VSize  VFree
  vg00   1   5   0 wz--n- 49.75g    0

Tst-01 is a VMware Virtual Machine that runs RHEL-6 and uses LVM ext4-partitions.

I would like to make the root-partition 4GB smaller and make lvvar 4GB bigger. How do I do this without any downtime?

ujjain
  • 3,983
  • 16
  • 53
  • 91
  • Can you give the output of `df -h` as well? This can be done as long as there's enough free space. – Nathan C Jul 08 '13 at 13:40
  • For what it's worth, I have resized /var while running, using LVM, but /var was its own logical volume on the same volume group, but logically separate from / –  Jul 08 '13 at 15:36
  • 1
    @GreggLeventhal, did you grow or shrink? Growing is trivial with LVM assuming you have free space. Online shrinking is not an option with almost every filesystem type. BTRFS allows online shrinking, but you probably wouldn't be using btrfs with LVM. – Zoredache Jul 08 '13 at 23:37
  • I believe I shrunk /opt which was on a different volume group, reclaimed the space for the VG that /var was on, and then grew /var. All while online. FS was EXT4. –  Jul 09 '13 at 15:17

1 Answers1

1

LVM on Linux does not have this functionality. I was asking myself this question time ago, because I used AIX which has a "chfs -a size=-4G" command, so I was looking for something like lvreduce -L 2G /dev/mapper/yourfs.

Sorry friend, but you will need an active-passive configuration with other linux box if you don't want a downtime.