Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Administering a System: Managing Disks and Files
Managing Disks
Chapter 6586
For example, you might want to move only the data from a specific logical
volume from one disk to another to use the vacated space on the first disk
for some other purpose. To move the data in logical volume
/dev/vg01/markets from the disk /dev/dsk/c0t0d0 to the disk
/dev/dsk/c1t0d0, enter
pvmove -n /dev/vg01/markets /dev/dsk/c0t0d0 \
/dev/dsk/c1t0d0
On the other hand, you might prefer to move all the data contained on
one disk, regardless of which logical volume it is associated with, to
another disk within the same volume group. You might want to do this,
for example, so you can remove a disk from a volume group. You can use
pvmove to move the data to other specific disks you choose or let LVM
move the data to appropriate available space within the volume group.
To move all data off disk /dev/dsk/c0t0d0 and relocate it at the
destination disk /dev/dsk/c1t0d0, enter:
pvmove /dev/dsk/c0t0d0 /dev/dsk/c1t0d0
To move all data off disk /dev/dsk/c0t0d0 and let LVM transfer the
data to available space within the volume group, enter:
pvmove /dev/dsk/c0t0d0
In each of the above instances, if space doesn’t exist on the destination
disk, the pvmove command will not succeed.
Reducing the Size of a Logical Volume
You might want to reduce the size of a logical volume for several reasons:
• Perhaps you want to use the logical volume for purposes other than
the one you originally created it for and that will require less space.
That is, you wish to convert the logical volume to an entirely
different, smaller logical volume.
• Another possibility is that since you have limited disk space, you
might want to free up disk space for another logical volume on a disk
by reducing the size of one that is bigger than you currently need.
• Finally, if you want to reduce the size of a file system within a logical
volume, you will first need to reduce the size of the logical volume.
See “Replacing an Existing File System with a Smaller One” on
page 619.
You reduce the size of a logical volume using the lvreduce command.