Featured post

Quiz: Data PreProcessing

Thursday, 8 December 2016

AIX: Issue with Alt_Clone

Alt_Clone:


#alt_disk_copy -d ${HDISK_SEC} -n -Bg

Issues with Alt_Clone:


1>
# lspv
hdisk0          00cd1fc690ce7e75                    rootvg          active     
hdisk1          00cd1fc67b2700ca                    rootvg          active     
# bootlist -m normal -o
hdisk0 blv=hd5 pathid=0
hdisk1 pathid=0

# unmirrorvg rootvg hdisk1
0516-1804 chvg: The quorum change takes effect immediately.
0516-1144 unmirrorvg: rootvg successfully unmirrored, user should perform
        bosboot of system to reinitialize boot records.  Then, user must modify
        bootlist to just include:  hdisk0.

# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            558         486         111..105..47..111..112
hdisk1            active            558         558         112..112..111..111..112
# reducevg rootvg hdisk1

2> Dump device exist on hdisk1 ( clone disk) so error was coming while detaching from rootvg
# lspv
hdisk0          00c32b77e0f7031a                    rootvg          active     
hdisk1          00c32b77e14534ec                    rootvg          active     
# bootlist -m normal -o
hdisk0 blv=hd5 pathid=0
hdisk1 blv=hd5 pathid=0
# unmirrorvg rootvg hdisk1
0516-1246 rmlvcopy: If hd5 is the boot logical volume, please run 'chpv -c <diskname>'
        as root user to clear the boot record and avoid a potential boot
        off an old boot image that may reside on the disk from which this
        logical volume is moved/removed.
0516-1804 chvg: The quorum change takes effect immediately.
0516-1144 unmirrorvg: rootvg successfully unmirrored, user should perform
        bosboot of system to reinitialize boot records.  Then, user must modify
        bootlist to just include:  hdisk0.
# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk1            active            558         556         112..110..111..111..112
hdisk0            active            558         499         111..108..57..111..112
# lspv -l hdisk0
hdisk0:
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
hd10opt               5       5       00..00..05..00..00    /opt
hd11admin             1       1       00..00..01..00..00    /admin
livedump              1       1       00..01..00..00..00    /var/adm/ras/livedump
lg_dumplv2            2       2       00..02..00..00..00    N/A
hd5                   1       1       01..00..00..00..00    N/A
hd4                   1       1       00..00..01..00..00    /
hd8                   1       1       00..00..01..00..00    N/A
paging00              2       2       00..00..02..00..00    N/A
hd6                   1       1       00..01..00..00..00    N/A
hd1                   20      20      00..00..20..00..00    /home
hd3                   10      10      00..00..10..00..00    /tmp
hd9var                2       2       00..00..02..00..00    /var
hd2                   12      12      00..00..12..00..00    /usr
# lspv -l hdisk1
hdisk1:
LV NAME               LPs     PPs     DISTRIBUTION          MOUNT POINT
lg_dumplv             2       2       00..02..00..00..00    N/A
# sysdumpdev -l
primary              /dev/lg_dumplv
secondary            /dev/lg_dumplv2
copy directory       /var/adm/ras
forced copy flag     TRUE
always allow dump    FALSE
dump compression     ON
type of dump         traditional

Set The primary dumpdevice to something else to free up hdisk1
# sysdumpdev -p /dev/sysdumpnull
primary              /dev/sysdumpnull
secondary            /dev/lg_dumplv2
copy directory       /var/adm/ras
forced copy flag     TRUE
always allow dump    FALSE
dump compression     ON
type of dump         traditional
# rmlv lg_dumplv
Warning, all data contained on logical volume lg_dumplv will be destroyed.
rmlv: Do you wish to continue? y(es) n(o)? y
rmlv: Logical volume lg_dumplv is removed.
# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk1            active            558         558         112..112..111..111..112
hdisk0            active            558         499         111..108..57..111..112

Now rootvg can be reduced as hdisk is free

