linux learning 33 operation and maintenance of high-level skills - to achieve in Linux LVM logical volumes and snapshots

A, LVM2

  1、LVM:Logical Volume Manager,Version:2

    LVM is somewhat similar to our soft raid, but they drive exactly the opposite, we use the soft raid md kernel module, and LVM using a dm module, which is the device mapper (device mapping component).

  2, dm: device mapper, one or more underlying devices organized into blocks of a logical device module

  3, we first physical disk devices are available in our PV is created, the device is available metadata record, and then the plurality of our composition pv VG, VG our composition until PV is not divided into PE. when our composition VG PV PV we will be divided into a plurality of blocks (PE [physics Extent]) VG composition. Because we may have different VG PE size is not the same, such as a single PE VG is some 8M, some single PE VG is 16M, so our PV PE is added only started after the allocation to the VG. LV create storage volumes on our VG process is to specify a certain number of PE course to make up a logical storage space. For example, I give it three PE, a PE is then a total of 4M 12M is, in the future when this space is not enough just to go along with a PE 16M, and then we find that we too can also assign a lose, then went back to 12M , but the process would not damage the data stored in the LV, the logical volume size can be dynamically expanded or contracted without damaging the original data

    

 

  4, our PE once assigned to him after the logical volume is no longer called the PE and is called LE [Logic Extent]

  5, VG terms for each device file his organization after completion of the device files in / dev / mapper / VG_NAME-LV_NAME, such as / dev / mapper / vol0-root represents the root called on vol0 this volume group the logical volume lv. Because it is not very easy to remember so he has a simple symbolic link to him, that is, / dev / VG_NAME / LV_NAME, namely

    /dev/mapper/VG_NAME-LV_NAME  <--- /dev/VG_NAME/LV_NAME

[root@localhost ~]# ls -ld /dev/mapper/*
lrwxrwxrwx 1 root root       7 Jan  7 05:09 /dev/mapper/centos-root -> ../dm-0
lrwxrwxrwx 1 root root       7 Jan  7 05:09 /dev/mapper/centos-swap -> ../dm-1
crw------- 1 root root 10, 236 Jan  7 05:09 /dev/mapper/control
[root@localhost ~]# ls -ld /dev/centos/*
lrwxrwxrwx 1 root root 7 Jan  7 05:09 /dev/centos/root -> ../dm-0
lrwxrwxrwx 1 root root 7 Jan  7 05:09 /dev/centos/swap -> ../dm-1

Two, LVM explain

  1、LVM:Logical Volume Manager,Version:2

  2, dm: device mapper, one or more underlying devices organized into blocks of a logical device module

      /dev/dm-#

      /dev/mapper/VG_NAME-LV_NAME

        /dev/mapper/vol0-root

      /dev/VG_NAME/LV_NAME

        /dev/vol0/root

    0:16:50

      

Guess you like

Origin www.cnblogs.com/Presley-lpc/p/12158973.html