Este contenido no está disponible en el idioma seleccionado.
5.4. Removing a Disk from a Logical Volume
These example procedures show 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.
5.4.1. Moving Extents to Existing Physical Volumes Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
In this example, the logical volume is distributed across four physical volumes in the volume group
myvg
.
This examples moves the extents off of
/dev/sdb1
so that it can be removed 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.Copy to Clipboard Copied! Toggle word wrap Toggle overflow After thepvmove
command has finished executing, the distribution of extents is as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the
vgreduce
command to remove the physical volume/dev/sdb1
from the volume group.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The disk can now be physically removed or allocated to other users.
5.4.2. Moving Extents to a New Disk Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
In this example, the logical volume is distributed across three physical volumes in the volume group
myvg
as follows:
This example procedure moves the extents of
/dev/sdb1
to a new device, /dev/sdd1
.
- Create a new physical volume from
/dev/sdd1
.pvcreate /dev/sdd1
# pvcreate /dev/sdd1 Physical volume "/dev/sdd1" successfully created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add the new physical volume
/dev/sdd1
to the existing volume groupmyvg
.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Use the
pvmove
command to move the data from/dev/sdb1
to/dev/sdd1
.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
You can now reallocate the disk to another volume group or remove the disk from the system.