Lvm – For what sort of Linux desktop is LVM striping worthwhile

desktophard drivelvmperformanceraid

I run several Linux machines at home and at work. Most of my computing is I/O-limited, e.g., large compiler regression suites and the like. At home I also have one machine that captures high-definition video from a terrestrial antenna. One sporting event goes into a single file of about 30GB; I have over 4TB of storage devoted to HD video.

My question is under what circumstances should I stripe? My current setup for my home directory and root filesystem is to stripe XFS over two drives using LVM. Sample output from lvdisplay -m:

Logical extent 0 to 117247:
  Type                striped
  Stripes             2
  Stripe size         64 KB
  Stripe 0:
    Physical volume   /dev/sdb2
    Physical extents  0 to 58623
  Stripe 1:
    Physical volume   /dev/sda2
    Physical extents  0 to 58623

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. But

  • These studies use Windows, not Linux

  • They use hardware RAID, not LVM

  • They're not dealing with 30GB video files

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?

Best Answer

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.