Monday, August 18, 2008

How to remove a dynamically allocated i/o slot in a DLPAR in IBM AIX

To remove a dynamically allocated I/O slot (must be a desired component) from a partition on a P-series IBM server partition:

1) Find the slot you wish to remove from the partition:

# lsslot -c slot
# Slot Description Device(s)
U1.5-P2/Z2 Logical I/O Slot pci15 scsi2
U1.9-P1-I8 Logical I/O Slot pci13 ent0
U1.9-P1-I10 Logical I/O Slot pci14 scsi0 scsi1

In our case, it is pci14.

2) Delete the PCI adapter and all of its children in AIX before removal:

# rmdev -l pci14 -d -R
cd0 deleted
rmt0 deleted
scsi0 deleted
scsi1 deleted
pci14 deleted

3) Now, you can remove the PCI I/O slot device using the HMC:

a) Log in to the HMC

b) Select "Server and Partition", and then "Server Management"

c) Select the appropriate server and then the appropriate partition

d) Right click on the partition name, and then on "Dynamic Logical Partitioning"

e) In the menu, select "Adapters"

f) In the newly created popup, select the task "Remove resource from this partition"

g) Select the appropriate adapter from the list (only desired one will appear)

h) Select the "OK" button

i) You should have a popup window which tells you if it was successful.

Example:


lsslot -c slot; rmdev -l pci14 -d -R

How to recover a failed MPIO paths from an IBM VIO server on an AIX LPAR

If you have set up disks from 2 VIO servers using MPIO to an AIX LPAR, then you need to make some changes to your hdisks.

You must make sure the hcheck_interval and hcheck_mode are set correctly:

Example for default hdisk0 settings:

# lsattr -El hdisk0
PCM PCM/friend/vscsi Path Control Module False
algorithm fail_over Algorithm True
hcheck_cmd test_unit_rdy Health Check Command True
hcheck_interval 0 Health Check Interval True
hcheck_mode nonactive Health Check Mode True
max_transfer 0x40000 Maximum TRANSFER Size True
pvid 00cd1e7cb226343b0000000000000000 Physical volume identifier False
queue_depth 3 Queue DEPTH True
reserve_policy no_reserve Reserve Policy True


IBM recommends a value of 60 for check_interval and hcheck_mode should be set to "nonactive".

To change these values (if necessary):

# chdev -l hdisk0 -a hcheck_interval=60 -P

# chdev -l hdisk0 -a hcheck_mode=nonactive -P

Now, you would need to reboot for automatic path recovery to take effect.

If you did not set the check_interval and hcheck_mode as described above or did not reboot, then after a failed path, you would see the following even after the path is back online:

# lspath
Enabled hdisk0 vscsi0
Failed hdisk0 vscsi1


To fix this, you would need to execute the following commands:

# chpath -l hdisk0 -p vscsi1 -s disable

# chpath -l hdisk0 -p vscsi1 -s enable

Now, check the status again:

# lspath
Enabled hdisk0 vscsi0
Enabled hdisk0 vscsi1
Example:

chpath -l hdisk0 -p vscsi1 -s disable; chpath -l hdisk0 -p vscsi1 -s enable

How to mount an ISO file as a filesystem in AIX

In AIX you "dd" the ISO file into a raw LV, then mount the LV as a filesystem.

Here are the steps for copying the ISO named "image.iso" into "/cd1iso", a JFS filesystem:

1. Create a filesystem with size slightly bigger than the size of the ISO image. Do NOT mount the filesystem:
# /usr/sbin/crfs -v jfs -g rootvg -a size=800M -m/cd1iso -Ano -pro -tno -a frag=4096 -a nbpi=4096 -a ag=8

2. Get the logical volume name associated with the new filesystem:
# lsfs | grep cd1iso (assume it is /dev/lv00)

3. dd the ISO image into rlv00 (raw lv00):
# dd if=image.iso of=/dev/rlv00 bs=10M

4. Alter /cd1iso stanza in /etc/filesystems => vfs=cdrfs and options=ro (read-only)

/cd1iso:
dev = /dev/cd1_lv
vfs = cdrfs
log = /dev/loglv00
mount = false
options = ro
account = false

5. Mount the file system :
# mount /cd1iso

6. When finished, remove the filesystem:
# rmfs /cd1iso

Example:

/usr/sbin/crfs -v jfs -g rootvg -a size=800M ...

How to mount a cd manually in AIX

To manually mount a cd in IBM AIX:

# mount -V cdrfs -o ro /dev/cd0 /cdrom

Example:


mount -V cdrfs -o ro /dev/cd0 /cdrom

How to find the world-wide name (WWN) of a fibre-channel card in IBM AIX

To find the world-wide name (WWN) or network address of a fibre-channel (FC) card in IBM AIX:

First find the name of your fibre-channel cards:

# lsdev -vp | grep fcs

Then get the WWN (for fcs0 in this example):

# lscfg -vp -l fcs0 | grep "Network Address"

Example:


lscfg -vp -l fcs0 | grep "Network Address"

How to find what level your IBM VIO Server is running at

To determine which level of Virtual I/O Server (VIOS) you're running:

1) Login in to the VIO partition using the user "padmin"

2) Issue the ioslevel command:

# ioslevel

Example:


# ioslevel

How to find the values for asynchronous i/o in IBM AIX

To find the values for asynchronous I/O in IBM AIX:

# lsattr -El aio0

Example:


lsattr -El aio0

How to find the number of asynchronous i/o servers running in IBM AIX

To find the number of asynchronous i/o servers running in IBM AIX:

To determine you how many Posix AIO Servers (aios) are currently running, as root:

# pstat -a | grep -c posix_aioserver

To determine you how many Legacy AIO Servers (aios) are currently running, as root:

# pstat -a | grep -c aioserver

Example:


pstat -a | grep -c aioserver

How to find the maximum supported logical track group (LTG) size of a disk in AIX

To find the maximum supported logical track group (LTG) size of a disk in IBM AIX, you can use the lquerypv command with the -M flag. The output gives the LTG size in KB.

# /usr/sbin/lquerypv -M hdisk#



Example:

/usr/sbin/lquerypv -M hdisk0