Skip to contentSkip to conversation

Encrypted fs in file

dm-crypt [email protected] 4 participants 4 messages Apr 3, 2016

lore
Share & tools
lore
#0 lore raw

Hello,
I wanted to make certain that I got this process right since I've never done it before and I can't seem to find docs on the subject.

1. Cat /dev/zero into a new file till it is big enough.
2. Use cryptsetup on the file (format and open).
3. Use mkfs on the loop device.
4. Mount the loop device as if it were a block device.

Does this look correct to you?

Thanks, David

#1 lore raw
Quoted 10 lines · On 03.04.2016 00:07, [email protected] wrote:

Hello,
I wanted to make certain that I got this process right since I've never done it before and I can't seem to find docs on the subject.

1. Cat /dev/zero into a new file till it is big enough.
2. Use cryptsetup on the file (format and open).
3. Use mkfs on the loop device.
4. Mount the loop device as if it were a block device.

Does this look correct to you?

Nearly.

3) Not the loop device, but the dm-device, the loop it inbetween and is handled automatically.

A symlink for the dm-device appears in /dev/mapper/ with the name you provided for the open command.

Same for 4) You mount the dm-device

Signature · 1 line
Matthias
#2 lore raw

And regarding 1):

You might want to use dd for that and /dev/urandom. (Or use /dev/zero and then zero out the inner device before creating the filesystem).

Regards

-Sven

Am 03.04.2016 um 10:41 schrieb Matthias Schniedermeyer:

Quoted 25 lines · On 03.04.2016 00:07, [email protected] wrote:
Quoted 10 lines

Hello,
I wanted to make certain that I got this process right since I've never done it before and I can't seem to find docs on the subject.

1. Cat /dev/zero into a new file till it is big enough.
2. Use cryptsetup on the file (format and open).
3. Use mkfs on the loop device.
4. Mount the loop device as if it were a block device.

Does this look correct to you?

Nearly.

3) Not the loop device, but the dm-device, the loop it inbetween and is handled automatically.

A symlink for the dm-device appears in /dev/mapper/ with the name you provided for the open command.

Same for 4) You mount the dm-device

#3 lore raw

Also refer to FAQ item 2.6
https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions

The zeroing out of the mapped container is advisable if this needs high security, i.e. is not just for experiments.

Regards,
Arno

Quoted 41 lines · Sven Eschenberg

And regarding 1):

You might want to use dd for that and /dev/urandom. (Or use /dev/zero and then zero out the inner device before creating the filesystem).

Regards

-Sven

Am 03.04.2016 um 10:41 schrieb Matthias Schniedermeyer:

Quoted 14 lines · On 03.04.2016 00:07, [email protected] wrote:
Quoted 10 lines

Hello,
I wanted to make certain that I got this process right since I've never done it before and I can't seem to find docs on the subject.

1. Cat /dev/zero into a new file till it is big enough.
2. Use cryptsetup on the file (format and open).
3. Use mkfs on the loop device.
4. Mount the loop device as if it were a block device.

Does this look correct to you?

Nearly.

Quoted 11 lines

3) Not the loop device, but the dm-device, the loop it inbetween and is handled automatically.

A symlink for the dm-device appears in /dev/mapper/ with the name you provided for the open command.

Same for 4) You mount the dm-device

_______________________________________________
dm-crypt mailing list
[email protected]
http://www.saout.de/mailman/listinfo/dm-crypt

Signature · 7 lines
Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: [email protected]
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. -- Plato

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier