Difference between revisions of "LVM"
From Nuclear Physics Group Documentation Pages
Jump to navigationJump to search(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | Logical Volume Management is used to treat seperate disks as one. However, this can cause trouble when trying to access the | + | 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== | ==Mounting== | ||
To mount lvm partitions from a livecd (for purposes of recovery/emergency maintenance), simply: | To mount lvm partitions from a livecd (for purposes of recovery/emergency maintenance), simply: | ||
− | <code>modprobe dm-mod</code> to load required modules | + | # <code>modprobe dm-mod</code> to load required modules |
+ | # <code>lvm vgchange -ay</code> to become aware of the volume groups | ||
+ | # mount as normal with <code> mount /dev/vg_(machine-name)/(distro-name) /location/to/mount/to</code>. | ||
+ | ==Maintenance== | ||
+ | ===Expand a volume=== | ||
+ | In order to expand a logical volume and its corresponding filesystem: | ||
+ | |||
+ | #lvscan to find out the location (/dev/) of the lvm. | ||
+ | #umount /dev/vg_machine/lv | ||
+ | #lvresize -L +2G /dev/vg_machine/lv | ||
+ | #e2fsck -f /dev/vg_machine/lv | ||
+ | #resize2fs /dev/vg_machine/lv | ||
+ | #reboot |
Latest revision as of 18:13, 11 June 2009
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:
modprobe dm-mod
to load required moduleslvm vgchange -ay
to become aware of the volume groups- 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:
- lvscan to find out the location (/dev/) of the lvm.
- umount /dev/vg_machine/lv
- lvresize -L +2G /dev/vg_machine/lv
- e2fsck -f /dev/vg_machine/lv
- resize2fs /dev/vg_machine/lv
- reboot