From Wiki-UX.info

How to reassign agile addressing instance numbers on HP-UX 11i v3
Jump to: navigation, search

How to reassign agile addressing instance numbers on HP-UX 11i v3

Abstract

Contents


Reassign Instance number and device special file name

This process will allow you to restart the instance number for a specific class. Numbers will start from 0. The -C option is only available on HP-UX 11i v3, on previous versions it will be necessary to manually indicate the instance number using an infile. Legacy and persistend device files are part of the same class named "disk", so they share the same instance number space.


1. This is an example of the current configuration:

# ioscan -fNnkC disk
Class     I  H/W Path  Driver S/W State   H/W Type     Description
===================================================================
disk      7  64000/0xfa00/0x0  esdisk   CLAIMED     DEVICE       HP 36.4GST336754LC
                      /dev/disk/disk7   /dev/rdisk/disk7
disk      2  64000/0xfa00/0x1  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk2   /dev/rdisk/disk2
disk      9  64000/0xfa00/0x2  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk9   /dev/rdisk/disk9
disk     10  64000/0xfa00/0x3  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk10   /dev/rdisk/disk10
disk     11  64000/0xfa00/0x4  esdisk   CLAIMED     DEVICE       HP 36.4GST336754LC
                      /dev/disk/disk11   /dev/rdisk/disk11
disk     12  64000/0xfa00/0x5  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk12   /dev/rdisk/disk12
disk     13  64000/0xfa00/0x6  esdisk   CLAIMED     DEVICE       TEAC    DV-28E-N
                      /dev/disk/disk13   /dev/rdisk/disk13

2. Restart the instance number sequence and reboot. Some drivers like sdisk and esdisk support online reassignment, in such case a reboot is not necessary:

# ioinit -rC disk

System reboots if the command is successful. Without a reboot:

# ioinit -C disk

3. When the system/command comes back, use ioinit -c command to recreate /etc/ioconfig, /stand/ioconfig, /etc/ext_ioconfig and /stand/ext_ioconfig files from the new running configuration:

# ioinit –c

4. Backup if necessary or remove current files. If you followed a selective reassignment, make sure you remove only non-longer required files.

 # mkdir /tmp/disk
 # mkdir /tmp/rdisk
 # mv /dev/disk/* /tmp/disk
 # mv /dev/rdisk/* /tmp/rdisk

or

 # rm /dev/disk/*
 # rm /dev/rdisk/*

5. Rescan and create new DSF:

 # ioscan -fn

New files will be created. If necessary execute insf -e to recreate any missing device special file:

 # insf -e

6. New configuration:

# ioscan -fnNC disk
Class     I  H/W Path  Driver S/W State   H/W Type     Description
===================================================================
disk      0  64000/0xfa00/0x0  esdisk   CLAIMED     DEVICE       HP 36.4GST336754LC
                      /dev/disk/disk0   /dev/rdisk/disk0
disk      1  64000/0xfa00/0x1  esdisk   CLAIMED     DEVICE       TEAC    DV-28E-N
                      /dev/disk/disk1    /dev/rdisk/disk1
disk      2  64000/0xfa00/0x2  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk2    /dev/rdisk/disk2
disk      3  64000/0xfa00/0x3  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk3   /dev/rdisk/disk3
disk      4  64000/0xfa00/0x4  esdisk   CLAIMED     DEVICE       HP 36.4GST336754LC
                      /dev/disk/disk4   /dev/rdisk/disk4
disk      5  64000/0xfa00/0x5  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk5   /dev/rdisk/disk5
disk      6  64000/0xfa00/0x6  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk6   /dev/rdisk/disk6

Your current LVM configuration won’t change, so if there are volume groups already configured in the system you may need to vgexport and vgimport them to use the new device files name.

IMPORTANT NOTE: If you have reassign the instance numbers for the PVs that belong to vg00, it will be necessary to take the system down to maintenance mode and make the changes there. The system will always be bootable, but you will see some "Couln't query physical volume" errors in the vgdisplay and boot up process.

Reassign device special files for VG00

If you also want to change the device files names for vg00, booting the server in maintenance mode will be required. If you are using external devices, first you will need to mirror the drive to an internal disk and remove the external (You can go back to this configuration when the procedure is completed). Since maintenance mode will be required, You may experience some problems trying to connect to external disks in that mode.


1. Export vg00 in previous mode to create the map file. You can also create it in maintenance mode:

 # vgexport -m /vg00.map -s -p -v vg00
 # cat /vg00.map        --> Make sure the configuration is correct.

2. Complete the mirroring and removing process (if required), then reboot the system:

 # shutdown -ry 0

Interrupt boot sequence. Select your primary disk and either use "vmunix -lm" to boot in maintenance mode on PA-RISC or "boot vmunix -lm" on Itanium.

When the system is up in maintenance mode, continue:

