Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hard drive failing

Status
Not open for further replies.

call

Technical User
Oct 31, 2000
127
US
Question,

My hard drive is failing on a risc6000 F40 OS 4.3.2
When I put the new hardrive in, can I migrate the data off
the failing disk before I delete the disk and pull it out of the machine. The machine is up and running right now have not had an error message for last 10 hr.

If so How can I do this? I have never had to do this before.

Thank you

 
based on your need:

1. Migrating rootvg to Another Disk Drive
2. Removing and Replacing a Fixed Disk

sorry...i can't attached the links...but here it is.

goodluck.
==========================================================
Migrating rootvg to Another Disk Drive
This document discusses the procedures specific to the rootvg volume group on how to migrate the contents on one physical volume to another physical volume in the same volume group.

This document applies to all levels of AIX Versions 4 and 5.

WARNING: Please do not use this document if the system is a /usr client, diskless client, or dataless client.

General steps for migrating contents of a physical volume
Recommended fixes
Related documentation



--------------------------------------------------------------------------------

General steps for migrating contents of a physical volume
NOTE: Before performing these instructions, please ensure that all fixes listed at the end of this document are installed for your system's level of AIX.
The command to move data from one physical volume to another physical volume within the same volume group is called migratepv. The usage parameters for this command are as follows:

migratepv [-i] [-l LVname] <SourcePV> <DestinationPV...>

More than one destination physical volume can be specified.
The first steps are to identify what disk you want to migrate and what disks to which you want to migrate it. First, you can only migrate to disks that are already in the rootvg volume group. To get a list of disks that are already in the rootvg volume group, run the command lsvg -p rootvg.

Example:

# lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 515 116 57..00..00..00..59
hdisk1 active 515 515 00..00..00..00..00

Now, determine the space that is currently being used on the disk you wish to migrate. This will be the TOTAL PPs value minus the FREE PPs value for the desired disk. In the preceding example, choose hdisk0, which is using (515 - 116) PPs or 399 physical partitions.
Then find a disk or disks that have the available space. In this case, hdisk1 has 515 free physical partitions, which is more than the required space of 399 physical paritions and will fulfill our needs.

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

Recommended fixes
APAR DESCRIPTION AIX LEVEL
IX61186 BOSBOOT DOESN'T WORK ON A BLV MIRROR V4.1
IX74042 MIGRATEPV NEEDS TO MIGRATE MIRRORS V4.1
OFF OF DEAD DISKS
IX76351 BOSBOOT DOESN'T VALIDATE DEVICE V4.1
CORRECTLY
IX62417 BOSBOOT DOESN'T WORK ON A BLV MIRROR V4.2
IX68140 MIGRATEPV, MIRRORVG, AND UNMIRRORVG V4.2
NEED TO HANDLE BLV CASES
IX74905 BOOT RAM FILESYSTEM IS TOO SMALL V4.2
IX74041 MIGRATEPV NEEDS TO MIGRATE MIRRORS V4.2
OFF OF DEAD DISKS
IX66626 BOSBOOT DOESN'T VALIDATE DEVICE V4.2
CORRECTLY
IX73591 MIGRATEPV NEEDS TO MIGRATE MIRRORS V4.3
OFF OF DEAD DISKS
IY18181 MIGRATEPV FAILING WITH MULTIPLE V4.3
DESTINATION PVS
IY12157 MIGRATEPV FAILS W/O TARGET PVS V4.3
IX68698 ALLOCP: MIGRATEPV FAILS FOR MIRRORED V4.3
LVS
IY28528 MIGRATEPV IGNORES STRICTNESS POLICY V4.3
IY27901 MIGRATEPV/REPLACEPV FAILURE V4.3
IY18861 MIGRATEPV FAILING WITH MULTIPLE V4.3
DESTINATION PVS


--------------------------------------------------------------------------------

Related documentation
For more in-depth coverage of this subject, the following IBM publications are recommended:

AIX Version 4.3 System Management Guide: Operating System and Devices (SC23-2525)
AIX Version 5.1 System Management Guide: Operating System and Devices
AIX Version 4.3 Commands Reference (references for lsvg, lslv, migratepv, and mkboot)
AIX Version 5.1 Commands Reference
=======================================================



Removing and Replacing a Fixed Disk
This document describes the procedures to remove and replace a fixed disk in a volume group. These procedures DO NOT apply in the following environments:

