Complete the operating system centos5.8 external 10G hard drive under the VM9 virtual machine.
1. First of all, the hard disk SDB is divided into 4 areas per district size 200M, respectively, sdb{5,6,7,8}. Four partitions will be built after PV
2. PV is then added to VG here to introduce the concept of PE .
Since VG is composed of multiple PE (blocks), the maximum number of PE per VG block is 65534. The default size of each PE is 4m
That is, the default of each VG is the maximum of 4m multiply 65534=256g, so the size of the PE block determines the size of the final VG.
Here we define the size of the PE block to be 16m. Since the size of each PV is 200m in total 800m, the total number of PV is 48.
Establish the command below Vgcreate-s 16M lvm_vg/dev/sdb{5,6,7,8}.
3. Next we use the number of PE blocks to create LV because each PV can be divided out of PE is 12 so to create a 600M need 36 PE. The command below Lvcreate-l 36-n LVM_LV LVM_VG will be established by the LV format and mounted to/MNT/LVM. Also in it established three folders AAA BBB CCC.
4. Next, we use the remaining PE in VG to create snapshots lvm_lv this volume .
As there are 12 of the remaining PE we are all used to take snapshots.
The command follows Lvcreate-l 12-s-n lvm_ss lvm_ss/dev/lvm_vg/lvm_lv The snapshot is established and we mount it under/mnt/snapshot
When we get to the directory can see the original AAA BBB CCC three directory.
The key command established by the snapshot is the Lvcreate plus-s parameter. And if you want to update the snapshot content simply uninstall it and delete the volume and then build it again.