Friday, September 1, 2017

How to clear the disk errors without reboot in VxVM 


There are two procedures to do this :

Procedure 1 (setting up mirror ):

# vxassist -g rootdg mirror swapvol2 rootdg03
# vxassist -g rootdg remove mirror swapvol2 !rootdg02

verify results by using "vxprint -thg rootdg"
Please make sure that swapvol2 is now located on disk c6t8d0

OR

Procedure 2 (Evacuate rootdg2) :

# /etc/vx/bin/vxevac -g rootdg rootdg02 rootdg03

verify results by using "vxprint -thg rootdg"
Please make sure that swapvol2 is now located on disk c6t8d0

Note :If any one of the above procedure works then downtime is not required, else need to replace and add the new disk. 
How to format and create a LUN on FC60 - HP-Ux


1. Unmount the file system which are from the FC60 LUNS.

     # umount  /archive

 This is the FS which is created from the LUN 0.

2. De-activate the VG containing the FC60 LUNS

     # vgchange -a n /vg01

3. Check the LUN status and ID's

    # amdsp -a IDMP003_FC60  

4. Delete LUN 2 and assign the disks to unassigned group.

    # amdsp -D 2 IDMP003_FC60

    Delete LUN 0 and assign the disks to unassigned group.

    # amdsp -D 0 IDMP003_FC60

5. Remove the Hot spare disk

    # ammgr -d 3:4 IDMP003_FC60  

6. Verify the Array status.

    # amdsp -a IDMP003_FC60

7. Create a LUN X (X can be 0,1,2..) with RAID 1 on the array

    # amcfg -L A:2 -d  1:0,3:0 -r 1  IDMP003_FC60

8. Verify whether the LUN is created with proper disks selected.

    # amdsp -a  IDMP003_FC60  

9. Verify that the LUN is available for system use with ioscan.

========================================================================
// Follow the below mirroring procedure for root VG:
========================================================================

In this example, the disk to be used as an additional mirror copy will be /dev/dsk/c0t5d0,
which will include the boot, root, and the swap logical volumes.

The primary mirror copy will be on /dev/dsk/c0t6d0.

1. Add a bootable LVM disk. Create a physical volume using pvcreate with the -B option.

# pvcreate -B /dev/rdsk/c0t5d0

2. Add the physical volume to the existing root volume group with vgextend:

# vgextend /dev/vg00 /dev/dsk/c0t5d0

3. Use mkboot to place boot utilities in the boot area:

# mkboot -l /dev/rdsk/c0t5d0

Use mkboot to add an AUTO file in boot LIF area:

# mkboot -a "hpux" /dev/rdsk/c0t5d0

Or, use the -lq option to allow the system to boot in the event that one of the disks is unavailable, resulting in a loss of quorum.

# mkboot -a "hpux -lq" /dev/rdsk/c0t5d0

NOTE: Use the -lq option when the root volume group contains only 2 disks.
      If more than 2 disks are in the root volume group, the -lq option is not needed as quorum will be maintained even if 1 disk fails.

Check the contents of the AUTO file with

# lifcp /dev/rdsk/c0t5d0:AUTO -

Alternatively, one could set the alternate boot path variable according to for example

# setboot -a 8/0/19/0.5.0

The hardware address of the disk that will become the mirror disk can be determined with 'ioscan -fnC disk'. To check, use setboot without any arguments.

If desired, activate autosearch and autoboot by

# setboot -s on -b on

4. Use pvdisplay -v to note the sequence of the logical volumes on the primary disk.

# pvdisplay -v /dev/dsk/c0t6d0

NOTE: In the following, the standard sequence lvol1, lvol2, lvol3, and so forth, is assumed.

Create mirror copies of the boot logical volume, primary swap logical volume, root logical volume,
and other logical volumes as needed, in the correct sequence

# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t5d0

// Perform the lvextend on rest all of the logical volumes.
Use pvdisplay -v to check the correct sequence of the logical volumes on the mirror disk.

# pvdisplay -v /dev/dsk/c0t5d0

5. Update all physical volumes in the volume group so that the logical volume become the root, boot, primary swap, or a dump volume when the system is next booted:

# lvlnboot -r /dev/vg00/lvol1 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00

Check with :

# lvlnboot -v

Both disks must be listed for root, boot and swap definitions.

NOTE: Without the lvlnboot sequence the system will not be able to boot automatically if the primary disk fails.

In order to correct it then, the system will have to be booted into LVM maintenance mode.

6. In order to test the mirror configuration, shut down the system and boot from the mirror disk.

# shutdown -ry 0

The system will shut down and reboot. As the system starts to come back up, look for the message (system's output may vary):

TO INTERRUPT THE BOOT SEQUENCE, PRESS ...

Interrupt the boot sequence. This will display the Boot Admin display. At the boot_admin> prompt type:

bo Mirror_disk_hardware_address or bo alt
if the alternate boot device has been configured. The system will prompt to interact with IPL, answer 'no', and the system will boot from the mirror root disk.