Back up the data on the disk; see the backup chapter in HP-UX
System Administration Tasks.
Unmount any file systems residing on the LVM disk
by using the umount command.
Deactivate the disk's volume group by using the vgchange command.
Remove the volume group of the disk from its current
configuration and prepare to export it using the vgexport command. The -m option creates a mapfile that retains the names of the logical volumes
in the volume group.
/usr/sbin/umount /dev/vg01/lvol1 /usr/sbin/vgchange -a n /dev/vg01 /usr/sbin/vgexport -m mapfile /dev/vg01
|
Copy the mapfile to the new system on which the disk will reside.
On a networked system, you can use rcp or ftp.
Create a record of your system's current disk
configuration for later use.
/usr/sbin/ioscan -fun -C disk |
Note whether the current configuration includes
the device driver needed to communicate with the disk being configured.
If any necessary driver is absent from the kernel, you will need
to rebuild the kernel to include it. Here is how you rebuild the
kernel:
Change directory to the build environment (/stand/build). There, execute a system preparation script, system_prep, which extracts the system file from the current
kernel and writes a system file in your current directory. (That is, it creates /stand/build/system.) The -v gives verbose explanation as the script executes.
cd /stand/build /usr/lbin/sysadm/system_prep -v -s system
|
Edit the /stand/build/system file to add the absent driver(s).
Build the kernel by invoking the mk_kernel command. This creates /stand/build/vmunix_test, a kernel ready for testing.
/usr/sbin/mk_kernel -s system |
Save the old system file and kernel by moving them.
Thus, if anything goes wrong, you still have a bootable kernel.
mv /stand/system /stand/system.prev mv /stand/vmunix /stand/vmunix.prev
|
Move the new system file and new kernel into place,
ready to be used when you reboot the system.
mv /stand/build/system /stand/system mv /stand/build/vmunix_test /stand/vmunix
|
Bring the system down and physically install the
disk device.
Turn on the power to all peripheral devices. Wait
for them to become "ready", then turn on power
to the SPU.
Watch the bootup sequence and record the name of
the block device special file created for the new LVM disk.
You can also identify the disk device by using the ioscan command. /usr/sbin/ioscan -fn -C disk will display all disks and their device special
files. Or, you can use /usr/sbin/ioscan -H hardware_path -fn to identify the disk device by location.
Scan your current system to identify all disks by
their volume groups.
Create a directory for the volume group to which
the new LVM disk will belong. For example, a new volume group might
be called vg06.
Check to make sure that you are creating a unique
minor number for the new group file. Then create a character device special file
for the new volume group's group file. The character major number for LVM is 64. In the minor number, n must
be in the range between 0 and 9, because the maximum number of volume groups by
default allowed on a system is ten. You can increase the number
by changing the operating-system parameter maxvgs in /usr/conf/master.d/core-hpux or by using SAM.
ll /dev/*/group mknod /dev/vg06/group c 64 0x0n0000
|
Import the LVM disk to the current system, citing
the the block device special file name you noted when the system
booted up and the mapfile you created when invoking vgexport at the beginning of the procedure. You can preview
the effect of the import by using the -p option.
vgimport -pv -m mapfile /dev/vg06 block_device_special_file vgimport -v -m mapfile /dev/vg06 block_device_special_file
|
The vgimport command adds the volume group name to the /etc/lvmtab file. It also adds the device special files associated
with the volume group's logical volumes to the system.
Activate the new volume group.
/usr/sbin/vgchange -a y /dev/vg06 |
Mount the logical volumes to their new mount point.
For further information on mounting and unmounting, consult the HP-UX
System Administration Tasks manual.
mkdir /new_locationmount /dev/vg06/lvol1 /new_location
|