Main Page
From Ubuntu.rohraff.org
Contents |
DISCLAIMER
See the bottom of this page
Hard drive/partition encryption
TrueCrypt
CryptLUKS
First perform a bad blocks scan to make sure the hard drive is not going to die too soon (can take up to couple days)
badblocks -c 10240 -s -w -t random -v /dev/sdb
output:
Checking for bad blocks in read-write mode From block 0 to 976762584 Testing with random pattern: done Reading and comparing: done Pass completed, 0 bad blocks found.
Prepare your harddisk - add random data to your harddisk, so it will be harder to guess how much hidden data is actually on it ( hours).
sudo dd if=/dev/urandom of=/dev/sdb
Faster alternatives are:
shred -n 1 /dev/sdb
or
wipe /dev/sdb
Install required software
sudo aptitude install cryptsetup hashalot
and load some kernel modules
sudo modprobe aes-i586 sudo modprobe dm-crypt sudo modprobe dm_mod
To load modules at bootup, edit /etc/modules
sudo nano /etc/modules
# /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. fuse lp sbp2 aes-i586 dm-crypt dm_mod # Generated by sensors-detect on Thu Feb 28 11:10:45 2008 # Chip drivers coretemp
Now is the time to the partion. I used GParted and created one partition on the whole disk (/dev/sdb1). Setup LUKS:
sudo cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb1
Open the encrypted device and assign it to a virtual /dev/mapper/western1TB device: (In our case: western1TB)
sudo cryptsetup luksOpen /dev/sdb1 western1TB
Create a filesystem on the encrypted device:
sudo mkfs.ext3 -j -m 1 -O dir_index,filetype,sparse_super /dev/mapper/western1TB
This howto is based on these threads here (http://www.hermann-uwe.de /blog/howto-disk-encryption-with-dm-crypt-luks-and-debian) , here (http://howtoforge.com/ubuntu_dm_crypt_luks) and here (https://help.ubuntu.com/community/EncryptedFilesystemLVMHowto)
Free Disk Space by Reducing Reserved Blocks
sudo tune2fs -m 1 /dev/sdx1
Storage Device Manager
sudo apt-get install pysdm
