Moving Extents To A New Disk - Red Hat ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION Manual

Hide thumbs Also See for ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION:
Table of Contents

Advertisement

/dev/sdc1
myvg lvm2 a-
/dev/sdd1
myvg lvm2 a-
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.
[root@tng3-1 ~]# pvmove /dev/sdb1
/dev/sdb1: Moved: 2.0%
...
/dev/sdb1: Moved: 79.2%
...
/dev/sdb1: Moved: 100.0%
After the pvmove command has finished executing, the distribution of extents is as follows:
[root@tng3-1]# pvs -o+pv_used
PV
VG
/dev/sda1
myvg lvm2 a-
/dev/sdb1
myvg lvm2 a-
/dev/sdc1
myvg lvm2 a-
/dev/sdd1
myvg lvm2 a-
Use the vgreduce command to remove the physical volume /dev/sdb1 from the volume group.
[root@tng3-1 ~]# vgreduce myvg /dev/sdb1
Removed "/dev/sdb1" from volume group "myvg"
[root@tng3-1 ~]# pvs
PV
VG
/dev/sda1
myvg lvm2 a-
/dev/sdb1
/dev/sdc1
myvg lvm2 a-
/dev/sdd1
myvg lvm2 a-
The disk can now be physically removed or allocated to other users.

5.4.2. Moving Extents to a New Disk

In this example, the logical volume is distributed across three physical volumes in the volume group
myvg as follows:
[root@tng3-1]# pvs -o+pv_used
PV
VG
/dev/sda1
myvg lvm2 a-
/dev/sdb1
myvg lvm2 a-
17.15G 12.15G
17.15G
Fmt
Attr PSize
17.15G
17.15G 17.15G
17.15G 12.15G
17.15G
Fmt
Attr PSize
17.15G
lvm2 --
17.15G 17.15G
17.15G 12.15G
17.15G
Fmt
Attr PSize
17.15G
17.15G 15.15G
5.00G
2.15G 15.00G
PFree
Used
7.15G 10.00G
0
5.00G
2.15G 15.00G
PFree
7.15G
2.15G
PFree
Used
7.15G 10.00G
2.00G
Moving Extents to a New Disk
61

Advertisement

Table of Contents
loading

Table of Contents