- 论坛徽章:
- 0
|
How to Change an Instance Number
Not only in cluster environments it is often useful to have a consistent device file naming. The
following procedures may be used to change the instance numbers of such devices. These
numbers determine the naming of the correpsonding device files.
The ioconfig provides the mapping between instance numbers used by the kernel and the
information the I/O system uses to communicate with peripheral devices (hardware paths).
Two copies are maintained (/stand/ioconfig and /etc/ioconfig).
At boot time the ioconfig information is stored in the io_tree kernel data structure (see
ioinit(1M)). The only purpose of the ioconfig is to maintain configuration information when
the system is not running. Even if hardware is removed from the system all mappings keep in
place. This guarantees that no new device file names will appear after such changes. If
removed hardware is added back to the system the original mapping can be reused, since it is
still present in the ioconfig files.
Usually we want to change mappings for disk and lan devices. For lan devices we change
directly the corresponding lan instance numbers. For disk devices we need to take care of the
ext_bus instance numbers. The numbers of such 'External Busses' (aka card instances) are
responsible for the 'c' numbers being part of disk device names.
Look at the following extract of an ioscan -fn output:
ext_bus 3 2/0/1 c720 CLAIMED INTERFACE Built-in SCSI
target 0 2/0/1.3 tgt CLAIMED DEVICE
target 1 2/0/1.5 tgt CLAIMED DEVICE
disk 4 2/0/1.5.0 sdisk CLAIMED DEVICE SEAGATE ST15150N
/dev/dsk/c3t5d0 /dev/rdsk/c3t5d0
The ext_bus instance number (3) is responsible for the 'c3' in 'c3t5d0'. The target (t5) and the
LUN (d0), which affect the rest of the name, are not changeable by software. Instead they
map directly to the underlying hardware configuration.
In the following three procedures are documented, an easy/quick one (Procedure I) and two
other more complicated ones (Procedure II and III).
Usually Procedure I is sufficient and there is no need to try II or III. These are only needed if
Procedure I fails. Procedure II usually works in all cases, but requires two reboots. Procedure
III needs only one reboot and should work in all cases, but you need the ioconfig2infile tool
(adapted from WTEC's parse_ioconfig), which can be obtained from the HP internal site
ftp://einstein.grc.hp.com/TOOLS/MISC (HP internal).
Procedure I
Default procedure, requires one reboot and works without additional tools.
1) Extract a configuration template from the current ioscan output
# ioscan -f | grep -e INTERFACE -e DEVICE | \
grep -v target | \
awk '{print $3, $1, $2}' > /infile
2) Edit /infile and change the ext_bus and lan instances as desired
No class is allowed to get more than one line for the same instance!
3) Bring down the system gracefully to run level 1
# init 1
4) Apply the ioconfig change
# /sbin/ioinit -f /infile -r
The system will reboot immediately if the change is successful.
Warnings like “Input is identical to kernel” can be ignored.
If unsuccessful, the most likely error to happen is:
“ioinit: Instance number X already exists for class XXX”
The problem is that your desired instance assignment conflicts with an existing instance
number. If that instance is bound to hardware that is no longer visible in ioscan, then
you are in trouble and need to perform the Procedure II or III.
5) Verify the changes
Once the system is up, verify that all the instance numbers were changed as expected. It
may be necessary to re-import volume groups to ensure that /etc/lvmtab contains the
correct entries. The lan configuration may need to be changed also.
Procedure II
Reliable, requires two reboots and works without additional tools.
1) Extract a configuration template from the current ioscan output
# ioscan -f | grep -e INTERFACE -e DEVICE | \
grep -v target | \
awk '{print $3, $1, $2}' > /infile
2) Edit /infile and change the ext_bus and lan instances as desired
No class is allowed to get more than one line for the same instance!
[ 本帖最后由 hp-ux民工 于 2008-12-27 21:19 编辑 ] |
|