The disk is in a shared volume group. This would apply to environments that use HACMP, RVSD, or any other management software. Please refer to the documentation for that product for correct disk replacement procedures. The SSA User's Guide explains the procedures for changing disks in a RAID or hot swap environment. It is available for download at:
The disk is in rootvg and the disk contains any one of the following logical volumes, which are not mirrored:
hd2, hd3, hd4, hd6, hd9var, hd8

In this case, you would need to replace the disk and restore from a system backup specifying the correct disks to restore.

The system is a /usr, dataless, or diskless client.
This document applies to all Versions of AIX.

Please read the entire document before proceeding and ensure all relevant fixes mentioned in this document or otherwise are installed prior to using these procedures.

Removing a physical volume from a volume group
How to proceed if the volume group has just one disk
Deallocating physical partitions from the disk
Deleting the disk from the volume group
Removing the disk definition from the system
Adding a new drive to an existing volume group
Recommended fixes
Related documentation
--------------------------------------------------------------------------------

Removing a physical volume from a volume group
The basic steps to replacing a disk drive are as follows:

Deallocate all the physical partitions associated with the physical volume in the associated volume group.
Remove the physical volume from the volume group.
Remove the definition for the disk from the device configuration database.
These steps are outlined in more detail in subsequent sections.

If there is just one disk in the volume group, proceed to the next section, &quot;How to proceed if the volume group has just one disk.&quot; Otherwise, proceed to the section entitled &quot;Deallocating physical partitions from the disk.&quot;


--------------------------------------------------------------------------------

How to proceed if the volume group has just one disk
If the drive to be replaced is the only drive in the volume group, then remove the volume group definition with:

exportvg <VGname>

At this point, remove the disk definition using the rmdev command. Details are included in the section &quot;Removing the disk definition from the system&quot; in this document.
--------------------------------------------------------------------------------

Deallocating physical partitions from the disk
Every physical partition (PP) on the disk allocated to any logical volume (LV), including file systems or paging spaces, must be deallocated, either by moving the contents of those PPs to another disk or by removing them.

To determine what logical volumes have PPs allocated to that disk, run:

lspv -l <hdisk#>

If the hdisk name no longer exists, and the disk is identifiable only by its 16-digit PVID (you might see this from the output of lsvg -p <VGname>), substitute the PVID for the disk name. For example:

lspv -l 0123456789abcdef

You may receive the following error:

0516-320 : Physical volume 00001165a97b10c6 is not assigned to
a volume group.

If so, run the following command:

putlvodm -p `getlvodm -v <VGname>` <PVID>

VGname refers to your volume group, PVID refers to the 16-digit physical volume identifier, and the characters around the getlvodm command are grave marks, the backward single quote mark. The lspv -l <PVID> command should now run successfully.

If another disk in the volume group has space to contain the partitions on this disk, and the disk to be replaced has not failed, the migratepv command may be used to move the used PPs on this disk. See the man page for the migratepv command on the steps to do this.

If the partitions cannot be migrated, they must be removed. The output of the lspv -l <hdisk#>, or lspv -l <PVID>, command indicates what logical volumes will be affected. Run the following command on each LV:

lslv <LVname>

The COPIES field shows if the LV is mirrored. If so, remove the failed copy with:

rmlvcopy <LVname> 1 <hdisk#>

hdisk# refers to all the disks in the copy that contain the failed disk. A list of drives can be specified with a space between each. Use the lslv -m <LVname> command to see what other disks may need to be listed in the rmlvcopy command. If the disk PVID was previously used with the lspv command, specify that PVID in the list of disks given to the rmlvcopy command. At AIX Version 4.2.1 or higher, the unmirrorvg command may be used in lieu of the rmlvcopy command. See the man pages for rmlvcopy and unmirrorvg, or other documentation, for additional information.

If the LV is not mirrored, the entire logical volume must be removed, even if just one physical partition resides on the drive to be replaced and cannot be migrated to another disk. If the unmirrored LV is a JFS file system, unmount the file system and remove it. Enter:

umount /<fsname>
rmfs /<fsname>

If the unmirrored logical volume is a paging space, see if it is active. Enter:

lsps -a

If it is active, set it to be inactive on the next reboot. Enter:

chps -a n <LVname>