# reducevg rootvg hdisk1

Tuesday, 6 December 2016

Solaris: To find the Page 83 Ids for SAN LUN on Soalris LDOMs hosted on Utility Platform

To find the Page 83 Ids for SAN LUN on Soalris LDOMs hosted on Utility Platform


Solaris 11
use the inbuilt devprop command.
Eg:
# /usr/sbin/devprop -v -n /dev/rdsk/c0d1s2 devid
devid=id1,vdc@n600523487680c8000c452343000000000b29

Solaris 10
devprop doesn’t exist on Solaris 10, so use prtconf instead. Below command will give you the page83 ID and “c0dX” number for every LUN on the host.
Eg:
# prtconf -vD | egrep '(vdc@|/dev/rdsk/c.*d.*s0)' | sed 's/s0$//g'
                        value='id1,vdc@n600009700002923487221498762340'
                            dev_link=/dev/rdsk/c0d1

This method works for Solaris 11 as well if you just want a list of all Page83 ID and disk device.

XSCF : Cheat Sheet


XSCF>showlogs error
XSCF>showlogs event
XSCF>showlogs event -v
XSCF>showlogs error -v
XSCF>showlogs power
XSCF>showlogs env
XSCF>showlogs monitor

XSCF>showlogs -d <domain ID> console
XSCF>showlogs -d <domain ID> ipl
XSCF>showlogs -d <domain ID> panic

XSCF>showstatus
XSCF>showenvironment
XSCF>showhardconf
XSCF>showdomainstatus -a
XSCF>showboards -va
XSCF>showfru -a sb
XSCF>showdcl -va
XSCF>shownetwork -a
XSCF>showroute -a
XSCF>showdscp -v
XSCF>showhostname -a

XSCF>fmadm faulty -a
XSCF>fmdump -V
XSCF>fmdump -e 

Monday, 5 December 2016

AIX: How to Verify Whether a Disk Contains Data

How to Verify Whether a Disk Contains Data


You've just added one new disk to an AIX logical partition (LPAR), and you're trying to figure out why your new disk has a physical volume identifier (PVID). A PVID indicates that the disk might either be a replicated disk, a disk from an exported volume group, or a new empty disk with a PVID that wasn't cleared previously. If the disk is either of the first two types, it could have real data on it that you don't want to overwrite.

# lspv
hdisk1          none                                None                       
hdisk2          none                                None                       
hdisk45         00c32b7788951e30                    rootvg          active     
hdisk4          none                                None                       
hdisk5          none                                None                       
hdisk42         00c32b7788951e30                    rootvg          active     
hdisk18         00c32b7788951e30                    rootvg          active     
hdisk31         none                                None                       
hdisk32         none                                None                       
hdisk15         00c32b7788951e30                    rootvg          active     

1>    Run readvgda, The command output—specifically the readvgda_type value of : vg_type —suggests that hdisk15 belongs to a volume group.

 # readvgda -p hdisk15
.....   
.....    Thu Mar 20 17:31:34 EST:2014
.....    readvgda -p hdisk15
.....    readvgda_file: /dev/rhdisk15
.....    readvgda_type: vg_type: 0
.....    readvgda_ver:  3
.....   

============= B: LVM REC 0x7 (0xe00) =============
lvm_id:         _LVM
vgid:           00c32b7700004c000000013ef281e742
pv_num:         1
version:        34
pp_size:        27
ltg_shift:      0
lvmarea_len:    00001074 (0020e800)
vgsa_psn[0]:    00000080 (00010000)     vgsa_len:       00000008 (00001000)
vgda_psn[0]:    00000088 (00011000)     vgda_len:       00000832 (00106400)
vgsa_psn[1]:    000008ba (00117400)     vgsa_len:       00000008 (00001000)
vgda_psn[1]:    000008c2 (00118400)     vgda_len:       00000832 (00106400)
reloc_psn:      077ffeff (fffdfe00)     reloc_len:      00000100 (00020000)
============= E: LVM REC =============
*********************************************************************

