Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AIX mirroring to specific disks 1

Status
Not open for further replies.

MHThomas

Technical User
Nov 25, 2002
26
0
0
GB
Hi,
I have an external disk array attached to my AIX5 server. The array has ten disks and two controllers (five disks per controller).
I want to set up mirroring for one five disk VG, but obviously, I'd like to map the mirrors across the two controllers so one-half of the mirror is on controller 0, and one half on controller 1. After spending a couple of hours googling the subject I have nothing.

Any suggestions?

Mark T.
 
First thing is to identify for each hdisk its controller (if the array is an IBM DS series you can do it with fget_config).

Once you've identified for all the disks the controllers you can make an VG on 5 hdisks of the same controller, and then extend it with the other 5 hdisks and mirror it.

Another option is to use to mirror each LV manually, with mklvcopy.
 
What Morefeo suggested is a software mirror. But if the controllers you have are RAID controllers then you can do this on the hardware level as well! Are they RAID controller?

Regards,
Khalid
 

> Once you've identified for all the disks the controllers you can make an VG on 5 hdisks of the same controller, and then extend it with the other 5 hdisks and mirror it.

That doesn't guarantee they're on different controllers. You need to do it manually for each LV but be aware that any LVM operation that extends or moves stuff around can mess it up again. It's not an easy thing to do
 
If I create a VG on 5 hdisks on the same controlles, for example hdisk2, hdisk3 ... hdisk6, and then mirror this VG over another 5 disks on the other controller, for example hdisk7, hdisk8 ... hdisk11, wouldn't each copy for each LV be on different controllers?
 

Nope - not at all. Remember you mirror LVs, not disks. All it would do is mirror each PP onto the next available disk which would most likely be amongst the first few unless you'd really used up all the space on the first five disks.
 
Not sure, if I've got:
newvg on hdisk2, hdisk3, hdisk4, hdisk5, hdisk6
and then extend the vg
extendvg newvg hdisk7 hdisk8 hdisk9 hdisk10 hdisk11

And then mirror like this:
mirrorvg -m newvg hdisk7 hdisk8 hdisk9 hdisk10 hdisk11

It should mirror over the hdisks I've told in the command.
 

Well, that might be, but as I've mentioned before, if you do any command that extends or moves stuff, I very much doubt you're guaranteed it stays where you want it...
 
To be exactly sure which LP copy is placed where, specify map files:

new.map:
[tt]hdisk3:1-10

mklv -y newlv -t jfs2 -m new.map -c 1 vgname 10[/tt]

creates an unmirrored JFS2 type LV (-c 1: 1 copy) named newlv on hdisk3 PP numbers 1 to 10


mir.map
[tt]hdisk9:1-10

mklvcopy -m mir.map -c 2 newlv
syncvg -l newlv[/tt]

creates a mirror of LV newlv on hdisk9 PPs 1 to 10, then syncs that mirror.


two.map
[tt]hdisk3:11-20
hdisk9:11-20

mklv -y mirrlv -t jfs2 -m two.map -c 2 vgname 10[/tt]

creates a mirrored JFS2 type LV (-c 2: 2 copies) named mirrlv with primary mirror on hdisk3 PPs 11 to 20 and secondary mirror on hdisk9 PPs 11 to 20.



HTH,

p5wizard
 
It's all in the man pages you know...

man mklv
man mklvcopy

And if you want to find free space chunks of a specific PV, use this oneliner:

[tt]lspv -M hdiskXX | grep -e -[/tt]

Note that it will not list individual free PPs, just contiguous free space of 2 or more PPs...


HTH,

p5wizard
 

I never said it couldn't be done, just that it's messy. And future admins needs to be very clear on how you're running that setup.

Also, chfs can't use maps so if you're extending you need to lvextend first using maps.
 
I agree it's a bit messy, but you can always set max LPs to actual number of LPs (chlv -x) to make sure chfs doesn't run extendlv w/o map file without you knowing about it. Chfs will just error out saying that it can't increase the underlying LV, then: adjust LV (chlv -x), make a map file, extendlv using map and then chfs to increase size of FS to reflect new LV size (use lsfs -q to find new FS size to use).

Note that if you want host-based mirroring across two different physical locations (e.g. SAN server in two computer rooms), this is the only way to make sure which PVs are picked for which mirror.

And yes, future admins need to be made aware of this setup.


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top