From: Milan Broz <mbroz@redhat.com>
To: Klaus Schneider <klaus_snd@web.de>
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] minimal LUKS container size
Date: Wed, 07 Dec 2011 13:03:26 +0100 [thread overview]
Message-ID: <4EDF560E.9060004@redhat.com> (raw)
In-Reply-To: <214444323.79200.1323257277449.JavaMail.fmail@mwmweb029>
On 12/07/2011 12:27 PM, Klaus Schneider wrote:
> Hello
>
> thanks for the effort you put into developing LUKS and cryptsetup. I
> have a suggestion for improving the package: Please document the
> minimal size for a LUKS container; I could not find it in the
> documentation nor in the FAQ. It would also be helpful if "cryptsetup
> luksCreate" would fail with an error message if the container is too
> small. Currently, "cryptsetup luksCreate" succeeds and "cryptsetup
> luksOpen" fails with a device-mapper error, which does not point the
> user into the right direction. It took me quite some time to find out
> the reason being too small a container. As far as I could find out by
> trial and error, for cryptsetup 1.3 with the default settings the
> container must be larger than 2MB (creating a 3MB container results
> in a 1MB filesystem), whereas for the old 1.1 release it seems to be
> > 1MB. Is this correct? Rational for a small container: I want to
> have a key file on a USB medium secured in a LUKS container. Since
> the key is only 512 Bit long, a very small container would be
> sufficient.
Minimal size depends on two things:
- volume key size
- alignment of data area
Cryptsetup 1.3 by default aligns data to 1MB offset multiple, that's why
you see this change.
You can switch to old alignment by using data alignment override, e.g.
cryptsetup luksFormat -s 128 --align-payload=8
(So here forcing keysize to 128bit and forcing alignment to 4k offset.
- vaule is in 512 byte sectors.
This is perhaps the smallest header possible while still using
reasonable key size - 1032 x 512 bytes sectors ~ 520kB)
(But also note that misalignment to flash memory block can have
some performance effects.)
Anyway, some example in FAQ would be nice.
Milan
next prev parent reply other threads:[~2011-12-07 12:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-07 11:27 [dm-crypt] minimal LUKS container size Klaus Schneider
2011-12-07 12:03 ` Milan Broz [this message]
2011-12-16 7:14 ` Arno Wagner
2011-12-16 8:25 ` Milan Broz
2011-12-16 9:19 ` Arno Wagner
2011-12-19 0:05 ` Arno Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EDF560E.9060004@redhat.com \
--to=mbroz@redhat.com \
--cc=dm-crypt@saout.de \
--cc=klaus_snd@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox