My question is under what circumstances should I stripe?
If you're talking about a "mirror" stripe, you would use it to migrate data from one drive to another. You would not use it as a form of RAID-1, as it is no where as efficient as the regular md
driver.
If you're talking about a stripe that extends drive space, well, that's what it's used for: when you run out of space.
Otherwise, I wouldn't bother with the LVM stripe options.
I'd like other people's experience on the question for what sorts of configurations, if any, does LVM striping across two disks improve the single-user Linux desktop experience?
Well, I've turned on LVM mirroring for a busy server, with two drives in a eSATA enclosure. The behavior I observed was that it would "burst" the mirroring writes to the other drive, and often lagged behind the primary drive by a second or two. This made me very nervous, as there could be potential consistency issues during a primary drive failure. The performance was also abysmal under heavy write loads, and read performance was not improved because it did not use the other drive for reading. I scrapped that setup and switched it to a RAID-1 via the md
driver and the speed increase was immediately visible, with no "bursty" behavior.
Some recommendations:
- If you have four drives of the same size, and all of your data would fit onto two drives, I would easily recommend a RAID-10 over a RAID-5 any day. Yes, you lose 2 drives, but you gain slightly more redundancy than RAID-5 and your access times "even out".
- If you have just two drives and they can accommodate all of your data, I would recommend a mirror (RAID-1).
- If you have drives of very different size and are trying to economize, you could get away with using LVM to extend the volume onto the second drive, provided you're aware of the risks involved. A single drive failure means you would lose whatever you had.
However, I've just read articles with titles like RAID: Not Such a Clever Idea for Your Home PC, Are two drives better than one?, and a piece from storagereview.com — all of which say that striping with RAID-0 is a waste of money and effort for a single-user desktop machine.
RAID-0 striping exists for a reason: you're out of storage capacity and you temporarily need to increase it. The key word here is "temporarily", the idea being that you'll soon remedy the problem with a permanent fix.
If you're talking about some gaming box that you can wipe and reinstall, then yeah, it's a waste of time.
If you're talking about a box that handles your livelihood, and the only way to make things work is to extend the volume onto another drive, then that's a different story. You need to do what you need to do.
I'm a big fan of snapshots for backups, but I typically use them in the manner you'll find described for LVM snapshots -- Make a snapshot, mount it somewhere, back up the snapshot with your favorite backup tool (I like Bacula), then get rid of the LVM snapshot. Ideally this backup goes somewhere off-site
This dovetails very well with rsnapshot: Your rsnapshot snapshots can be instantly-available local backups, and they can also be captured in the off-site backup of the filesystem that you make from the LVM snapshot.
LVM snapshots are very similar to BSD UFS/FFS snapshots in that they store the deltas between when the snapshot was taken and the current system state: This means that performance will degrade as the snapshot and the main disk grow further out of sync, and there's some overhead for each snapshot you're maintaining (any change to the disk has to be tracked so the snapshot knows about it).
In practice this overhead isn't significant unless your disk changes frequently and you're keeping snapshots around for a long time.
See http://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html for more on using LVM snapshots for backups (painted with the same broad strokes as what I just said).
Incidentally LVM (or UFS) snapshots are also a great "save game" kind of thing if you're about to do something REALLY DANGEROUS to a production server, but that's well outside the scope of your question
Best Answer
You can create the RAID like this:
--stripes 1
is the number of disks aside from RAID6's two redundancy disks,-L 1T
is the visible size of the raid array. Then you can expand the raid withlvextend -L +1T
, or add disks withThe relationship between LVM and mdraid is basically that the kernel side is mdraid, and the management commands are LVM. The relevant commands are described in this documentation and in man pages.