LVM

From Nuclear Physics Group Documentation Pages
Revision as of 18:13, 11 June 2009 by Tbow (talk | contribs) (→‎Expand a volume)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Logical Volume Management is used to treat seperate disks as one. However, this can cause trouble when trying to access the disks from a recovery CD, etc.

Mounting

To mount lvm partitions from a livecd (for purposes of recovery/emergency maintenance), simply:

  1. modprobe dm-mod to load required modules
  2. lvm vgchange -ay to become aware of the volume groups
  3. mount as normal with mount /dev/vg_(machine-name)/(distro-name) /location/to/mount/to.

Maintenance

Expand a volume

In order to expand a logical volume and its corresponding filesystem:

  1. lvscan to find out the location (/dev/) of the lvm.
  2. umount /dev/vg_machine/lv
  3. lvresize -L +2G /dev/vg_machine/lv
  4. e2fsck -f /dev/vg_machine/lv
  5. resize2fs /dev/vg_machine/lv
  6. reboot