Re: Rotating RAID 1

From
NeilBrown <hidden>
Date
2011-08-15 23:55:17
Reply to
Jérôme Poulin, 2011-08-15
On Mon, 15 Aug 2011 19:32:04 -0400 Jérôme Poulin [off-list ref]
wrote:
On Mon, Aug 15, 2011 at 6:42 PM, NeilBrown [off-list ref] wrote:
quoted
So if there are 3 drives A, X, Y where A is permanent and X and Y are rotated
off-site, then I create two RAID1s like this:


mdadm -C /dev/md0 -l1 -n2 --bitmap=internal /dev/A /dev/X
mdadm -C /dev/md1 -l1 -n2 --bitmap=internal /dev/md0 /dev/Y
That seems nice for 2 disks, but adding another one later would be a
mess. Is there any way to play with slots number manually to make it
appear as an always degraded RAID ? I can't plug all the disks at once
because of the maximum of 2 ports.
Yes, add another one later would be difficult.  But if you know up-front that
you will want three off-site devices it is easy.

You could

 mdadm -C /dev/md0 -l1 -n2 -b internal /dev/A missing
 mdadm -C /dev/md1 -l1 -n2 -b internal /dev/md0 missing
 mdadm -C /dev/md2 -l1 -n2 -b internal /dev/md1 missing
 mdadm -C /dev/md3 -l1 -n2 -b internal /dev/md2 missing

 mkfs /dev/md3 ; mount ..

 So you now have 4 "missing" devices.  Each time you plug in a device that
 hasn't been in an array before, explicitly add it to the array that you want
 it to be a part of and let it recover.
 When you plug in a device that was previously plugged in, just "mdadm
 -I /dev/XX" and it will automatically be added and recover based on the
 bitmap.

 You can have as many or as few of the transient drives plugged in at any
 time as you like.

 There is a cost here of course.  Every write potentially needs to update
 every bitmap, so the more bitmaps, the more overhead in updating them.  So
 don't create more than you need.

 Also, it doesn't have to be a linear stack.  It could be a binary tree
 though that might take a little more care to construct.  Then when an
 adjacent pair of leafs are both off-site, their bitmap would not need
 updating.

NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (20 messages) 20 messages, 7 authors, last reply 2011-10-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help