Wednesday, November 2, 2011 0 comments

AIX LPAR: Replace failed mirror

## break the mirror (two ways to do this)
rmlvcopy 1
unmirrorvg

## remove the disk from the vg
reducevg
## remove the hdisk from ODM
rmdev -dl

## physically replace the disk
diag -> function select -> task selection -> hot plug task -> scsi and scsi raid hot plug manager -> replace/remove a device attached to an scsi hot swap enclosure device -> select disk and follow instructions

## configure new disk an check the new number (hopefully the same)
cfgmgr -v
lsdev -Cc

## add back to volume group
extendvg
## create mirror (two ways to do this)
mklvcopy 2
mirrorvg

## sync mirror
syncvg -l

## If this is the rootvg there are additonal steps to take
bosboot -ad /dev/
bootlist -m normal
bootlist -m normal -o
0 comments

AIX LPAR: Command

bootinfo -b --> to see main boot disk
botlist -m normal hdisk0 hdisk1 net --> to change boot sequence
lsdev -Cc disk --> list device that is used
mount --> to check for mountpoint
errpt -a --> to check error details
lssrc -a --> to list daemon
lssrc -g telnet --> to list telnet daemon
stopsrc -t telnet --> stop telnet daemon
0 comments

AIX LPAR: Increase or Decrease a file system JFS2

{root_lpar5} / # lspv doshvg
0516-306 : Unable to find  doshvg in the Device
        Configuration Database.
{root_lpar5} / # lsvg doshvg
VOLUME GROUP:       doshvg                   VG IDENTIFIER:  00fdc1c900004c0000000133646778de
VG STATE:           active                   PP SIZE:        4 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      1533 (6132 megabytes)
MAX LVs:            256                      FREE PPs:       1276 (5104 megabytes)
LVs:                2                        USED PPs:       257 (1028 megabytes)
OPEN LVs:           2                        QUORUM:         2 (Enabled)
TOTAL PVs:          3                        VG DESCRIPTORS: 3
STALE PVs:          0                        STALE PPs:      0
ACTIVE PVs:         3                        AUTO ON:        yes
MAX PPs per VG:     32512
MAX PPs per PV:     1016                     MAX PVs:        32
LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable
{root_lpar5} / # df -m /devilla
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/fslv00     1024.00   1023.52    1%        5     1% /devilla
{root_lpar5} / # chfs -a size=+1024M /devilla
Filesystem size changed to 4194304
{root_lpar5} / # df -m /devilla
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/fslv00     2048.00   2047.37    1%        5     1% /devilla
{root_lpar5} / # chfs -a size=-1024M /devilla
Filesystem size changed to 2097152
{root_lpar5} / # df -m /devilla
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/fslv00     1024.00   1023.52    1%        5     1% /devilla
0 comments

AIX LPAR: Create and Mount disk

