You can try LUKS to encrypt partition or removable device
You need to install cryptsetup utility
apt-get install cryptsetup
Configure LUKS partition
The following command will remove all data on the partition that you are encrypting.
for example to encrpt /dev/xvdc ,type the following command:
cryptsetup -y -v luksFormat /dev/xvdc
This command initializes the volume, and sets an initial key or passphrase. Please note that the passphrase is not recoverable so do not forget it
Type the following command:
cryptsetup luksOpen /dev/xvdc backup2
You can use the following command to see the status:
cryptsetup -v status backup2
to dump LUKS headers
cryptsetup luksDump /dev/xvdc
Format LUKS partition
dd if=/dev/zero of=/dev/mapper/backup2
to save time use pv
pv -tpreb /dev/zero | dd of=/dev/mapper/backup2 bs=128M
create file system:
mkfs.ext4 /dev/mapper/backup2
To mount the new filesystem :
mkdir /backup2
mount /dev/mapper/backup2 /backup2
df -H
cd /backup2
ls -l
to unmount:
umount /backup2
To secure DATA
cryptsetup luksClose backup2
mount or remount encrypted partition
cryptsetup luksOpen /dev/xvdc backup2
mount /dev/mapper/backup2 /backup2
df -H
mount