Jason Booth <[EMAIL PROTECTED]> posted
[EMAIL PROTECTED], excerpted below, on  Sun,
22 Oct 2006 11:15:22 -0600:

> On Sunday 22 October 2006 06:16, Richard Freeman wrote:
>> I'd just make SWAPDEVICE and LOOPDEV command-line parameters and then
>> call the script 4 times.
> or drop a for loop into it...
> 
> I don't know much about raid, but if it's treated in /dev as a single device, 
> you may just be able to replace it and go. 

The neat thing about swap is that the kernel stripes it on its own -- no
raid drivers needed.  You just mount the raid swap partitions and set all
the ones you want striped to the same priority (I use pri=1), and the
kernel will do the rest on its own.  If they are all the same size, great,
if not, it'll stripe them until the smallest one is gone then it'll stripe
the remainder, again all automatically.

(Striping means it writes a few bytes, maybe the standard half-kb
block tho in the case of swap tho I'm not sure, to the first device, then
the next block to the second, the third block to the third, etc.  Because
bus speed is far faster than physical disk write speed, with four disks by
the time you've sent the data to the fourth one, the first is pretty much
done actually writing it to disk and ready for more again, so the data is
written out and read in at bus speed rather than at bus speed until the
cache on the drive fills up or empties, then at drive speed.  The caveat
with pure striping, aka raid-0, is that while it's much faster, it's not
redundant at all, the "r" in "raid" isn't!  Thus if one disk goes out, you
lost what amounts to everything, tho of course a good data recovery place
can still recover say 3 out of every 4 blocks if it was a four-way stripe.
However, this isn't a problem as long as you don't need five-nines uptime
or the like -- if you want a bad drive to crash the system anyway, so you
know about it and can recover the non-raid-0 non-swap data on the other
drives due to the redundancy of the other raid formats.)

> May be overly paranoid, but writing encrypted data multiple times could help 
> someone to guess what certain file is and make an attack on the encryption 
> easier. I use ext2 for my encrypted loops so there's no journal as well. 
> Although the power fails sometimes, and can be a pain to fsck, i haven't lost 
> anything yet.

If one were using a non-striped raid, say raid-1 (mirrored), or raid-6
(striped minus two, which are parity, so a 4-way is 2-way striped plus two
parity, raid-6 allows you to lose any two of the drives), the data would
be redundant, but not in pure striped.  A redundant raid form swap might
be used where uptime is critical and hot-swap drives are used, so the
system could continue running after a drive crashed, while it was
hot-swapped out.  However, that's the big costly operation way of doing
things, not a hobbyist's way of doing things unless you are Mark
Shuttleworth or something, and going down to replace the drive is expected
here anyway, after which the swap could be reconfigured, so no big deal.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

-- 
[email protected] mailing list

Reply via email to