{root_lpar5} / # lspv
hdisk0          00fdc1c94bc59dc2                    rootvg          active
hdisk1          00fdc1c958b70cc0                    rootvg          active
hdisk2          00fdc1c95f7acf4a                    None
hdisk3          00fdc1c95f7acf93                    None
hdisk4          00fdc1c95f7acfdb                    None
hdisk5          00fdc1c963e5420f                    None
hdisk6          00fdc1c963e54259                    None
hdisk7          00fdc1c95f8023c4                    None
{root_lpar5} / # mkvg -y doshvg hdisk2 hdisk3 hdisk4
doshvg
{root_lpar5} / # lspv
hdisk0          00fdc1c94bc59dc2                    rootvg          active
hdisk1          00fdc1c958b70cc0                    rootvg          active
hdisk2          00fdc1c95f7acf4a                    doshvg          active
hdisk3          00fdc1c95f7acf93                    doshvg          active
hdisk4          00fdc1c95f7acfdb                    doshvg          active
hdisk5          00fdc1c963e5420f                    None
hdisk6          00fdc1c963e54259                    None
hdisk7          00fdc1c95f8023c4                    None
{root_lpar5} / # crfs -v jfs2 -m /devilla -g doshvg -a size=1024M -A yes
File system created successfully.
1048340 kilobytes total disk space.
New File System size is 2097152
{root_lpar5} / # mount /devilla
{root_lpar5} / # cd /devilla
{root_lpar5} /devilla # touch abc
{root_lpar5} /devilla # ls -al
total 8
drwxr-xr-x    3 root     system          256 Nov 02 14:12 .
drwxr-xr-x   22 root     system         4096 Nov 02 14:12 ..
-rw-r--r--    1 root     system            0 Nov 02 14:12 abc
drwxr-xr-x    2 root     system          256 Nov 02 14:12 lost+found
{root_lpar5} /devilla # df -m
Filesystem    MB blocks      Free %Used    Iused %Iused Mounted on
/dev/hd4         752.00    578.51   24%    12923     9% /
/dev/hd2        1864.00     32.02   99%    40353    79% /usr
/dev/hd9var      176.00    103.50   42%     4722    17% /var
/dev/hd3         168.00    166.23    2%       50     1% /tmp
/dev/hd1          16.00     15.60    3%       22     1% /home
/dev/hd11admin    128.00    127.64    1%        5     1% /admin
/proc                 -         -    -         -     -  /proc
/dev/hd10opt     200.00     56.25   72%     2688    17% /opt
/dev/livedump    256.00    255.64    1%        4     1% /var/adm/ras/livedump
/dev/fslv00     1024.00   1023.52    1%        5     1% /devilla
{root_lpar5} / # lsfs /devilla
Name            Nodename   Mount Pt               VFS   Size    Options    Auto Accounting
/dev/fslv00     --         /devilla               jfs2  2097152 --         yes  no
{root_lpar5} / # lsvg -l doshvg
doshvg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1       1       1    open/syncd    N/A
fslv00              jfs2       256     256     1    open/syncd    /devilla
0 comments

AIX LPAR: Mirror and Unmirror rootvg

1. Extend Volume Group

{root_lpar5} / # lspv
hdisk0          00fdc1c94bc59dc2                    rootvg          active
hdisk1          00fdc1c958b70cc0                    None
hdisk2          00fdc1c95f7acf4a                    None
hdisk3          00fdc1c95f7acf93                    None
hdisk4          00fdc1c95f7acfdb                    None
hdisk5          00fdc1c963e5420f                    None
hdisk6          00fdc1c963e54259                    None
hdisk7          00fdc1c95f8023c4                    None
{root_lpar5} / # extendvg rootvg hdisk1
{root_lpar5} / # lspv
hdisk0          00fdc1c94bc59dc2                    rootvg          active
hdisk1          00fdc1c958b70cc0                    rootvg          active
hdisk2          00fdc1c95f7acf4a                    None
hdisk3          00fdc1c95f7acf93                    None
hdisk4          00fdc1c95f7acfdb                    None
hdisk5          00fdc1c963e5420f                    None
hdisk6          00fdc1c963e54259                    None
hdisk7          00fdc1c95f8023c4                    None

2. mirror with hdisk1

{root_lpar5} / # mirrorvg rootvg hdisk1
0516-1804 chvg: The quorum change takes effect immediately.

0516-1126 mirrorvg: rootvg successfully mirrored, user should perform
        bosboot of system to initialize boot records.  Then, user must modify
        bootlist to include:  hdisk0 hdisk1.
{root_lpar5} / #

3. Setting boot block to hdisk1

{root_lpar5} / # bosboot -ad /dev/hdisk1
bosboot: Boot image is 39638 512 byte blocks.

4. Setting boot list
{root_lpar5} / # bootlist -m normal hdisk0 hdisk1

================================

To Unmirror rootvg

1. Remove mirror
{root_lpar5} / # unmirrorvg rootvg
0516-1246 rmlvcopy: If hd5 is the boot logical volume, please run 'chpv -c '
        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.
 

2. clear boot record
{root_lpar5} / # chpv -c hdisk1

3. Remove from volume group
{root_lpar5} / # reducevg rootvg hdisk1
{root_lpar5} / # lspv
hdisk0          00fdc1c94bc59dc2                    rootvg          active
hdisk1          00fdc1c958b70cc0                    None
hdisk2          00fdc1c95f7acf4a                    doshvg          active
hdisk3          00fdc1c95f7acf93                    doshvg          active
hdisk4          00fdc1c95f7acfdb                    doshvg          active
hdisk5          00fdc1c963e5420f                    None
hdisk6          00fdc1c963e54259                    None
hdisk7          00fdc1c95f8023c4                    None
 
;