How do I create an encrypted file system inside a file?
Posted
by
darent
on Ask Ubuntu
See other posts from Ask Ubuntu
or by darent
Published on 2011-08-27T23:55:09Z
Indexed on
2013/11/05
16:13 UTC
Read the original article
Hit count: 305
Recently i've found this interesting tutorial:
http://flossstuff.wordpress.com/2011/08/07/using-a-file-as-a-storage-device/
It explains how to create an empty file, format it as ext4, and mount it as a device.
I'd like to know if it can be created as an encrypted ext4 file system. I've tried using palimpsest (the disk utility found in System menu) to format the already created file system but it doesn't works as it detects the file system being used. If I try to unmount the file system, it won't work neither because it doesn't detect the device (since it's not a real device like a hardrive or a usb drive).
So my question is, is there an option to create the file system encrypted from the begining? I've used these commands:
Create an empty file 200Mb size:
dd if=/dev/zero of=/path/to/file bs=1M count=200
Make it ext4:
mkfs -t ext4 file
Mount it in a folder inside my home:
sudo mount -o loop file /path/to/mount_point
Is there any way the mkfs command creates the ext4 encrypted asking for a decryption password?
I'm planing to use this as a way to encrypt files inside Dropbox.
Thanks for your time.
© Ask Ubuntu or respective owner