LVM is usually used for systems equipped with a large number of disks, with good scalability, can adjust the size of volume groups and logical volumes, today Xiaobian wants to introduce to you Is Linux how to delete the PV physical volume (hard disk or partition) in LVM, let's learn together.
First, due to the operation of the hard disk or partition in fact are the same, so I'm here to partition an example.
Second, /home partition 2.6G, consists of the following pv:
/dev/sda5 100M
/dev/sda6 200M
/dev/Sda7 300M
/dev/sda8 400M
/dev/sda9 500M
/dev/sda10 600M
/dev/sda11 500M
Very broken right? ^_^ Because of the test.
Third, randomly write a bunch of files into, the amount reached 2G, idle 500M
Fourth, prepare to remove the sda6 200M PV (removed capacity must be less than the free capacity)
Ok, let's get started.
Unmount the partition (the shrink operation must be uninstalled):
umount /home
Reduce the partition:
e2fsck -f /dev/liuhg_disk/home
resize2fs /dev/liuhg_disk/home 2200M
First shrink the partition to 2200M. This is to make room for sda6, sda6 is 200M, and I vacated 400M, so it should be enough of.
Reduce the logical volume:
lvreduce -L 2200M /dev/liuhg_disk/home
The partition is reduced and the logical volume used is also reduced, and the PV is used. Status:
pvdisplay -m
is displayed as follows:
--- Physical volume ---
PV Name /dev/sda5
VG Name liuhg_disk
PV Size 103.26 MiB /not usable 3.26 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 25
Free PE 0
Allocated PE 25
PV UUID 5lnx52-b4jc-OOfZ-f2QA-ttdQ-DZeD-Ce3rb3
--- Physical Segments ---
Physical extent 0 to 24:
Logical volume /dev/liuhg_disk/home
Logical extents 0 to 24
-- - Physical volume ---
PV Name /dev/sda6
VG Name liuhg_disk
PV Size 203.92 MiB /not usable 3.92 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 50
Free PE 0 "-----That tragedy, sda6 is full of data, no more
Allocated PE 50 "-----This 50PE The data should be removed, otherwise the data will be lost, and the storage location must be at least 50PE
PV UUID S2ane6-nlFG-uSNR-35NP-Yxa6-cXRb-r8E8mK
--- Physical Segments ---
Physical extent 0 to 49:
Logical volume /dev/liuhg_disk/home
Logical extents 25 to 74
--- Physical volume ---
PV Name /dev/sda7
VG Name liuhg_disk
PV Size 305.89 MiB /not usable 1.89 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 76
Free PE 76 "---This partition has 76 spares, so it is expected that 50 will be loaded
Allocated PE 0
PV UUID 9CFnlx-CAEw-CSul-Rig9-FiCN-zK0a-oGmTEP
--- Physical Segments ---< Br>
Physical extent 0 to 75:
FRE E
--- Physical volume ---
PV Name /dev/sda8
VG Name liuhg_disk
PV Size 407.87 MiB /not usable 3.87 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 101
Free PE 60
Allocated PE 41
PV UUID X0I8p0-x2xr-2xLG-QQD4-jbtS-3C4i-xPn4Bl
--- Physical Segments ---
Physical extent 0 to 40:
Logical Volume /dev/liuhg_disk/home
Logical extents 471 to 511
Previous12Next page Total 2 pages
Many netizens reported that there was a blue screen when installing VMWare on Linux. There was an er
VNC is an excellent remote control tool software. How does VNC control remotely und
In the Linux system, there are a total of 5 commands for finding files, but general
ISO is an image file, usually you can use the corresponding software to mount the ISO, then how to m
What should I do if I install a graphics card driver error on Ubuntu 13.10?
After CentOS installs vnc, prompts Could not start Xvnc?
How to use Autofs to mount files in RHEL5
Linux system management disk and file method
Knowledge about Linux file types and extensions
How does Linux modify the PATH path of sudo?
How to install and set GlusterFS on CentOS 6.4
How to use the find command in Linux to periodically transfer logs
Linux system strace operation example summary
RedHat Linux system how to install wireless network card driver
Win8 system to automatically set the time synchronization method tutorial
How to improve the startup speed of win7?
Win7 system uninstall .net framework method graphic tutorial
Delete win8.1 system login interface power button graphic tutorial
How to close Windows 8 IE 10 SmartScreen?
How to open a file in a terminal using Linux commands
Windows 8 application store installation software error: 0x80070585
Solve the Windows 8 start menu shortcuts invalid method
What changes will be made to the operation center in the win10 first anniversary update version?