Or U ca n run lqueryvg command

*********************************************************************

# lqueryvg -Atp hdisk15
Max LVs:        256
PP Size:        27
Free PPs:       31
LV count:       23
PV count:       1
Total VGDAs:    2
Conc Allowed:   0
MAX PPs per PV: 1016
MAX PVs:        32
Quorum (disk):  1
Quorum (dd):    1
Auto Varyon ?:  1
Conc Autovaryon 0
Varied on Conc: 0
Logical:        00c32b7700004c000000013ef281e742.1   bos_hd5 1 
                00c32b7700004c000000013ef281e742.2   hd6 1 
                00c32b7700004c000000013ef281e742.3   hd8 1 
                00c32b7700004c000000013ef281e742.4   bos_hd4 1 
                00c32b7700004c000000013ef281e742.5   bos_hd2 1 
                00c32b7700004c000000013ef281e742.6   bos_hd9var 1 
                00c32b7700004c000000013ef281e742.7   hd3 1 
                00c32b7700004c000000013ef281e742.8   hd1 1 
                00c32b7700004c000000013ef281e742.9   bos_hd10opt 1 
                00c32b7700004c000000013ef281e742.10  hd11admin 1 
                00c32b7700004c000000013ef281e742.11  livedump 1 
                00c32b7700004c000000013ef281e742.12  hd12audit 1 
                00c32b7700004c000000013ef281e742.13  lg_dumplv 1 
                00c32b7700004c000000013ef281e742.14  osysadm 1 
                00c32b7700004c000000013ef281e742.15  voperf 1 
                00c32b7700004c000000013ef281e742.16  actmagent 1 
                00c32b7700004c000000013ef281e742.17  dump00 1 
                00c32b7700004c000000013ef281e742.18  nmon 1 
                00c32b7700004c000000013ef281e742.19  hd5 1 
                00c32b7700004c000000013ef281e742.20  hd4 1 
                00c32b7700004c000000013ef281e742.21  hd2 1 
                00c32b7700004c000000013ef281e742.22  hd9var 1 
                00c32b7700004c000000013ef281e742.23  hd10opt 1 
Physical:       00c32b7788951e30                2   0 
Total PPs:      479
LTG size:       128
HOT SPARE:      0
AUTO SYNC:      0
VG PERMISSION:  0
SNAPSHOT VG:    0
IS_PRIMARY VG:  0
PSNFSTPP:       4352
VARYON MODE:    0
VG Type:        0
Max PPs:        32512
Mirror Pool Str n
Sys Mgt Mode:   0
VG Reserved:    1
PV RESTRICTION: 0
Infinite Retry: 2
Varyon State:   0
Disk Block Size 512

2> The command output below suggests that hdisk31 doesn't belong to any volume group and is the empty disk that I configured earlier using cfgmgr.

# readvgda -p hdisk31
Invalid lvm_rec!
00000E00   00000000 00000000 00000000 00000000  |................|
00000E10   00000000 00000000 00000000 00000000  |................|
00000E20   00000000 00000000 00000000 00000000  |................|
00000E30   00000000 00000000 00000000 00000000  |................|
00000E40   00000000 00000000 00000000 00000000  |................|
00000E50   00000000 00000000 00000000 00000000  |................|
00000E60   00000000 00000000 00000000 00000000  |................|
00000E70   00000000 00000000 00000000 00000000  |................|
00000E80   00000000 00000000 00000000 00000000  |................|
00000E90   00000000 00000000 00000000 00000000  |................|
00000EA0   00000000 00000000 00000000 00000000  |................|
00000EB0   00000000 00000000 00000000 00000000  |................|
00000EC0   00000000 00000000 00000000 00000000  |................|
00000ED0   00000000 00000000 00000000 00000000  |................|
00000EE0   00000000 00000000 00000000 00000000  |................|
00000EF0   00000000 00000000 00000000 00000000  |................|
read_lvm_rec had an error, exiting
************************************************************

