LVM, Demystified

Discussion in 'all things UNIX' started by lotuseclat79, Mar 27, 2014.

Thread Status:
Not open for further replies.
  1. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,097
  2. Palancar

    Palancar Registered Member

    Joined:
    Oct 26, 2011
    Posts:
    1,594
    Good read.
     
  3. mirimir

    mirimir Registered Member

    Joined:
    Oct 1, 2011
    Posts:
    6,029
    LVM on dm-crypt/LUKS on Linux RAID is awesome :)
     
  4. fblais

    fblais Registered Member

    Joined:
    Jul 31, 2008
    Posts:
    837
    Location:
    Québec, Canada
    Thanks!
    No I'll know what this is about!
     
  5. Gullible Jones

    Gullible Jones Registered Member

    Joined:
    May 16, 2013
    Posts:
    1,461
    Is that the proper layering? How do you add/replace drives if LVM is running on top of LUKS?

    (I've never looked much into disk encryption...)
     
  6. amarildojr

    amarildojr Registered Member

    Joined:
    Aug 8, 2013
    Posts:
    1,985
    Location:
    Brasil
    What does replace mean? If you're talking about replacing one of the drives, then it's similar to if they weren't encrypted: open up the container and start the process again.

    I came up to a similar question when I needed to re-install my system. I just did:

    # cryptsetup open /dev/sda2 lvm
    # mount /dev/mapper/system-root /mnt
    # mount /dev/sda1 /mnt/boot
    # swap on /dev/mapper/system-swap
    # mount /dev/mapper/system-home /mnt/home

    There you have it. Now you can proceed with installation.
     
  7. mirimir

    mirimir Registered Member

    Joined:
    Oct 1, 2011
    Posts:
    6,029
    In this case, it's Linux software RAID that's dealing with the physical HDDs. If one of them dies, the array is degraded. You just shut down, replace the failed HDD, and boot. Then you wait while the array is rebuilt. You can follow progress in the Disk Utility GUI.

    During this process, it's not even necessary for the LUKS partition to be decrypted.

    There's an additional complication if you also put /boot on a RAID array. Unless you allow booting from a degraded array, you'll need to boot from a LiveCD for rebuilding the RAID arrays.

    LVM is useful here in two ways. First, is that all of your partitions except /boot are decrypted at boot by the same LUKS passphrase. Second, it's very easy to enlarge /swap or /root, add a new partition, etc.
     
Loading...
Thread Status:
Not open for further replies.