Tuesday, October 4, 2011

AIX - MIGRATEPV Command with rootvg

MIGRATEPV Command with rootvg
The only situation that is specific to rootvg is if the desired disk
contains the boot image. Generally, this will be the logical volume
called hd5 and will have a type of boot, as shown from a partial list of
lsvg -l rootvg: 
    LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
    hd5         boot 1     1   1     closed/syncd N/A 
To determine if the boot image is on the disk you wish to migrate, run
the lslv -l <bootlvname> command.
Example: 
    # lslv -l hd5
    hd5:N/A
    PV COPIES IN BAND DISTRIBUTION
    hdisk0 001:000:000 100% 001:000:000:000:000 
In this case, the boot image resides on the disk we wish to migrate. The
boot image will need to be moved first. Do so with the command
migratepv -l <bootimage name> <source disk> <destination disk>. 
Example: 
    #migratepv -l hd5 hdisk0 hdisk1 
NOTE: The destination disk must be supported as a boot disk. Run the
command bootinfo -B <hdisk#> to determine if the disk is supported as a
boot disk. If the command returns 1, then it is supported as a boot
disk. AIX 4.2 and later will present a warning from the migratepv
command if the destination disk is not bootable.
After the boot image has been moved, the boot record on the original
disk should be cleared to prevent possible problems if the machine
accidentally attempted to boot from this disk. Use the mkboot -c - d
/dev/<hdisk#> command on the source disk to clear the boot record. 
Example: 
    #mkboot -c -d /dev/hdisk0 
Afterward, update the boot image on the new destination disk. Run
bosboot -a -d /dev/<hdisk#> for the destination disk to rebuild the boot
image and generate a new boot record on the source disk.
Example: 
    #bosboot -a -d /dev/hdisk1 
Now, update the bootlist so that the system will know where to find the
new hd5. 
Example: 
    #bootlist -m normal hdisk1 
At this point, you can migrate the rest of the contents of the source
physical volume to the destination disk or disks. 
Example: 
    #migratepv hdisk0 hdisk1 
Once this command has completed, the migration will be complete.

No comments:

Post a Comment