After you reboot, remove it by entering:

rmps <LVname>

Remove any other unmirrored logical volume with the following command:

rmlv <LVname>

NOTE: If the LV is serving as a dump device, the dump pointer must first be reassigned. The same is true if the LV was mirrored and the copy is being removed. Check the dump pointers by entering:

sysdumpdev -l

Reassign the dump pointers. Enter:

sysdumpdev -Pp /dev/sysdumpnull (for the primary device)

sysdumpdev -Ps /dev/sysdumpnull (for the secondary device)

The pointers can be reassigned to the appropriate logical volume after it is recreated.


--------------------------------------------------------------------------------

Deleting the disk from the volume group
Using either the PVID or the hdisk name, depending on which was used when running lspv -l <hdisk#> in the preceding discussion, run one of the following:

reducevg -f <VGname> <hdisk#>
reducevg -f <VGname> <PVID>

If you used the PVID value and if the reducevg command complains that the PVID is not in the device configuration database, run the following command to see if the disk was indeed successfully removed:

lsvg -p <VGname>

If the PVID or disk is not listed at this point, then ignore the errors from the reducevg command.


--------------------------------------------------------------------------------

Removing the disk definition from the system
Remove the hdisk. Enter:

rmdev -dl <hdisk#>

If the disk was an SSA disk, delete the pdisk. Enter:

rmdev -dl <pdisk#>

If the disk was an SSA disk, determine which pdisk number corresponds to the hdisk. One way to do this is with the following commands:

lsdev -Cc disk -F name' 'connwhere
lsdev -Cc pdisk -F name' 'connwhere

See which SSA disk serial number coincides with the hdisk to remove. If the hdisk does not appear, or if the user has been working with a PVID value up to this point, the pdisk whose serial number does not coincide with any of the hdisks is likely to be the disk to remove. Other SSA commands might provide additional information. Consult the SSA documentation.

If you have been working with a PVID value rather than with an hdisk name, ensure that the PVID is removed from the ODM with the following command. The 32-digit value supplied consists of the PVID plus 16 zeros. For example:

odmdelete -q value=0073659c2c6d26f10000000000000000 -o CuAt

To physically remove the hard disk, consult the documentation for that device, or the hardware service organization for the vendor.


--------------------------------------------------------------------------------

Adding a new drive to an existing volume group
Once the new drive has been configured, ensure that a proper PVID has been written to the drive by running:

chdev -l <hdisk#> -a pv=clear
chdev -l <hdisk#> -a pv=yes

NOTE: On SSA drives, the first chdev command may be omitted.

Add the drive to the volume group with:

extendvg VGname hdisk#

You can also use the mkvg command to create a new volume group on the new drive.

New logical volumes, paging spaces, file systems, or logical volume copies can be re-added with the mklv, mkps, crfs, mklvcopy, or mirrorvg commands, respectively, or by using SMIT.


--------------------------------------------------------------------------------

Recommended fixes
NOTE: In AIX Versions 4 and 5, use the command instfix -ik <APAR> to determine if a particular fix is installed.

APAR Description AIX Level
IX76798 INVALID PVID 0000000000000000 IN VGDA AIX 4.1
IX76683 INVALID PVID 0000000000000000 IN VGDA AIX 4.2



--------------------------------------------------------------------------------

Related documentation
For more in-depth coverage of this subject, the following IBM publications are recommended:


AIX Version 4.3 System Management Guide: Operating System and Devices Chapter 6, &quot;Recovering from Disk Drive Problems&quot;
AIX Version 4.3 Commands Reference
In addition, similar documents can be accessed through the following URL:
 
you can use errpt to see if your disk get a temp or perm disk operation error.
In output of errpt, find
'resource name' hdiskX,
'description' Disk operation error
and see what kind of type
'type'
If it's temp, it's doesn't matter, you can ignore it for a while. But you should check it weekly.
If it's perm, replace it ASAP.
.
About your Question, my anser is yes.
after you add a disk to your system,I assum it is hdisk1.
login as root,
1.extendvg rootvg hdisk1
2.mirrorvg rootvg
3.unmirrorvg rootvg hdisk0
4.reducevg rootvg hdisk0
5.rmdev -l hdisk0 -d

This procedure used for replace dying disk,
not for make rootvg mirrored all the time.
 
Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top