This is more a quick mental note for myself on resizing a logical volume using LVM2 on linux redhat.

Basically, we check that no one is using the file system, can also use lsof for this, then unmount it, extend the logical volume by 30G and do some file system checks, turn off journalling (changes the ext3 file system to an ext2), does the resize, turns on journalling again and then mounts the file system ready for use.

  1. fuser /data/archive
  2. umount /data/archive
  3. lvextend -L+30G /dev/vgSAN/lvSANarchive
  4. fsck -n /dev/vgSAN/lvSANarchive
  5. tune2fs -O ^has_journal /dev/vgSAN/lvSANarchive
  6. fsck -f /dev/vgSAN/lvSANarchive
  7. resize2fs /dev/vgSAN/lvSANarchive (older systems ext2resize /dev/vgSAN/lvSANarchive)
  8. tune2fs -j /dev/vgSAN/lvSANarchive
  9. mount /data/archive
  10. df -h /data/archive

Done!

Advertisements