AIX: Disk Mirroring w/ mirrorvg

Just last week I received a new IBM pSeries 550! I admit, my first time setting this thing up was a bit frustrating. We did not have any Hardware Management Console (HCM), but through trial and error I was able to get into the console by using a null modem cable and HyperTerminal on a Windows laptop. There are some peculair details regarding the initial setup of the machine, but focusing on disk mirroring I will leave those out for now.

Once the machine was configured and brought on the network. The first thing to do was configure disk mirroring. This is a policy we have in place for all production machines. Drives do fail!! Disk mirroring on AIX, atleast with version 6.1, is pretty easy and straight forward. A lot less commands to type than when disk mirroring with Solaris default software!!

Display volume group information

Since we already have a, Root Volume Group “rootvg”

# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            546         488         109..74..87..109..109

for our mirror, all we need to do is extend it onto the second disk “hdisk1”. The first disk is “hdisk0”.

# extendvg rootvg hdisk1
0516-1254 extendvg: Changing the PVID in the ODM.

Checking the rootvg again, we see now that there are two disks on this volume group:

# lsvg -p rootvg
rootvg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk0            active            546         488         109..74..87..109..109
hdisk1            active            546         546         110..109..109..109..109

Start Mirroring Process

Now that the rootvg is written to the second disk, we can go ahead and start the mirroring process on the second disk, “hdisk1”.

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

Taking heed to the message displayed from the completion of “mirrorvg”:

# bosboot -ad /dev/hdisk1
bosboot: Boot image is 36835 512 byte blocks.

With “bosboot” we are saying copy the byte blocks from the first disk “hdisk0” necessary to boot from the second disk “hdisk1” should the first drive fail. Looking at the current boot list we just see the first drive:

# bootlist -m normal -o
hdisk0 blv=hd5

The following command configures our boot order to include the second drive after the first:

# bootlist -m normal hdisk0 hdisk1

Verifying we see:

# bootlist -m normal -o
hdisk0 blv=hd5
hdisk1 blv=hd5

This entry was posted in *Nix. Bookmark the permalink.

2 Responses to AIX: Disk Mirroring w/ mirrorvg

  1. Good post. Before you extend the vg it’s a good idea to do an lspv to see your current disk status. Usually right out of the box hdisk1 will not be in use:

    # lspv
    hdisk0 00f6896363c5a76a rootvg active
    hdisk1 none None
    #

    Nice post!

    http://geekswing.com/geek/how-to-mirror-your-root-disk-on-aix-aka-rootvg/

Leave a comment