public inbox for cryptsetup@lists.linux.dev
 help / color / mirror / Atom feed
* Filling a device with random data
@ 2023-02-08 21:09 David Joaquín Shourabi Porcel
  2023-02-09  4:02 ` Arno Wagner
  0 siblings, 1 reply; 7+ messages in thread
From: David Joaquín Shourabi Porcel @ 2023-02-08 21:09 UTC (permalink / raw)
  To: cryptsetup

Hey there :)

Section 2.19 of the [FAQ][1] explains how to fill devices with random data using dm-crypt: cryptsetup opens a plain mapping, zeros are written to it and it is closed. If LUKS is set up on the device afterwards, this translates to the following commands:

```
cryptsetup open --type=plain --key-file=/dev/urandom -- /dev/foo temporary
dd if=/dev/zero of=/dev/mapper/temporary
cryptsetup close -- temporary
cryptsetup luksFormat -- /dev/foo
cryptsetup open -- /dev/foo bar
# mkfs / pvcreate -- /dev/mapper/bar
```

I would like to skip the first mapping and shorten the procedure as follows:

```
cryptsetup luksFormat -- /dev/foo
cryptsetup open -- /dev/foo bar
dd if=/dev/zero of=/dev/mapper/bar
# mkfs / pvcreate -- /dev/mapper/bar
```

Does filling a device with random data under a separate dm-crypt mapping offer any security benefit?

Kind regards,

David J. Shourabi Porcel


[1]: https://gitlab.com/cryptsetup/cryptsetup/-/wikis/FrequentlyAskedQuestions

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-02-16 11:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-08 21:09 Filling a device with random data David Joaquín Shourabi Porcel
2023-02-09  4:02 ` Arno Wagner
2023-02-09 15:01   ` David Joaquín Shourabi Porcel
2023-02-09 15:37     ` Michael Kjörling
2023-02-09 19:03       ` Eric Biggers
2023-02-14 22:17         ` Arno Wagner
2023-02-16 11:05           ` Arno Wagner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox