1

I currently have a RAID-0 array with two 7200rpm HDs, but I would like to have more speed when accessing binaries and a small part of /home.

So, I am considering this setup for a Linux desktop:

  • 2 120GB SSDs in RAID-0
  • 2 7500rpm 2TB HDs in RAID-1

I would use the SSD for /usr and parts of /home, leaving the rest for the HDs. Now, I'd like to mirror /usr and the SSD-stored parts of /home on the HDs, for safety. The idea is to use writethrough for /home stuff, and writeback for /usr.

Is this possible with LVM? How would that be?

Can I use the RAID-0 SSD volume as cache for a same sized RAID-1 HD volume? (does LVM allow that? Are there any caveats?)

I don't really want a cache, I'd like to use the SSD array as storage for binaries and part of /home, but as far as I can see, using the SSD as cache would give me a free backup on the HD array, and the flexibility to choose writeback and writethrough for different filesystems.

1 Answer 1

0

Your requirements are confusing - maybe more details on what exactly you are trying to would have given you more answers.

Integrating the SSDs into LVM

From what I gather, you say that you want to use the SSDs as storage for binaries and part of home. You can do that, of course, either by

  • Creating a volume group just for the SSDs and creating your logical volumes on them, and then mounting them, or by
  • Creating a volume group spanning the SSDs and the HDDs, and specifying on each logical volume where you want it to be located (on the HDD or the SSD).

The former has the advantage that you'll immediately know what's on the SSD and what isn't. The latter has the advantage that you can later enable SSD caching (since the logical volume and its SSD cache need to be in the same volume group). You can still see what PV your data is on, by using "lvs -o+devices".

Using the SSDs

If you pursue the second option - I'd assume that you do, since it's the more sensible choice - you can

  • Create logical volumes just on the HDD, and then add a SSD cache to them, thus speeding them up.
  • Create logical volumes just on the SSD, in which case they don't need a cache.

LVM will allow both of that. Specifically, to answer your questions:

  • You can create a 10 GB SSD cache for a 10 GB HDD logical volume.
  • You can create a 10 GB SSD cache for a 100 GB HDD logical volume.
  • You can mirror a 10 GB logical volume on the HDD and the SSD. I have no idea how the performance will be. It may be normal RAID-1 performance (faster read, slower/same-speed write), but you'd have to measure how LVM mirrors actually do.

Word of Warning

That being said, the RAID-0 is a recipe for disaster. You will have to make extra sure that no data you can't afford to lose will be located on the SSD RAID-0 (note that you can pass the PV that a logical volume is stored on to lvcreate).

Also, adding a SSD cache does not give you another free backup of your data - if both your RAID-1 HDDs fail, recovering anything from the cache will be a nightmare. Even more so, should you choose to use your SSDs in a RAID-0 configuration, and then enable write-back, any of your SSDs failing may well bring your RAID-1-backed logical volume down.

The safest way you can proceed is using your SSDs as writethrough. Only if you use RAID-1 on your SSDs, writeback may be a sensible choice.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .