How To Mirror Raid5

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.

Solution:

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:

Code:

# 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
 

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. 

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.
 

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

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

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

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.

Have a Unix Problem
Unix Forum - Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.