3. Export and reimport vg00:

 # /sbin/cat /vg00.map        --> Verify the file to make sure this is the exact one you just created
 # /sbin/vgexport vg00
 # /sbin/mkdir /dev/vg00
 # /sbin/mknod /dev/vg00/group c 64 0x000000
 # /sbin/vgimport -N -m /vg00.map -s -v vg00

4. Activate vg00:

 # /sbin/vgchange -a y vg00
 # /sbin/vgdisplay -v vg00        --> Make sure the configuration is correct.

5. Update system configuration files:

 # /sbin/vgcfgbackup vg00
 # /sbin/lvlnboot -R

6. Reboot the server:

 # /sbin/reboot
NOTE: For the non-root volume groups, vgexport and vgimport commands can be executed in multi-user mode (run-level 3).

Using infile to reassing the instance number

1. Create the infile. The infile can be created manually, but is easier if created based of the system ioscan output.

For example:

A. Dump the disk device special file ioscan output
 # ioscan -fnkNC disk | grep -e ^disk -e /dev > /tmp/ioscan.out
 # ioscan -fnkC disk | grep -e ^disk -e /dev >> /tmp/ioscan.out
B. Review the output
# cat /tmp/ioscan.out
# cat /tmp/ioscan.out
disk      6  64000/0xfa00/0x0  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk6   /dev/rdisk/disk6
disk      7  64000/0xfa00/0x1  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk7   /dev/rdisk/disk7
disk      9  64000/0xfa00/0x2  esdisk   CLAIMED     DEVICE       HP 36.4GST336754LC
                      /dev/disk/disk9   /dev/rdisk/disk9
disk      8  64000/0xfa00/0x3  esdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                      /dev/disk/disk8   /dev/rdisk/disk8
disk     10  64000/0xfa00/0x4  esdisk   CLAIMED     DEVICE       HP 36.4GST336754LC
                      /dev/disk/disk10   /dev/rdisk/disk10
disk     11  64000/0xfa00/0x5  esdisk   CLAIMED     DEVICE       TEAC    DV-28E-N
                      /dev/disk/disk11   /dev/rdisk/disk11
disk      5  0/0/3/0.0.0.0  sdisk   CLAIMED     DEVICE       TEAC    DV-28E-N
                           /dev/dsk/c0t0d0   /dev/rdsk/c0t0d0
disk      0  0/1/1/0.1.0    sdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                           /dev/dsk/c2t1d0   /dev/rdsk/c2t1d0
disk      1  0/1/1/0.8.0    sdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                           /dev/dsk/c2t8d0   /dev/rdsk/c2t8d0
disk      2  0/1/1/0.10.0   sdisk   CLAIMED     DEVICE       HP 36.4GST336753LC
                           /dev/dsk/c2t10d0   /dev/rdsk/c2t10d0
disk      3  0/1/1/0.12.0   sdisk   CLAIMED     DEVICE       HP 36.4GST336754LC
                           /dev/dsk/c2t12d0   /dev/rdsk/c2t12d0
disk      4  0/1/1/1.0.0    sdisk   CLAIMED     DEVICE       HP 36.4GST336754LC
                           /dev/dsk/c3t0d0   /dev/rdsk/c3t0d0
C. Create the infile based on previous ioscan output file:
C.1 To reassign the instances based on the H/W Path starting from 0.
# awk 'BEGIN {COUNT=0} $1 ~ /^disk/ {printf "%s\tdisk\t%d\n", $3, COUNT++}' /tmp/ioscan.out > /tmp/infile

# cat /tmp/infile
64000/0xfa00/0x0        disk    0
64000/0xfa00/0x1        disk    1
64000/0xfa00/0x2        disk    2
64000/0xfa00/0x3        disk    3
64000/0xfa00/0x4        disk    4
64000/0xfa00/0x5        disk    5
C.1 To reassign the instances manually on the H/W Path based on current instance number.
# awk '$1 ~ /^disk/ {printf "%s\tdisk\t%d\n", $3, $2}' /tmp/ioscan.out > /tmp/infile

# cat /tmp/infile
64000/0xfa00/0x0        disk    6
64000/0xfa00/0x1        disk    7
64000/0xfa00/0x2        disk    9
64000/0xfa00/0x3        disk    8
64000/0xfa00/0x4        disk    10
64000/0xfa00/0x5        disk    11
D. Review the infile.

3. Modify infile as required. An entry is considered to be invalid if the specified hardware path or class name does not already exist in the system. If the specified instance number already exists for the given class, the entry is invalid if it is not for circular reassignment.

In simple words, you can assign the instance number to a new, not in use instance number, or swap the instances number between two devices.

4. To complete the process, issue the ioinit command. Some drivers like esdisk and sdisk support online reassignment, it's not necessary to reboot. Use -r option only if you do need to reboot.

 # ioinit –f infile –r

Without a reboot:

 # ioinit –f infile

To rename device special files, just go back to step #4 under "Reassign Instance number and device special file name".

Reference


Authors

This page was last modified on 26 May 2011, at 20:02. This page has been accessed 3,497 times.