Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
6.4. Removing a Disk from a Logical Volume
This example shows how you can remove a disk from an existing logical volume, either to replace the disk or to use the disk as part of a different volume. In order to remove a disk, you must first move the extents on the LVM physical volume to a different disk or set of disks.
6.4.1. Moving Extents to Existing Physical Volumes Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
In this example, the logical volume is distributed across four physical volumes in the volume group
myvg.
We want to move the extents off of
/dev/sdb1 so that we can remove it from the volume group.
If there are enough free extents on the other physical volumes in the volume group, you can execute the
pvmove command on the device you want to remove with no other options and the extents will be distributed to the other devices.
After the
pvmove command has finished executing, the distribution of extents is as follows:
Use the
vgreduce command to remove the physical volume /dev/sdb1 from the volume group.
The disk can now be physically removed or allocated to other users.
6.4.2. Moving Extents to a New Disk Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
In this example, the logical volume is distributed across three physical volumes in the volume group
myvg as follows:
We want to move the extents of
/dev/sdb1 to a new device, /dev/sdd1.
6.4.2.1. Creating the New Physical Volume Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
Create a new physical volume from
/dev/sdd1.
pvcreate /dev/sdd1
# pvcreate /dev/sdd1
Physical volume "/dev/sdd1" successfully created
6.4.2.2. Adding the New Physical Volume to the Volume Group Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
Add
/dev/sdd1 to the existing volume group myvg.
6.4.2.3. Moving the Data Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
Use the
pvmove command to move the data from /dev/sdb1 to /dev/sdd1.
6.4.2.4. Removing the Old Physical Volume from the Volume Group Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
After you have moved the data off
/dev/sdb1, you can remove it from the volume group.
vgreduce myvg /dev/sdb1
# vgreduce myvg /dev/sdb1
Removed "/dev/sdb1" from volume group "myvg"
You can now reallocate the disk to another volume group or remove the disk from the system.