29 May 2012

...and if the AIX boot partition fails?

First, you need to boot with an AIX installation disk or Diagnostics disk (Virtual I/O bootdisk also works) and go to maintanence mode. Choose the option to give you a shell (mounting rootvg, of course).
Just in case, this is a quite dangerous process, so you need to know what you're doing (and so, if you destroy the world, it's your fault, not mine).





Now let's see what happens with boot partition:

# lslv -l hd5 

If there's something wrong with your hd5 boot device, you should create the hd5 again. This process is dangerous, do you have IBM AIX Support ?? if so, please call them.

If not, then, because hd5 is seems not to be on disk but in ODM, you have to delete hd5 definitions from ODM, and then create a new boot device.

1) Look in ODM for references to hd5 object name (you get a list similar to this example)

# odmget -q name=hd5 CuAt 

CuAt:
name = "hd5"
attribute = "lvserial_id"
value = "000439211138e3f6.1"
type = "R"
generic = "D"
rep = "n"
nls_index = 648

CuAt:
name = "hd5"
attribute = "inter"
value = "x"
type = "R"
generic = "DU"
rep = "l"
nls_index = 643

CuAt:
name = "hd5"
attribute = "type"
value = "boot"
type = "R"
generic = "DU"
rep = "s"
nls_index = 639

CuAt:
name = "hd5"
attribute = "size"
value = "2"
type = "R"
generic = "DU"
rep = "r"
nls_index = 647

2) Now, se the objects you have and use odmget, like this:

# odmget -q name=hd5 CuDv 
# odmget -q value3=hd5 CuDvDr 
# odmget -q name=hd5 CuDep
# odmget -q name=hd5 CuVPD

3) Take a backup of /etc/objrepos:

# odmget CuAt > /backupdir/CuAt.txt 
# odmget CuDv > /backupdir/CuDv.txt 

and so on....

4) After identifying which ODM DB has references you have to delete any reference with odmdelete:

odmdelete -q name=hd5 -o CuAt 
# odmdelete -q name=hd5 -o CuDv 
# odmdelete -q value3=hd5 -o CuDvDr 
# odmdelete -q name=hd5 -o CuDep 
# odmdelete -q name=hd5 -o CuVPD 

4) If you were lucky enough your system is still running, determine the PP size of the disk you want to be hd5. Now use the following command to recreate the boot partition:

# mklv -t boot -y hd5 -a e rootvg 1 hdiskXX 

5) This means create a hd5 boot logical volume on hdiskXX belonging to rootvg size 1 PP. Once you have created hd5 boot partition, you need to reinstate the kernel:

# bosboot -ad /dev/ipldevice 
# bootlist -m normal hdiskXX 
# syncvg 

6) Reboot the server, sacrifice a goat and pray.

No comments:

Post a Comment