how to mirror raid5

Hi,

I have an ssa filesystem to move to san. We don't want any downtime. I heard that you can do a mirroring of existing file system on the san. The file system is a type of either raid 0, raid 1, or raid 5.

Anyone know how to do this?

Thanks in advance,
itik

You don't have to resort to disks means to employ mirroring as the LVM will do it for you. Yes, you can create/remove mirrors without even umounting the FS:

  • create a normal RAID set, create you normal (unmirrored) LV there, create an FS and mount it. Start using it.....

  • create a second RAID set, connect it to the machine somehow.

  • run the configuration manager to add the disks to the configuration (-v is "verbose mode", you don't need it) :

# cfgmgr -v

  • add the disk(s) to the volume group where you have created the logical volumes. If you are unsure you could use smitty instead of the command below:

# extendvg <volumegroupname> <physical volume>

  • mirror the LV in question using the "mklvcopy" command. Again you can use smitty instead of issuing the command below directly.

# mklvcopy -s s <LV name> <Nr of copies> <physical volume>

Alternatively, instead of cycling through all LVs of a VG you can use the command "mirrorvg" to create mirrors for all LVs in a volumegroup. In fact mirrorvg is just a wrapper script around mklvcopy to make mirrors for all LVs in a VG.

WARNING: if you create a mirror for the rootvg you will have to change the bootlist accordingly, create a boot record on the new disk and adjust the "quorum" of the VG. See "man mirrorvg" for details. There are also examples on how to replace bad disks (unmirror, then remirror the VG).

EXAMPLE: i suppose here you add an additional RAID device as "hdisk15" to the volume group "myvg" and want to mirror the lv "mylv":

connect the disks to the system, use the RAID adapter utilites ("diag" utility, "smitty devices") to configure the RAID set itself. Then run cfgmgr:

# cfgmgr -v
# lspv
hdisk0          000bf05d94f0e1a8                    rootvg          active
hdisk1          000bf05d94f0e27d                    rootvg          active

...

hdisk14         000bf05d981228ff                    myvg            active
hdisk15         000bf05d95422cb2                    None            
# extendvg myvg hdisk15
# lspv
hdisk0          000bf05d94f0e1a8                    rootvg          active
hdisk1          000bf05d94f0e27d                    rootvg          active

...

hdisk14         000bf05d981228ff                    myvg            active
hdisk15         000bf05d95422cb2                    myvg            active
# lsvg -l myvg
myvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
some_lv             jfs2       134   134   1    open/syncd    /somewhere
mylv                jfs2       25    25    1    open/syncd    /somewhere/else
# mklvcopy -s s mylv 2 hdisk15
# lsvg -l myvg
myvg:
LV NAME             TYPE       LPs   PPs   PVs  LV STATE      MOUNT POINT
some_lv             jfs2       134   134   1    open/syncd    /somewhere
mylv                jfs2       25    50    2    open/syncd    /somewhere/else

I hope this helps.

bakunin

Is this going to have data integrity problem considering SAN is much faster than SSA? And my system is only 4.3.3 with JFS only.

When detaching the SSA disk, the command is reducevg hdisk14. Is that correct?

And there's no conflict for all types of disks whether raid 0,1,5 to be mirrored.

Thanks but need more clarification,
itik

Use the "mirror write consistency" option if you want to be 101% sure, but: no, there are no problems with data integrity because of unequal disk speeds.

yes, that is correct. After that use "rmdev -dl <disk>" to remove the disk device prior to physically detaching it.

No, there is not. When the disk is used by the LVM it is turned into a "physical volume" and this is raw storage space, regardless of where it comes from. This is the main difference between a "disk" and a "physical volume": it doesn't matter any more of which the physical volume is constructed.

Hope this helps.

bakunin

thanks a lot!

more power!