Or u can run lqueryvg command


************************************************************
# lqueryvg -Atp hdisk31
0516-1396 lqueryvg: The physical volume hdisk31, was not found in the
system database.
0516-066 lqueryvg: Physical volume is not a volume group member.
        Check the physical volume name specified.
************************************************************

Or to use lspv command with the -l option to list the physical volume hdisk1. The output shows the names of all the logical volumes on the physical volume, the number of physical and logical partitions allocated, the distribution across the physical volume, and the mount point if one exists.

*************************************************************

# lspv -l hdisk31
0516-304 : Unable to find device id 00000000000000000000000000000000 in the Device Configuration Database.

AIX : How To Extend File System

How To Extend File System:


1> Suppose we want to increase below file system

# df -k /export/nim/mksysb
Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
/dev/mksysb6051   138412032  22990208   84%       47     1% /export/nim/mksysb

2> Check to which VG this LV belong

# lslv mksysb6051
LOGICAL VOLUME:     mksysb6051             VOLUME GROUP:   nim6051T2C
LV IDENTIFIER:      00c32b7700004c000000013b97085b50.3 PERMISSION:     read/write
VG STATE:           active/complete        LV STATE:       opened/syncd
TYPE:               jfs2                   WRITE VERIFY:   off
MAX LPs:            1024                   PP SIZE:        256 megabyte(s)
COPIES:             1                      SCHED POLICY:   parallel
LPs:                528                    PPs:            528
STALE PPs:          0                      BB POLICY:      relocatable
INTER-POLICY:       minimum                RELOCATABLE:    yes
INTRA-POLICY:       middle                 UPPER BOUND:    1024
MOUNT POINT:        /export/nim/mksysb     LABEL:          /export/nim/mksysb
DEVICE UID:         0                      DEVICE GID:     0
DEVICE PERMISSIONS: 432                                   
MIRROR WRITE CONSISTENCY: on/ACTIVE                             
EACH LP COPY ON A SEPARATE PV ?: yes                                    
Serialize IO ?:     NO                                    
INFINITE RETRY:     no                                    
DEVICESUBTYPE:      DS_LVZ                                       
COPY 1 MIRROR POOL: None                                  
COPY 2 MIRROR POOL: None                                  
COPY 3 MIRROR POOL: None                                  

3> Check if physical volume have the free space. Here highlighted field shows only 2560 M is free.

# lsvg nim6051T2C
VOLUME GROUP:       nim6051T2C               VG IDENTIFIER:  00c32b7700004c000000013b97085b50
VG STATE:           active                   PP SIZE:        256 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      1599 (409344 megabytes)
MAX LVs:            256                      FREE PPs:       10 (2560 megabytes)
LVs:                7                        USED PPs:       1589 (406784 megabytes)
OPEN LVs:           7                        QUORUM:         2 (Enabled)
TOTAL PVs:          1                        VG DESCRIPTORS: 2
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         1                        AUTO ON:        yes
MAX PPs per VG:     32768                    MAX PVs:        1024
LTG size (Dynamic): 1024 kilobyte(s)         AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable
MIRROR POOL STRICT: off                                      
PV RESTRICTION:     none                     INFINITE RETRY: no
DISK BLOCK SIZE:    512                               

4> To increase the file system by 2000MB

   #chfs -a size=+2G /export/nim/mksysb
   #chfs -a size=+2000M /export/nim/mksysb


   Without “+” sign it will make the file system size as mentioned. With “+” sign it basically increase it by mentioned size.

AIX: Difference Between HDisk and Hdiskpower:

Difference Between HDisk and Hdiskpower:

All the physical partitions in a volume group are the same size, although different volume groups can have different PP sizes.

The hdiskpower devices are logical pointers to hdisks. Hdiskpower are EMC devices created by EMC software in order provide load balancing and fault tolerance, so and hdiskpower device is one, two, four hdisks depending on how many paths (FC Cards) to the EMC controller (switch) your server has.

