Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am getting ready to create a (hardware) RAID 1 array spanning three disks. Performance is not key here, just redundancy and ability to recover from data failure. The question: Should I use LVM? I haven't used it before, but I've heard that it's fairly simple to do a "snapshot" of a filesystem which it sounds like would be a dream for backup archival purposes.

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

Do you mean RAID5 with three disks? RAID1 needs a multiple of two disks to work (mirroring), so either two or four would work.

LVM snapshots are (unfortunately) not suitable for long term archival, as performance degrades heavily with many snapshots, but they are great to create a definite state for a (long running) backup to another medium. As an example, you can put your database in a consistent state, make a snapshot and backup from this while the database continues to work normally. After the backup, you would delete the snapshot again.

Beside that, if you can see you might need to move or enlarge volumes to additional disks in the future, use LVM, but if not, the (small) overhead of LVM and the additional layer might not be worth it.

share|improve this answer
    
Totally agree. LVM snapshots are fantastic, but because of copy-on-write (CoW), every time a data block changes from the original, LVM has to read the original block, copy it to a new location and writes the data. This can cause a big performance hit especially if a lot of blocks change over time. –  vmfarms Aug 18 '10 at 23:36
add comment

LVM snapshots are great for consistant backups as well as being able to rollback if an upgrade or configuration change goes south.

For example if you are upgrading your kernel or distro to a new version and anything goes wrong, it takes a few seconds to roll back to the state you were in before. Very useful if you need to get things up and running quickly, or you just want to go home and don't really feel like fixing it that day.

Even if you only have to do that once it will be worth it.

share|improve this answer
add comment

The snapshot feature is not the only advantage of LVM. Another advantage is that maintenance is easier. If you know you want to enlarge the mail volume, it's less error-prone to do lvextend /dev/mapper/core-mail than “fdisk /dev/md1, did I choose the right disk set, now was that partition 6 or 7, ...“ There's also pvmove to move mounted filesystems around, and several other such benefits.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.