All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald Braumann <harry@unheit.net>
To: dm-crypt@saout.de
Subject: [dm-crypt] dm-integrity standalone - lack of metadata
Date: Sun, 24 Jun 2018 11:53:48 +0200	[thread overview]
Message-ID: <20180624095348.GA819@nn.nn> (raw)

Hi!

I'm using the dm-integrity target standalone with crc32c for component
devices of a RAID. I don't use journaling, because the perfomance hit
is too big and I don't really need it in that case.

I want to automatically activate these targets using udev
rules (see below). However, the superblock lacks some crucial
information:

- Integrity algorithm
The algorithm is not stored in the superblock and so I have to use
crc32 hard-coded in my udev rule. This is of course no general
solution. I don't quite understand why it is not stored in the
superblock. Is there a technical reason for that?

- Journal mode
I open the integrity devices without journaling. But again, that's
hard-coded and it would a be problem if I had other devices, where I
actually want journaling. It would be nice, if the superblock
contained a use_journal flag so the default could be configured on the
device itself.

- UUID/label support
Not strictly required for my use case, but would be nice for
persistent naming.

While playing around with that, I also noticed that integritysetup
format is extremly slow (this is on an HDD):

integritysetup format /dev/sdb2 -v --integrity crc32c --sector-size
4096
=> 39.6 MiB/s

Format with --no-wipe, open the target and use dd:
dd if=/dev/zero of=/dev/mapper/int bs=1M
=> 63 MiB/s

Same as above, but opening without journal (which really isn't
required for that step, even if the final target should be journaled):
=> 135 MiB/s

I have absolutely no problem with using the dd method, but it kind of
makes the built-in format method redundant. 

Best regards
harry

/etc/udev/rules.d/70-dm-integrity.rules:

ACTION!="add", GOTO="dm_integrity_end"
SUBSYSTEM!="block", GOTO="dm_integrity_end"
ENV{ID_FS_TYPE}!="DM_integrity", GOTO="dm_integrity_end"

RUN+="/sbin/integritysetup open $devnode $kernel-integrity --integrity crc32c --integrity-no-journal"

LABEL="dm_integrity_end"

             reply	other threads:[~2018-06-24 10:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-24  9:53 Harald Braumann [this message]
2018-06-24 11:01 ` [dm-crypt] dm-integrity standalone - lack of metadata Milan Broz
2018-06-25 18:05   ` Mikulas Patocka
2018-06-25 18:05     ` Mikulas Patocka
2018-07-03 15:02     ` Milan Broz
2018-07-03 15:02       ` Milan Broz
2018-07-03 18:21       ` Mikulas Patocka
2018-07-03 18:21         ` Mikulas Patocka
2018-06-26 12:30   ` Harald Braumann
2018-06-26 12:30     ` Harald Braumann

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=20180624095348.GA819@nn.nn \
    --to=harry@unheit.net \
    --cc=dm-crypt@saout.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.