Splitting A Volume Group; Determining Free Space; Moving The Data - 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

Chapter 5. LVM Configuration Examples
All Done
The following commands mount the logical volume and report the file system disk space usage.
[root@tng3-1 ~]# mount /dev/volgroup01/striped_logical_volume /mnt
[root@tng3-1 ~]# df
Filesystem
/dev/mapper/VolGroup00-LogVol00
/dev/hda1
tmpfs
/dev/volgroup01/striped_logical_volume

5.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.

5.3.1. Determining Free Space

You can use the pvscan command to determine how much free space is currently available in the
volume group.
[root@tng3-1 ~]# pvscan
PV /dev/sda1
PV /dev/sdb1
PV /dev/sdc1
VG myvg
Total: 3 [51.45 GB] / in use: 3 [51.45 GB] / in no VG: 0 [0

5.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%
58
1K-blocks
13902624
1656776
101086
127880
1969936
VG myvg
lvm2 [17.15 GB / 0
VG myvg
lvm2 [17.15 GB / 12.15 GB free]
lvm2 [17.15 GB / 15.80 GB free]
Used Available Use% Mounted on
11528232
10787
85080
0
127880
20
1969916
free]
13% /
12% /boot
0% /dev/shm
1% /mnt
]

Advertisement

Table of Contents
loading

Table of Contents