Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the easyest way to set encrypted volume under linux?

Basically, what I want is to have fixed size file in my home folder. When I mount it and type password, it should appear as regular folder. I should also be able to umount it.

If it would be possible to prevend other users, including root, to access it while mounted, it would be a bonus.

It shouldn't depend on any kernel featueres or configuration, cause I want to be able to mount it later on another computer.

share|improve this question
This question needs a better title. It has nothing to do with partitions, and it does not say it is about encryption for one user only. I'm inclined to move this one to superuser. – Teddy Jul 9 '09 at 11:08
up vote 11 down vote accepted

Your last requirement screams 'Truecrypt'. There are some other options (like EncFS and luks / cryptsetup), but I wouldn't exactly call those 'easy' if you do not set them up during installation. A Truecrypt volume is most likely not a partition, it would be a file, but from your question, I guess that would be ok.

If mounted, root would be able to read it though, and I doubt a solution exists where root would be banned from reading the mounted partition / file. After all, root is God. I suppose you would be able to mimic what you want on a system with SELinux in strict mode, but building such a system is opening up a huge can of worms by itself.

So: Truecrypt.

share|improve this answer
Got to agree - truecrypt ticks all the boxes - and if you are using a file as a virtual partition ... it can be copied and mounted on other machines as well. I've used Truecrypt volume files to copy files between Linux and Windows :) – Iain Jun 3 '09 at 14:54

As an alternative to TrueCrypt, here a nice article from Linux Journal : Protecting Files at Home Using Encrypted Containers.

share|improve this answer

What you want is not called an encrypted "partition". What you probably meant was "volume". For encrypted actual partitions, LUKS /cryptsetup is by far the more sensible tool.

share|improve this answer
Thanks, title fixed – Marko Jul 16 '09 at 17:29

I second the above answer, Trucrypt is definitely your tool of choice.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.