Linux/LVM: Difference between revisions
< Linux
No edit summary |
|||
Line 53: | Line 53: | ||
dd if=/dev/$vg/$snapshot_name of=/mnt/backup/snapshot.img | dd if=/dev/$vg/$snapshot_name of=/mnt/backup/snapshot.img | ||
umount /mnt/snapshot | |||
lvremove /dev/$vg/$snapshot_name | lvremove /dev/$vg/$snapshot_name | ||
</pre> | </pre> |
Revision as of 20:15, 1 November 2012
Installation
apt-get install lvm2 apt-get install system-config-lvm
Volumes
- physical volume - pv
pvs pvdisplay pvcreate /dev/<Partition>
- volume group - vg
vgs vgdisplay vgcreate <group> /dev/<Partition1> (/dev/<Partition2> /dev/<P3>...)
- logical volume - lv
lvs lvdisplay lvcreate -L 2G -n <volume> <group> lvextend -L 5G /dev/<group>/<volume>
- /dev/$vg/$lv
snapshots
lvcreate --size 100M --snapshot --name <snapshot_name> /dev/<group>/<volume> (size = max changed size) mkdir /mnt/snapshot mount /dev/$vg/$snapshot_name /mnt/snapshot or dd if=/dev/$vg/$snapshot_name of=/mnt/backup/snapshot.img umount /mnt/snapshot lvremove /dev/$vg/$snapshot_name