Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
6.3. Splitting a Volume Group
In this example, an existing volume group consists of three physical volumes. If there is enough unused space on the physical volumes, a new volume group can be created without adding new disks.
In the initial set up, the logical volume
mylv is carved from the volume group myvol, which in turn consists of the three physical volumes, /dev/sda1, /dev/sdb1, and /dev/sdc1.
After completing this procedure, the volume group
myvg will consist of /dev/sda1 and /dev/sdb1. A second volume group, yourvg, will consist of /dev/sdc1.
6.3.1. Determining Free Space Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
You can use the
pvscan command to determine how much free space is currently available in the volume group.
6.3.2. Moving the Data Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
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.
After moving the data, you can see that all of the space on
/dev/sdc1 is free.
6.3.3. Splitting the Volume Group Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
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.
lvchange -a n /dev/myvg/mylv vgsplit myvg yourvg /dev/sdc1 Volume group "yourvg" successfully split from "myvg"
# lvchange -a n /dev/myvg/mylv
# 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.
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
# 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
6.3.4. Creating the New Logical Volume Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
After creating the new volume group, you can create the new logical volume
yourlv.
lvcreate -L5G -n yourlv yourvg Logical volume "yourlv" created
# lvcreate -L5G -n yourlv yourvg
Logical volume "yourlv" created
6.3.5. Making a File System and Mounting the New Logical Volume Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
You can make a file system on the new logical volume and mount it.
6.3.6. Activating and Mounting the Original Logical Volume Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
Since you had to deactivate the logical volume
mylv, you need to activate it again before you can mount it.