HP-UX System Administrator's Guide: Routine Management Tasks
NOTE: You can use the same procedure to replace a disk that contains unmirrored
logical volumes. However, by removing the disk, you will permanently lose any
unmirrored data on that disk. Therefore, before starting this procedure, confirm that
you have a backup of any unmirrored logical volume, then halt any applications using
it, and unmount any file system mounted on it. After replacing the disk and activating
the volume group, do not use those unmirrored logical volumes until you have
recovered them from backup.
Moving a Directory to a Logical Volume on Another System
In this example we’ll move a 500MB directory, /projects, from a system (named
wsb2600) that is using “whole-disk” access, to a new logical volume,
/work/project6, on a file server. We will assume that the wsb2600 is sharing the
directory with all the other systems.
The system’s name is wsb2600; the file server is fp_server.
1. Do this step on the original server, that is, the system you plan to move the
directory from, wsb2600 in this example.
Make sure that /work/project6 exists and is empty on all the systems. That is,
use:
mkdir /work/project6
Find out how much space /projects takes up on wsb2600:
du -s /projects/
887740 (about 430 MB)
du reports the size of a directory in 512-byte blocks; dividing by 2048 gives the
size in megabytes.
2. Do this step on the new server, that is, the system you plan to move the directory
to, fp_server in this example.
Find a volume group on fp_server with at least as much space as /projects
currently occupies on wsb2600.
The HP SMH Volume Groups menu shows the free space for each volume group
in megabytes; the pvdisplay command provides the same information in terms
of physical extents; multiply Free PE by four to get free space in megabytes.
3. Do this step on the new server, that is, the system you plan to move the directory
to, fp_server in this example.
After selecting a volume group with sufficient space, create a new logical volume
in it.
You can do this on the command line - for example,
lvcreate -L 500 /dev/vg02
Managing Disks - Quick Reference Examples 113