Linux – Does LVM Increase the Risk of Data Loss?

data-recoveryhard-disklinuxlvm

Let's say I have two identical disks, and I set one LVM logical volume on them (no mirroring). Question: What will happen when one of the disks fails?

  1. I will lose all the data from all the disks
  2. I will lose the data from broken disk, but I get data from still working one
  3. something else (what)

?

Thank you in advance for clarification.

From what I've read mentioning RAIDs in LVM articles indicates I will lose everything, on the other hand shrinking LV indicates something opposite.

Update

Good read:
http://www.redhat.com/magazine/009jul05/features/lvm2/

According to this article with linear mapping (default, it is my case) and no mirroring, in case of failure you should lose data only from broken disk. I hope it is true, and eventually I find out :-/

Best Answer

The worst and most likely case is that you will lose everything. If you have a single logical volume spanning both drives, and you lose one drive with no mirroring, you've essentially wiped out half the file system.

From this point, it gets mildly better depending on what file system you are running on your volume. Assuming that you are not using striping, which will kill any chance you have, you may be able to get some of your data back by running recovery software on the second drive. I don't have personal experience with that case, but it should be theoretically possible to get some or most of the files that were exclusively on the still functional drive if you are using one of the more 'robust' file systems (i.e. ext3 or ext4).

Your mileage will vary depending on what filesystem you are using on top of LVM and how your files are arranged on the disks though. If they are fragmented across both disks then you will still lose those files too.

Related Question