# lspv
hdisk0          00c32b87a77983ca                    rootvg          active     
hdisk1          00cd1fc6f1839e04                    rootvg          active     
hdisk2          none                                None                       
hdisk3          00c32b87a77983ca                    rootvg          active     
hdisk4          00cd1fc6f1839e04                    rootvg          active     
hdisk5          none                                None                       
hdisk6          00c32b87a77983ca                    rootvg          active     
hdisk7          00cd1fc6f1839e04                    rootvg          active     
hdisk8          none                                None                       
hdisk9          00c32b87a77983ca                    rootvg          active     
hdisk10         00cd1fc6f1839e04                    rootvg          active     
hdisk11         none                                None                       
hdiskpower0     none                                None                        
hdiskpower1     none                                None                       
hdiskpower2     00c32b87ad9198ad                    auq4073lT2P     active    

# powermt display
Symmetrix logical device count=3
CLARiiON logical device count=0
Hitachi logical device count=0
HP xp logical device count=0
Ess logical device count=0
Invista logical device count=0
==============================================================================
----- Host Bus Adapters ---------  ------ I/O Paths -----  ------ Stats ------
###  HW Path                       Summary   Total   Dead  IO/Sec Q-IOs Errors
==============================================================================
   0 fscsi0                        optimal       3      0       -     0      0
   1 fscsi1                        optimal       3      0       -     0      0
   2 fscsi2                        optimal       3      0       -     0      0
   3 fscsi3                        optimal       3      0       -     0      0

It says 3 logical device, which can be seen in lspv command (hdiskpower0/1/2).
Below will show you which hdisks belong to which hdiskpower and the current path status.

# powermt display dev=all
Pseudo name=hdiskpower0
Symmetrix ID=000492600083
Logical device ID=4EE0
state=alive; policy=SymmOpt; priority=0; queued-IOs=0;
==============================================================================
--------------- Host ---------------   - Stor -   -- I/O Path --  -- Stats ---
###  HW Path               I/O Paths    Interf.   Mode    State   Q-IOs Errors
==============================================================================
   0 fscsi0                   hdisk0    FA  7eB   active  alive       0      0
   1 fscsi1                   hdisk3    FA  8eB   active  alive       0      0
   2 fscsi2                   hdisk6    FA  9eB   active  alive       0      0
   3 fscsi3                   hdisk9    FA 10eB   active  alive       0      0

Pseudo name=hdiskpower1
Symmetrix ID=000492600083
Logical device ID=4EE4
state=alive; policy=SymmOpt; priority=0; queued-IOs=0;
==============================================================================
--------------- Host ---------------   - Stor -   -- I/O Path --  -- Stats ---
###  HW Path               I/O Paths    Interf.   Mode    State   Q-IOs Errors
==============================================================================
   3 fscsi3                   hdisk10   FA 10eB   active  alive       0      0
   0 fscsi0                   hdisk1    FA  7eB   active  alive       0      0
   1 fscsi1                   hdisk4    FA  8eB   active  alive       0      0
   2 fscsi2                   hdisk7    FA  9eB   active  alive       0      0

Pseudo name=hdiskpower2
Symmetrix ID=000492600083
Logical device ID=4EE8
state=alive; policy=SymmOpt; priority=0; queued-IOs=0;
==============================================================================
--------------- Host ---------------   - Stor -   -- I/O Path --  -- Stats ---
###  HW Path               I/O Paths    Interf.   Mode    State   Q-IOs Errors
==============================================================================
   3 fscsi3                   hdisk11   FA 10eB   active  alive       0      0
   0 fscsi0                   hdisk2    FA  7eB   active  alive       0      0
   1 fscsi1                   hdisk5    FA  8eB   active  alive       0      0
   2 fscsi2                   hdisk8    FA  9eB   active  alive       0      0

