Category: AIX

Resetting an LPAR on a Power4 system

First you need to check some information for your system on the HMC. Issue the command vtmenu to get the managed system ID and the names of the partitions

hscroot@localhost:~> vtmenu

Retrieving name of managed system(s) . . . 108F19C

———————————————————-
Partitions On Managed System: 108F19C
———————————————————-
1) MANUFACTURING Running:
2) RETAIL Running:

Enter Number of Running Partition (q to quit): q

Bye.

On this example I tried to soft reset the partition called MANUFACTURING

hscroot@localhost:~> chsysstate -m 108F19C -r lpar -n MANUFACTURING -o reset

Since it didn’t work out as expected, I decided to power off the LPAR

hscroot@localhost:~> chsysstate -m 108F19C -r lpar -n MANUFACTURING -o off

hscroot@localhost:~> vtmenu

Retrieving name of managed system(s) . . . 108F19C

———————————————————-
Partitions On Managed System: 108F19C
———————————————————-
1) MANUFACTURING Ready:
2) RETAIL Running:

Enter Number of Running Partition (q to quit): q

Bye.

I turned the partition on and after that it worked flawlessly

hscroot@localhost:~> chsysstate -r lpar -m 108F19C -o on -n MANUFACTURING

hscroot@localhost:~> vtmenu

Retrieving name of managed system(s) . . . 108F19C

———————————————————-
Partitions On Managed System: 108F19C
———————————————————-
1) MANUFACTURING Starting:
2) RETAIL Running:

Enter Number of Running Partition (q to quit): q

Bye.

Check if an account is locked on AIX and when was the last time an user logged in

To check account properties you use the command lsuser and specify what property you want to see.

Checking if an account is locked

root@aix:/ # lsuser -a account_locked emerson
emerson account_locked=false

To calculate when was the last time an user logged in to the server, you will need to convert the time displayed. Use the command below to convert.

root@aix:/ # lsuser -a time_last_login emerson
emerson time_last_login=1279036180

root@aix:/ # perl -we ‘print(my $time = localtime 1279036180, “\n”)’
Tue Jul 13 10:49:40 2010

Checking Disk Array status in AIX

This AIX server has a disk array connected.

root@aix:/ # lscfg -vl hdisk2
hdisk2           U0.1-P2-I3/Z3-A0  SCSI RAID 5 Disk Array

The array has 7 physical disks
root@aix:/ # lsdev -C | grep pdisk

pdisk0         Available 1A-08-01-0,0  Physical SCSI Disk Drive
pdisk1         Available 1A-08-01-1,0  Physical SCSI Disk Drive
pdisk2         Available 1A-08-01-2,0  Physical SCSI Disk Drive
pdisk3         Available 1A-08-01-3,0  Physical SCSI Disk Drive
pdisk4         Available 1A-08-01-4,0  Physical SCSI Disk Drive
pdisk5         Available 1A-08-01-5,0  Physical SCSI Disk Drive
pdisk6         Available 1A-08-01-6,0  Physical SCSI Disk Drive

Connected through a PCI-X SCSI RAID adapter
root@aix:/ # lscfg -vl sisioa0

sisioa0          U0.1-P2-I3  PCI-X Dual Channel U320 SCSI RAID Adapter
PCI-X Dual Channel Ultra320 SCSI RAID Adapter:
Part Number……………..97P3960
FRU Number………………97P3960
Serial Number……………YL10C4077074
Manufacture ID…………..000C
EC Level………………..0
ROM Level.(alterable)…….0709000c
Product Specific.(Z0)…….5703
Product Specific.(Z1)…….1
Device Specific.(YL)……..U0.1-P2-I3

When we checked the status we saw that the array was running in degraded state.
root@aix:/ #sisraidmgr -L -j1 -l sisioa0

