Linux File System Encryption Tutorial

Video is ready, Click Here to View ×

This tutorial shows how to setup and use an encrypted file system on your GNU/Linux operating system.

The following commands can be used when setting up an encrypted file system:

Wipe the device with one pass of zero data followed by one pass of random data:
dd if=/dev/zero of=/dev/”device””partition” bs=1M
dd if=/dev/urandom of=/dev/”device””partition” bs=1M

#where “device””partition” is the device ( and partition ) to be used.

Setup an unformatted partition on the device…


  1. hey there, thanks for the great tutorial, i'm testing some possibilities on my Debian server now, but I have a question. Which filesystem (ext4, xfs,btrfs,etc) is appropiated to create in order to use it for Postgresql? thanks for your answer!!

  2. Why do you need to wipe the drive twice? First you fill it with zeros and then you fill it with random data. Isn't it easier to just fill it with /dev/random as the first step instead of doing the same thing twice?

  3. I am going to try the tutorial again, but this time I will use sudo instead. This way I am hoping I will have user ownership, while also having root super powers. I'll report back after I finish.

  4. great video! You are one of the few tutorial guru's that take's the time to explain all of the switches, and not just a few of them. I followed along with the video, and all seems to work fine until I try to copy a file into the ext formatted encrypted partition. I am assuming this is because I used sudo su , to switch into root on an ubuntu machine before starting the process. I attempted to change the permissions to 777 w/ chmod, while still #; but this had no effect.

  5. Thank you very much for your tutorial, Sir. I found it VERY informative compared to the RHCSA book that I am reading. QQ: Do you know of any tools that can encrypt files on the file/folder level? Cryptkeeper does not seem to work on Fedora 18.

Leave a Reply

Your email address will not be published.