# lsdev -Cc disk
hdisk0      Available 41-T1-01 EMC Symmetrix FCP VRAID
hdisk1      Available 41-T1-01 EMC Symmetrix FCP VRAID
hdisk2      Available 41-T1-01 EMC Symmetrix FCP VRAID
hdisk3      Available 42-T1-01 EMC Symmetrix FCP VRAID
hdisk4      Available 42-T1-01 EMC Symmetrix FCP VRAID
hdisk5      Available 42-T1-01 EMC Symmetrix FCP VRAID
hdisk6      Available 61-T1-01 EMC Symmetrix FCP VRAID
hdisk7      Available 61-T1-01 EMC Symmetrix FCP VRAID
hdisk8      Available 61-T1-01 EMC Symmetrix FCP VRAID
hdisk9      Available 62-T1-01 EMC Symmetrix FCP VRAID
hdisk10     Available 62-T1-01 EMC Symmetrix FCP VRAID
hdisk11     Available 62-T1-01 EMC Symmetrix FCP VRAID
hdiskpower0 Available 62-T1-01 PowerPath Device
hdiskpower1 Available 62-T1-01 PowerPath Device
hdiskpower2 Available 62-T1-01 PowerPath Device


$ lspv -M hdisk2
0516-1396 : The physical volume hdisk2, was not found in the
system database.

lspv Command

Purpose

       Displays information about a physical volume within a volume group.

Lists the following fields for each logical volume on the physical volume:

            PVname:PPnum [LVname: LPnum [:Copynum] [PPstate]]


$ lspv -M hdisk0
hdisk0:1        hd5:1  
hdisk0:2        hd5:2  
hdisk0:3        hd5:3  
hdisk0:4        hd5:4  
hdisk0:5        bos_hd5:1      
hdisk0:6        bos_hd5:2      
hdisk0:7        bos_hd5:3      
hdisk0:8        bos_hd5:4      
hdisk0:9-23
hdisk0:24       dump00:15      
hdisk0:25       dump00:16      
hdisk0:26       dump00:17      
hdisk0:27       aconnect:1     
hdisk0:28       aconnect:2     
hdisk0:29       aconnect:3     
hdisk0:30       aconnect:4     
hdisk0:31       aconnect:5     
hdisk0:32       aconnect:6     
hdisk0:33       aconnect:7     
hdisk0:34       aconnect:8      
hdisk0:35       dump00:1       

$ lsvg
rootvg
auq4073lT2P

$ lsvg -m rootvg
Logical Volume    Copy 1            Copy 2            Copy 3           
hd5               None              None              None              
hd6               None              None              None             
hd8               None              None              None             
hd4               None              None              None             
hd2               None              None              None             
hd9var            None              None              None             
hd3               None              None              None             
hd1               None              None              None              
hd10opt           None              None              None             
hd11admin         None              None              None             
livedump          None              None              None             
hd12audit         None              None              None             
bos_hd5           None              None              None             
osysadm           None              None              None             
voperf            None              None              None              
actmagent         None              None              None             
dump00            None              None              None             
aconnect          None              None              None             
bos_hd4           None              None              None             
bos_hd2           None              None              None             
bos_hd9var        None              None              None             
bos_hd10opt       None              None              None              

$ lsvg -m auq4073lT2P
Logical Volume    Copy 1            Copy 2            Copy 3           
aihs              None              None              None             
aMDM              None              None              None             
apatrol           None              None              None             
aoraclient        None              None              None             
vMDM              None              None              None             
aWebSphere        None              None              None             
vWebSphere        None              None              None             
nmonperf          None              None              None     

$ lslv -m hd5
hd5:N/A
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0001 hdisk9           
0002  0002 hdisk9           
0003  0003 hdisk9           
0004  0004 hdisk9           
$ lslv -m voperf
voperf:/var/opt/perf
LP    PP1  PV1               PP2  PV2               PP3  PV3
0001  0052 hdisk9           
0002  0049 hdisk9           
0003  0050 hdisk9           
0004  0051 hdisk9