————————————————————————
Name      Location      State       Description        Size
————————————————————————
sisioa0   1A-08         Available   PCI-X Dual Channel U320 SCSI RAID Adapter
scsi2    1A-08-00-07,0 NoLink      No remote adapter target
scsi3    1A-08-01-07,0 NoLink      No remote adapter target
hdisk2    1A-08-ff-0,0  Degraded RAID 5 Array     428.0GB
pdisk0   1A-08-01-0,0  Active      Array Member      71.4GB
pdisk1   1A-08-01-1,0  Active      Array Member      71.4GB
pdisk2   1A-08-01-2,0  Active      Array Member      71.4GB
pdisk3   1A-08-01-3,0  Active      Array Member      71.4GB
pdisk4   1A-08-01-4,0  Active      Array Member      71.4GB
pdisk5   1A-08-01-5,0  Active      Array Member      71.4GB
pdisk6   1A-08-01-6,0  Active      Array Member      71.4GB
hdisk0    1A-08-00-10,0 Available   16 Bit LVD SCSI  146.8GB
hdisk1    1A-08-00-11,0 Available   16 Bit LVD SCSI  146.8GB

AIX – Some tape commands

Getting information about the tape drive.

root@aix:/ # lscfg -vpl rmt0
rmt0             U787E.001.AAA2714-P2-C1-T2-L0-L0  4.0 GB 4mm Tape Drive
Manufacturer…………….ARCHIVE
Machine Type and Model……IBM4326NP/RP  !D
Device Specific.(Z1)……..5ALG
Serial Number……………DR0N6QG 0011
Load ID…………………0011
Part Number……………..21H5154
FRU Number………………59H3481
EC Level………………..E30312
Device Specific.(Z0)……..0180020283000018
Device Specific.(Z3)……..L1
PLATFORM SPECIFIC
Name:  st
Device Type:  byte

Getting information about the tape. It is using compression and a variable length block size.

root@aix:/ # tctl -f /dev/rmt0 status
rmt0 Available 06-08-01-0,0 4.0 GB 4mm Tape Drive
ttribute  value description                          user_settable
block_size 0     BLOCK size (0=variable length)       True
compress   yes   Use data COMPRESSION                 True
mode       yes   Use DEVICE BUFFERS during writes     True
ret_error  no    RETURN error on tape change or reset True

Rewinding tape drive

root@aix:/ # tctl -f /dev/rmt0 rewind

Reading tape and redirecting output to a file. In this case, the operating system showed that the tape itself is damaged.

root@aix:/ # tctl -f /dev/rmt0 read > /tmp/testtape
tctl: 0511-578 Cannot read 512 bytes: The media surface is damaged.

Couldn’t mount AIX file system. First information says that media is not formatted

I had a problem mounting a file system after the server rebooted. At first it reported that the logical volume wasn’t formatted or the format is incorrect. Then it asked to run fsck.

root@aix5:/ # mount /fallback
Replaying log for /dev/fallback.
mount: 0506-324 Cannot mount /dev/fallback on /fallback: The media is not formatted or the format is not correct.
0506-342 The superblock on /dev/fallback is dirty.  Run a full fsck to fix.

I just ran fsck on the logical volume and then mounted the file system.

root@aix5:/ # fsck /dev/fallback

****************
The current volume is: /dev/fallback
**Phase 1 – Check Blocks, Files/Directories, and Directory Entries
**Phase 2 – Count links
**Phase 3 – Duplicate Block Rescan and Directory Connectedness
**Phase 4 – Report Problems
**Phase 5 – Check Connectivity
**Phase 7 – Verify File/Directory Allocation Maps
**Phase 8 – Verify Disk Allocation Maps
15728640 kilobytes total disk space.
63 kilobytes in 30 directories.
7664455 kilobytes in 438 user files.
8061172 kilobytes are available for use.
File system is clean.
Superblock is marked dirty; FIX? y
All observed inconsistencies have been repaired.

root@aix5:/ # mount /fallback

root@aix5:/ # df -g /fallback
Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/fallback      15.00      7.69   49%      470     1% /fallback

Removing a Logical Volume in AIX

To remove a logical volume, use rmlv. The -f switch is to remove without user confirmation.

Usage: rmlv [ -B ] [ -f ]  [ -p Physical Volume ]  LogicalVolume …
Removes a logical volume.

root@aix:/ # /usr/sbin/rmlv -f rawdevice19
rmlv: Logical volume rawdevice19 is removed.

AIX Volume Group can’t properly display the Logical Volume Type

Listing the logical volumes inside the volume group. AIX can’t determine the LV type.

