2011年11月15日 星期二

LVM 中製作 snapshot


Example 1: 普通用法
lvcreate -i 3 -I 8 -L 100 vg00
Tries to create a striped logical volume with 3 stripes, a stripesize of 8KB and a size of 100MB in the volume group named vg00. The logical volume name will be chosen by lvcreate.

Example 2: 從一個已存在的 image 製作 snapshot
lvcreate --size 100m --snapshot --name snap /dev/vg00/lvol1

creates a snapshot logical volume named /dev/vg00/snap which has access to the contents of the original logical volume named /dev/vg00/lvol1 at snapshot logical volume creation time. If the original logical volume contains a file system, you can mount the snapshot logical volume on an arbitrary directory in order to access the contents of the filesystem to run a backup while the original filesystem is updated.