Preface:If you are lucky to be seen by a friend and find something wrong in this article, you may want to criticize and correct it. If you have any questions, we hope you can discuss them together.
What is LVM?
LVM is short for logical volume manager (logical volume manger) and a disk management tool. LVM can integrate multiple disks or disk partitions to make these disks or partitions look like a single disk. The main advantage of LVM is that it can flexibly adjust the capacity of the file system. For more information, see http://tldp.org/howto/lvm-howto.
Preparations
To better demonstrate the LVM implementation process, we first add three disks with a size of 10 Gb, 10 Gb, and 40 GB to the virtual machine. The procedure is as follows:
1. Click VM-> Settings on the tool menu bar or press Ctrl + D, as shown in 1;
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/3F/86/wKioL1PKdqTiwaAZAAIOyT-vGaY862.jpg "Title =" Figure 1 "alt =" wKioL1PKdqTiwaAZAAIOyT-vGaY862.jpg "/>
2. Click Add in the displayed window, as shown in 2;
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/3F/85/wKioL1PKPlSwiMalAAGow0jdl04174.jpg "Title =" Figure 2 "alt =" wkiol1pkpl1_alaagow0jdl000004.jpg "/>
3. Select hard disk in the displayed window and click Next, as shown in 3;
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/3F/85/wKioL1PKVv_BY6eKAAFMPxNbfRw498.jpg "Title =" Figure 3 "alt =" wkiol1pkvv_by6ekaafmpxnbfrw498.jpg "/>
4. Click Next on the basis of the previous step until the window shown in Figure 4 is displayed, enter and select as shown in figure 4, and click Next;
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/3F/85/wKioL1PKP_ej9XNdAAEwFPInzYE677.jpg "Title =" Figure 4 "alt =" wkiol1pkp_ej9xndaaewfpinzye677.jpg "/>
5. Click Finish to add a 10 GB disk.
Tip: add 10 GB and 40 Gb disks respectively from step 2 to Step 5.
Note: If the system has been started before the disk is added, the added disk will be valid only after the system is restarted.
LVM implementation process
It seems difficult to use LVM to manage disks, but it is very simple in the actual production process. 5 shows the implementation flowchart of each LVM component.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/3F/85/wKioL1PKQ3Lh2_tOAAMzvk4jJ9o483.jpg "Title =" Figure 5 "alt =" wkiol1pkq3lh2_toaamzvk4jj9o483.jpg "/>
The following describes the phases in the flowchart:
Tip: the following uses two 10 Gb disks for LVM implementation demonstration. Therefore, you do not need to partition the disks. In the next section, we will partition the 40 GB disk and then demonstrate the LVM implementation process.
1. directly create two 10 Gb disks as PV for LVM demonstration (Partitions are not required.):
1. Create a PV stage (directly enter the PV stage because no partition operation is required); 650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/3F/85/wKiom1PKVifQvCPmAAIWCnakO90252.jpg "Title =" Figure 6 "alt =" wkiom1pkvifqvcpmaaiwcnako90252.jpg "/>
2. Create the VG stage;
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/3F/86/wKiom1PKe7Ciz-B5AAGnIkmhxgk562.jpg "Title =" Figure 7 "alt =" wKiom1PKe7Ciz-B5AAGnIkmhxgk562.jpg "/>
3, LV stage; 650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/3F/85/wKiom1PKUCmBwujoAAHV9ikCFrg939.jpg "Title =" Fig 8 "alt =" wkiom1pkucmbwujoaahv9ikcfrg939.jpg "/>
4. Create and mount a file system;
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/3F/86/wKioL1PKfAmz08zIAALdFm3a9Nc989.jpg "Title =" Fig 9 "alt =" wkiol1pkfamz08ziaaldfm3a9nc989.jpg "/>
5. Use the mounted file system;
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/3F/85/wKioL1PKVhLSYXydAAPPyhBEVog446.jpg "Title =" Figure 10 "alt =" wkiol1pkvhlsyxydaappy1_vog446.jpg "/>
6. Expand the LV capacity. 650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/3F/86/wKiom1PKeeezltsWAAWz7QW48Mk980.jpg "Title =" Fig 11 "alt =" wkiom1pkeeezltswaawz7qw48mk980.jpg "/>
7. Reduce the LV capacity. 650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/3F/86/wKioL1PKey2Q40WJAAN6mPc3xfE809.jpg "Title =" Fig 12 "alt =" wkiol1pkey2q40wjaan6mpc3xfe809.jpg "/> 650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/3F/86/wKiom1PKekLRSrH4AARMFfTFS54630.jpg "Title =" Figure 13 "alt =" wkiom1pkeklrsrh4aarmfftfs54630.jpg "/>
Ii. Perform LVM demonstration After partitioning a 40 GB disk (Partitions required):
Updating...
How to Use logical volume manager: LVM