Skip to main content
Home
badllama.com
  • Search
  • Log In

CentOS: Encrypted Filesystem

Mon, 01/30/2012 - 21:52 by bchavet

  1. Pick a volume to encrypt and mount. This should be an empty volume, as this process completely erases all of the content on this volume. For this example, /dev/sda3 is being encrypted and mounted at /mnt/secure.
  2. Prepare the volume
    cryptsetup luksFormat /dev/sda3
  3. Create the encrypted virtual device. This will be created at /dev/mapper/secure (replace "secure" with whatever you want to call it. This is an arbitrary value)
    cryptsetup luksOpen /dev/sda3 secure
  4. Create a filesystem on this virtual device
    mke2fs -j /dev/mapper/secure
  5. Create the mountpoint
    mkdir -p /mnt/secure
  6. Get the UUID of this device
    cryptsetup luksUUID /dev/sda3
  7. Add this UUID to /etc/crypttab
    luks-d77eb752-8a90-4d94-ae9f-2bec0a22c5d3 UUID=d77eb752-8a90-4d94-ae9f-2bec0a22c5d3 none

Book Navigation

  • ‹ CentOS
  • up
Powered by Backdrop CMS