3.2. Moving the Data
You can move all the used physical extents in
/dev/sdc1
to
/dev/sdb1
with the
pvmove
command. The
pvmove
command can take a long time to execute.
[root@tng3-1 ~]# pvmove /dev/sdc1 /dev/sdb1
/dev/sdc1: Moved: 14.7%
/dev/sdc1: Moved: 30.3%
/dev/sdc1: Moved: 45.7%
/dev/sdc1: Moved: 61.0%
/dev/sdc1: Moved: 76.6%
/dev/sdc1: Moved: 92.2%
/dev/sdc1: Moved: 100.0%
After moving the data, you can see that all of the space on
/dev/sdc1
is free.
[root@tng3-1 ~]# pvscan
PV /dev/sda1
VG myvg
lvm2 [17.15 GB / 0
free]
PV /dev/sdb1
VG myvg
lvm2 [17.15 GB / 10.80 GB free]
PV /dev/sdc1
VG myvg
lvm2 [17.15 GB / 17.15 GB free]
Total: 3 [51.45 GB] / in use: 3 [51.45 GB] / in no VG: 0 [0
]
3.3. Splitting the Volume Group
To create the new volume group
yourvg
, use the
vgsplit
command to split the volume group
myvg
.
Before you can split the volume group, the logical volume must be inactive. If the file system is
mounted, you must unmount the file system before deactivating the logical volume.
You can deactivate the logical volumes with the
lvchange
command or the
vgchange
command. The following command deactivates the logical volume
mylv
and then splits the
volume group
yourvg
from the volume group
myvg
, moving the physical volume
/dev/sdc1
into
the new volume group
yourvg
.
[root@tng3-1 ~]# lvchange -a n /dev/myvg/mylv
[root@tng3-1 ~]# vgsplit myvg yourvg /dev/sdc1
Volume group "yourvg" successfully split from "myvg"
You can use the
vgs
command to see the attributes of the two volume groups.
[root@tng3-1 ~]# vgs
VG
#PV #LV #SN Attr
VSize
VFree
myvg
2
1
0 wz--n- 34.30G 10.80G
yourvg
1
0
0 wz--n- 17.15G 17.15G
Splitting the Volume Group
63
Содержание GLOBAL FILE SYSTEM 5.0
Страница 1: ...LVM Administrator s Guide Configuration and Administration 5 0 ISBN N A Publication date...
Страница 4: ...LVM Administrator s Guide...
Страница 8: ...viii...
Страница 18: ...6...
Страница 28: ...16...
Страница 32: ...20...
Страница 80: ...68...
Страница 90: ...78...
Страница 92: ...80...
Страница 94: ...82...
Страница 112: ...100...