How to setup partition encryption?

L'Antre du Tryphon

schedule
2012-01-29 | 04:08h
update
2013-06-08 | 19:25h
person
www.ctheroux.com
domain
www.ctheroux.com

How to setup partition encryption?

To setup partition encryption on Ubuntu, perform the following steps:

Install the required software

apt-get install cryptsetup

For more security, erase the partition you want to encrypt with one of the following commands

sudo dd if=/dev/zero of=/dev/sdXN bs=4K or sudo badblocks -c 10240 -s -w -t random -v /dev/sdXN or sudo dd if=/dev/urandom of=/dev/sdXN bs=4K

Load the encryption kernel modules

sudo modprobe dm-crypt sudo modprobe sha256 sudo modprobe aes

Enable encryption on the partition you want to encrypt

cryptsetup --verify-passphrase luksFormat /dev/sdXN -c aes -s 256 -h sha256

Map the partition you want to encrypt

cryptsetup luksOpen /dev/sdXN securebackup

Format the partition

mkfs -t ext3 -m 0 -O dir_index,filetype,sparse_super /dev/mapper/securebackup

 

Advertisement

Imprint
Responsible for the content:
www.ctheroux.com
Privacy & Terms of Use:
www.ctheroux.com
Mobile website via:
WordPress AMP Plugin
Last AMPHTML update:
08.10.2025 - 04:38:18
Privacy-Data & cookie usage: