0

I have two hard drives and I'm about to build a backup system. Now I'm wondering which solution would be the best.

  1. I encrypt disk1 and disk2. After mounting these I create a volume group and logical volume?

  2. I mount disk1 and disk2. After this I create a volume group and create encrypted logical volume?

In both scenarios. What happens if one of the hard drives gets corrupted. If I build the system according to the first choice, at least I can open one of the disks and probably volume group will contain some files, right?

But if I configure this according to the second choice, can I even open the encryption for the logical volume if one of the hard drives is corrupted?

Thomas
  • 4,225
  • 5
  • 23
  • 28
japs
  • 1
  • 1
    Nope, you're hosed either way. If your system needs to survive the loss of a disk, you need redundancy. – womble Jul 12 '18 at 05:58

1 Answers1

0

If it was me, I will go with 1.

If you go with 2 and loose one drive, all your data will be lost.

With 1, you will still be able to use the lvm partial option

-P, --partial
    When set, the tools will do their best to provide access to
    Volume Groups that are only partially available
    (one or more Physical Volumes belonging to the Volume Group are
    missing from the system). Where part of a logical volume is missing,
    /dev/ioerror will be substituted, and you could use dmsetup(8)
    to set this up to return I/O errors when accessed, or create it
    as a large block device of nulls. Metadata may not be changed
    with this option. To insert a replacement Physical Volume of
    the same or large size use pvcreate -u to set the uuid to
    match the original followed by vgcfgrestore(8).

In both scenarios. What happens if one of the hard drives gets corrupted. If I build the system according to the first choice, at least I can open one of the disks and probably volume group will contain some files, right?

Yes, it will contain some files and parts of lost files. In this case, it will be possible to recover some files with the partial option (see above).

But if I configure this according to the second choice, can I even open the encryption for the logical volume if one of the hard drives is corrupted?

No, you won't be able to open the logical volume (In a simple way I mean, if you have time, everything is possible, at the cost of data loss)

The other advantage of 1 is that it will be easier to add new physical volumes if you need more space.

wqeqwsd
  • 9
  • 4