root@aix:/ # lsvg -l oravg
oravg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
oravg_lg            ??? 1     1     1    closed/syncd  N/A
ora_lv              ??? 1064  1064  2    closed/syncd  N/A

To solve this problem we’ll export then reimport the VG. But first we’ll need to deactivate it.

root@aix:/ # varyoffvg oravg

And we need at least one disk that is part of the volume group because it has the information needed to import.

root@aix:/ # lspv | grep oravg
hdisk251
00c5f1d097cc8a6e                   oravg
hdisk221
00c5f1d0a7bffede                    oravg

Now we run exportvg and the server will no longer know it once had the volume group.

root@aix:/ # exportvg oravg

Let’s list all the volume groups the server is aware that exists.

root@aix:/ # lsvg
rootvg
datavg
cache01vg
cache02vg

Only the rootvg is currently imported and active.

root@aix:/ # lsvg -o
rootvg

Let’s reimport the volume group. We need to declare one of the disks we listed before to reimport the volume group.

root@aix:/ # importvg -y oravg hdisk251
oravg

Next, we activate the volume group

root@aix:/ # varyonvg oravg

Listing the Volume Group. Volume Group TYPE listed.

root@aix:/ # lsvg -l oravg
oravg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
oravg_lg            jfs2log    1     1     1    closed/syncd  N/A
ora_lv              jfs2       1064  1064  2    closed/syncd  /u01

Download IBM WebSM for HMC v6

To download the Web Based System Manager client you simply open a browser window and type the URL http://<ip address of your HMC>/remote_client.html.

To check the version of your HMC, type lshmc -V

hscroot@localhost:~> lshmc -V
“version= Version: 6
Release: 1.2
HMC Build level 20070201.1
MH00985: Miscellaneous fixes for HMC V6 (04-15-2007)
“,”base_version=V6.1.2

The Hardware Management Console v7 has web access, so you don’t need to install a client to use it.

Getting console access using IBM HMC v6 Command Line

To get a console access through a remote connection, first ssh to the HMC

emerson@shellcore:~ $ ssh hscroot@hmc6
password:

Then type vtmenu. It will retrieve all the physical servers connected and that can be managed by the HMC.

hscroot@localhost:~> vtmenu

Retrieving name of managed system(s) . . . Server-9117-570-SN103CBBB 2-Server-9117-570-SN103CABB Server-9117-570-SN069D5BF Server-9119-595-SN8211572

———————————————————-
Managed Systems:
———————————————————-
1) Server-9117-570-SN103CBBB
2) 2-Server-9117-570-SN103CABB
3) Server-9117-570-SN069D5BF
4) Server-9119-595-SN8211572

Enter Number of Managed System. (q to quit): 1

You choose one of the managed servers and then it will show all LPARs available on that physical server.

———————————————————-
Partitions On Managed System:  Server-9117-570-SN103CBBB
OS/400 Partitions not listed
———————————————————-
1)    LPAR1                                   Running
2)    LPAR2                                   Running
3)    LPAR3                                   Running

After you selected which LPAR you will control, you will be shown the login screen
Open in progress..

Open Completed.

AIX Version 5
Copyright IBM Corporation, 1982, 2008.
Console login:

To exit you type tilde, space, tilde, space, dot.

~ ~ .

AIX Error Code 0503-003 geninstall: The specified device is not a valid device or file.

I had the following error when trying to upgrade AIX Maintenance Level: 0503-003 geninstall:  The specified device /tmp/patches is not a valid device or file.

What happened is that my .toc file was empty and I needed to recreate it using inutoc /tmp/patches. After that the upgrade went smoothly.

root@aix53:/ # instfix -i | grep ML
All filesets for 5.3.0.0_AIX_ML were found.
All filesets for 5300-01_AIX_ML were found.
All filesets for 5300-02_AIX_ML were found.
All filesets for 5300-03_AIX_ML were found.
All filesets for 5300-04_AIX_ML were found.
All filesets for 5300-05_AIX_ML were found.
All filesets for 5300-06_AIX_ML were found.
All filesets for 5300-07_AIX_ML were found.
All filesets for 5300-08_AIX_ML were found.
All filesets for 5300-09_AIX_ML were found.