Skip to content

RFE: Add _netdev concept to /etc/crypttab, similar to /etc/fstab in semantics, i.e. introduce remote-crypttab.target that is placed in late boot #4642

Closed

Description

@beneso

Submission type

  • Bug report
  • [ x] Request for enhancement (RFE)

NOTE: Do not submit anything other than bug reports or RFEs via the issue tracker!

systemd version the issue has been seen with

systemd-231-11.fc26.x86_64

NOTE: Do not submit bug reports about anything but the two most recently released systemd versions upstream!

Used distribution

Fedora 26

Description of problem:
If we use an encrypted PV as the root disk and at the same time want to mount an encrypted iSCSI disk, we add both these entries to /etc/crypttab. Now while non-iSCSI disk is available for cryptsetup in very early booting stages, iSCSI is only available after network starts (later than /etc/crypttab is processed). This introduces a delay in boot.

Is an option similar to fstab's _netdev available? This would tell cryptsetup to process this concrete line later, when iSCSI is ready

How reproducible:
always

Steps to Reproduce:

  1. enter both boot disk / LV and an iSCSI disk in /etc/crypttab
  2. boot

Actual results:
cryptsetup will start (and process /etc/crypttab) before iSCSI has established connection with the target (network is not ready). This introduces delay in boot and the volume is not mounted.

Expected results:
Have cryptsetup distinguish between items it needs to process in early stages of boot (rootfs) and those that will be mounted later via iSCSI. The desired effect is similar to _netdev parameter in fstab.

Activity

  1. poettering commented on Nov 11, 2016

    @poettering
    Member

    So you use LVM on top of LUKS on top of iscsi as root? yuck...

    I figure this is something dracut needs to be made aware of. @haraldh can you comment? is this supported?

  2. poettering commented on Nov 11, 2016

    @poettering
    Member

    hmm, not sure what you are asking for. Do you want a similar split as we have for local-fs.target vs. remote-fs.target (where the former is ordered into early-boot, but the later is ordered much later), but now want it for cryptsetup devices: so that some devices are set up and waited for in early-boot, and others can show up much later only, and are only waited for then?

    I figure something like that made make sense, indeed.

  3. added
    RFE 🎁Request for Enhancement, i.e. a feature request
    on Nov 11, 2016
  4. beneso commented on Nov 15, 2016

    @beneso
    Author

    Hi Lennart,

    Thanks for the response. So what I'm searching for is delaying processing of encrypted iSCSI-connected volumes until network is started.

    /etc/crypttab is processed early during boot. While this is ok for non-iSCSI storage (we have that storage already available at that stage), iSCSI storage will become available only after network is available. And that is later than the moment /etc/crypttab is processed.

    Does that make sense to you?

  5. changed the title [-]RFE: Possibility to boot from encrypted non-iSCSI disks and mount encrypted iSCSI disks on the same machine[/-] [+]RFE: Add _netdev concept to /etc/crypttab, similar to /etc/fstab in semantics, i.e. introduce remote-crypttab.target that is placed in late boot[/+] on Nov 23, 2016
  6. npmccallum commented on Jan 27, 2017

    @npmccallum
    Contributor

    We (clevis) need a change here as well. In our case, recovering the key requires network regardless of where the storage is. I don't see a reason to complicate crypttab. Can't we just move cryptsetup after sysinit? Or am I missing something?

  7. arvidjaar commented on Jan 29, 2017

    @arvidjaar
    Contributor

    Can't we just move cryptsetup after sysinit? Or am I missing something?

    Encrypted container may be needed for local filesystem and we may not be able to infer dependency when generator runs (think about logical volume on top encrypted container where you do not know where volume group is located until we actually scan devices).

  8. poettering commented on Feb 1, 2017

    @poettering
    Member

    Can't we just move cryptsetup after sysinit? Or am I missing something?

    Nah, we can't really. Think encrypted /var or so. Networking software (or some software ordered before it) might want /var around, but that means that specifiy crypto partition cannot be ordered late. Hence: for some partitions it might be safe to move them late, for others not. Which ones those are is not really possible to infer properly automatically, and hence we'd have _netdev.

  9. added a commit that references this issue on Oct 10, 2017
    d09c35c
  10. added a commit that references this issue on Jun 3, 2020
    52ff0e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFE 🎁Request for Enhancement, i.e. a feature requestcryptsetup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions