Mailinglist Archive: opensuse (1677 mails)

< Previous Next >
Re: [opensuse] encrypted container ?
On 06/12/11 11:38, Andreas wrote:
Hi,
is there an how-to for setting up an encrypted container?
I'd like to have a small encrypted area that gets mounted automatically
on boot.

My son gave me the following instructions, which I offer (untested) to
you ...

1) install cryptsetup (it's in the OSS repo)

2) su root

3) create an unformatted partition on /dev/sd_

4) :~ # cryptsetup luksOpen /dev/sd[appropriate device and partition
here] [name e.g. music]

5) :~ # mount /dev/mapper/[name e.g. music] /home/bob/music

Think of it in layers:

Plain: device, mount, data
Encrypted: device, crypt, mount, data
[Encrypted RAID: device, mdadm, crypt, mount, data]

cryptsetup will create a 'block device' or layer in /dev/mapper with
whatever name you provide in the luksOpen command above.

For booting you need to add in /etc/crypttab:

#<target name> <source device> <key file> <options>
music /dev/sdb1 none luks

(but change the source device to whatever is appropriate in your case)

In /etc/fstab add:

# <file system> <mount point> <type> <options> <dump>
<pass>
/dev/mapper/music /home/bob/music ext3 auto 0 0

... I would recommend identifying your device with /dev/disk/by-id/* to
avoid problems with changing drive letters. During the boot procedure
you will be prompted to enter the password for your encrypted device.

Good luck.

Bob
--
Bob Williams
System: Linux 2.6.37.6-0.9-desktop
Distro: openSUSE 11.4 (x86_64) with KDE Development Platform: 4.7.2 (4.7.2)
Uptime: 18:00pm up 13 days 3:36, 4 users, load average: 0.26, 0.29, 0.38
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
This Thread
References