[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Encrypted RAID1 for storage with Debian Jessie


On 2017-04-19 09:11, tv.debian@googlemail.com wrote:
System on usb flash disks always caused me troubles, I use it only if
the system can be loaded in ram at boot time and the drive isn't used
for write operation. A low-end small SSD would be a far better option
in my opinion.

Thanks for the advice. I managed to find a 40 Go Intel SSD, for under 30€ :)

On 2017-04-19 15:06, Joshua Schaeffer wrote:
I can't speak to your system being on USB, but in general you can just
do something like the following:

    $mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda
    $mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdc
    $mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sde

If you want to use LVM then you create the PV, VG, and LV:

    $pvcreate /dev/md0
    $pvcreate /dev/md1
    $pvcreate /dev/md2
    $vgcreate vg_data1 /dev/md0
    $vgcreate vg_data2 /dev/md1
    $vgcreate vg_data3 /dev/md2
    $lvcreate vg_data1 -n lv_data1 -L <size>
    $lvcreate vg_data2 -n lv_data2 -L <size>

    $lvcreate vg_data3 -n lv_data3 -L <size>

Then create your LUKS partition:

    $cryptsetup -v --verify-passphrase luksFormat /dev/mapper/lv_data1
    $cryptsetup -v --verify-passphrase luksFormat /dev/mapper/lv_data2

    $cryptsetup -v --verify-passphrase luksFormat /dev/mapper/lv_data3

Then create your filesystem and mount them:

    $mkfs.ext4 /dev/mapper/vg_data1-lv_data1_crypt
    $mkfs.ext4 /dev/mapper/vg_data2-lv_data2_crypt

    $mkfs.ext4 /dev/mapper/vg_data3-lv_data3_crypt

    $mount -t ext4 /dev/mapper/vg_data1-lv_data1_crypt /mnt/data1
    $mount -t ext4 /dev/mapper/vg_data2-lv_data2_crypt /mnt/data2

    $mount -t ext4 /dev/mapper/vg_data3-lv_data3_crypt /mnt/data3

Thank you for the detailed explanations.

I'm a complete noob when it comes to this kind of operations, so, sorry for the dumb question : following tv.debian@'s advises, I purchased a cheap SSD and installed my system on it (the SSD, and one pair of HDD are plugged in). From there on, how should I proceed ?

Thanks in advanced for your help.


Reply to: