1820943 Members
4122 Online
109629 Solutions
New Discussion юеВ

Mirroring strategy

 
SOLVED
Go to solution
dictum9
Super Advisor

Mirroring strategy


I have 3 72-GB SCSI disks.
I need 20+GB for swap.

What's the best way to mirror them? I want to mirror swap also.

4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: Mirroring strategy

Well if you are going to mirror them (at least in a sensible way) then you need an even number of drives. With 3 drives, you could run more than 1 mirror but that's overkill. I would create a VG using 2 of your disks and mirror each LVOL. Mirroring a swap LVOL is no different from mirroring any other LVOL. You simply specify the number of mirror copies you want with the lvcreate and lvextend commands. Man lvcreate and lvextend for details.
If it ain't broke, I can fix that.
Ninad_1
Honored Contributor
Solution

Re: Mirroring strategy

It depends on you and what are your requirements and constraints. As advised above ideally you should mirror lvols from one disk to the 2nd. But if you want you can mirror the most important lvols from the 2 disks to the third disk as well.
Also note that while creating the swap lvol use the following
lvcreate -C y -r N -L size_in_MB -n swapvol_name /dev/vgname

Because swap requires contiguous and need to disallow bad block reallocation.
Also first create the swap vols, Then mirror the swapvol using
lvextend -m 1 /dev/vgname/swapvol_name pv_name

Then create the remaining vols and mirror them.
so that you know that you can get the contiguous blocks required from the disks for the swap vol.

Regards,
Ninad
Ninad_1
Honored Contributor

Re: Mirroring strategy

One modification - I think the -r option should be used with n rather than N.

Regards,
Ninad
TwoProc
Honored Contributor

Re: Mirroring strategy

Well, it's a bit messy, but you can mirror 1.5 disks to 1.5 disks. I used to do this back with the old D series, and they had 5 internal hot swap drives. I used the first two to mirror root lv's and the last three as a large mirrored data drive.

Just create an lv that spans 1 disk, and EXACTLY half ( or half -1 if the number of extents is an odd number) of the second disk. Now lvextend -m 1 over to the third disk and the second disk (and keep them in that order in your command). But, as long as the LV that you're creating has the "Strict" attribute on, it'll do this correctly for you anyway.

Good luck!
We are the people our parents warned us about --Jimmy Buffett