Showing posts with label AIX. Show all posts
Showing posts with label AIX. Show all posts

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

How to find all the rpm packages installed on a particular date

To find all the RPM packages which were installed on a particular date:

# rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME:date}\n" | grep my_date

Example:


rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME:date}\n" | grep "29 Sep 2006"

To find the install date and time of an RPM package:

# rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME:date}\n" | grep rpm_package_name

If you want the epoch time rather than human readable date:

# rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME}\n" | grep rpm_package_name

Example:

rpm -qa --queryformat "%{NAME}-%{VERSION}.%{RELEASE} (%{ARCH}) INSTALLED: %{INSTALLTIME:date}\n" | grep libaio

How to enable full core dumps in IBM AIX

To enable full core dumps in IBM AIX:

# chdev -l sys0 -a fullcore='true'

Example:

chdev -l sys0 -a fullcore='true'

How to extract an individual file from an AIX mksysb on tape

To extract an individual file from a mksysb on tape:

# restore -s4 -xqvf /dev/rmt0.1 /my/filename

Example:

restore -s4 -xqvf /dev/rmt0.1 ./etc/passwd

How to enable extended netstat statistics in IBM AIX

To enable extended netstat statistics in IBM AIX :

# /usr/sbin/no -o extendednetstats=1

To disable extended netstat statistics in IBM AIX (default in AIX):

# /usr/sbin/no -o extendednetstats=0

Note: you must reboot to take effect.

Example:


/usr/sbin/no -o extendednetstats=1

How to enable entended history in AIX 5.3

In AIX 5.3, you have the capability to have a time stamped history. To enable it, just set the following variable:

EXTENDED_HISTORY=ON

Example:


export EXTENDED_HISTORY=ON

how to enable automatic notification of hardware errors in IBM AIX 5L

AIX 5L can email you when it detects a hardware error. To configure email notification, use the "diag" command.

# diag
=> Task Selection
=> Automatic Error Log Analysis and Notification
=> Add to the error notification mailing list
Example:

diag

how to determine which MPIO path is associated to a vscsi adapter in AIX 5L

To determine which MPIO path is associated to a vscsi adapter in AIX 5L:

# lspath -F "name path_id parent connection status"

The output returns something similar to:

hdisk0 0 vscsi0 810000000000 Enabled
hdisk0 1 vscsi1 810000000000 Enabled
hdisk1 0 vscsi0 820000000000 Enabled
hdisk1 1 vscsi1 820000000000 Enabled

The first field is the hdisk.
The second field is the "Path" number (seen with 'lspath')
The third field is the parent (vscsi adapter)
The fourth field is the connection
The fifth field is the status (Enabled, Disabled, Missing, etc)

Example:


lspath -F "name path_id parent connection status"

how to determine which eFixes are installed on your VIO Server

To determine which emergency fixes are installed on your Virtual I/O Server (VIOS):

1) Login to the VIO server as the user padmin

2) Setup your environment by issuing:

$ oem_setup_env

3) List installed efixes by label:

# emgr -P

4) To remove a specific efix by label (IY71303 in my example):

# emgr -r -L IY71303

5) Go back to the padmin restricted shell

# exit

Example:


emgr -P

how to determine which application created the OS core file in AIX

To determine which application created the OS core file in AIX:

# /usr/sbin/lquerypv -h /path/to/core 6b0 64

The output of this command is neat, clean and easy to read. Here is an example:

# lquerypv -h core 6b0 64
000006B0 7FFFFFFF FFFFFFFF 7FFFFFFF FFFFFFFF |................|
000006C0 00000000 000007D0 7FFFFFFF FFFFFFFF |................|
000006D0 00120000 1312C9C0 00000000 00000017 |................|
000006E0 6E657473 63617065 5F616978 34000000 |netscape_aix4...|
000006F0 00000000 00000000 00000000 00000000 |................|
00000700 00000000 00000000 00000000 00000ADB |................|
00000710 00000000 000008BF 00000000 00000A1E |................|

The executable is located between the pipes on the right hand side of the output. In this case, the core was generated by Netscape.

Example:


/usr/sbin/lquerypv -h /tmp/core 6b0 64

how to disable a single path through one HBA to a disk in IBM AIX

This disables a single path through one HBA to a disk in IBM AIX. This instructs the system to start using an alternative path to the disk.

# chpath -l hdisk# -p fscsi# -s disable

Example:


chpath -l hdisk# -p fscsi# -s disable

how to detach a network device and update the ODM in IBM AIX

If "ifconfig" is used to detach a network device, the ODM is NOT updated and when the system is rebooted, the adapter will try and bring up its network interface because that is what the ODM instructs it to do.

To detach a network device and update the ODM, the following command needs to be used:

# chdev -l en0 -a state='detach'

This will detach the network device even across reboots.

Example:


chdev -l en0 -a state='detach'