Public bug reported:

From systemd version 245+ an option was added x-initrd.attach

---------

Setup this encrypted block device in the initrd, similarly to
systemd.mount(5) units marked with x-initrd.mount.

 Although it's not necessary to mark the mount entry for the root file
system with x-initrd.mount, x-initrd.attach is still recommended with
the encrypted block device containing the root file system as otherwise
systemd will attempt to detach the device during the regular system
shutdown while it's still in use. With this option the device will still
be detached but later after the root file system is unmounted.

All other encrypted block devices that contain file systems mounted in
the initrd should use this option.

 Added in version 245. [0]

---------

release: noble
systemd version: 253.5-1ubuntu6

Install noble to a vm with virt-manager and encrypt the lvm during subiquity 
install.
After successful install,
Modify /etc/crypttab to include the parameter in the 4th column
example:
sda6_crypt UUID=099aae4a-b11b-49a6-a6c4-62939eddf7a0 none luks,x-initrd.attach

update-initramfs -u -k all

During boot or shutdown the logs show
cryptsetup: WARNING: dm_crypt-0: ignoring unknown option x-initrd.attach

There are two separate problems
1. crypttab doesn't recognize x-initrd.attach option in /etc/crypttab file.
     cryptsetup: WARNING: dm_crypt-0: ignoring unknown option x-initrd.attach
2. this error happens on shutdown/restart
      [systemd-cryptsetup]: Device dm-crypt-0 is still in use.
      [systemd-cryptsetup]: Failed to deactivate: Device or resource busy.
The vm does eventually shutdown after throwing the above warnings.

[0]
https://www.freedesktop.org/software/systemd/man/latest/crypttab.html#x-initrd.attach

These patches look like they could fix the issue, The last one might not be 
needed.
git format-patch -1 8ce02b87cece09797c1030c778db4180e1e2ce2e
https://github.com/systemd/systemd/commit/8ce02b87cece09797c1030c778db4180e1e2ce2e

git format-patch -1 1dc85eff1d0dff18aaeaae530c91bf53f34b726e
https://github.com/systemd/systemd/commit/1dc85eff1d0dff18aaeaae530c91bf53f34b726e

git format-patch -1 bf1484c70a24cf04c145a9509c8124ffd7fb0879
https://github.com/systemd/systemd/commit/bf1484c70a24cf04c145a9509c8124ffd7fb0879

** Affects: systemd (Ubuntu)
     Importance: Undecided
     Assignee: Heather Lemon (hypothetical-lemon)
         Status: New

** Affects: systemd (Ubuntu Bionic)
     Importance: Undecided
         Status: Won't Fix

** Affects: systemd (Ubuntu Focal)
     Importance: Undecided
         Status: New

** Affects: systemd (Ubuntu Jammy)
     Importance: Undecided
         Status: New

** Affects: systemd (Ubuntu Mantic)
     Importance: Undecided
         Status: New

** Affects: systemd (Ubuntu Noble)
     Importance: Undecided
     Assignee: Heather Lemon (hypothetical-lemon)
         Status: New

** Changed in: systemd (Ubuntu)
     Assignee: (unassigned) => Heather Lemon (hypothetical-lemon)

** Also affects: systemd (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Also affects: systemd (Ubuntu Bionic)
   Importance: Undecided
       Status: New

** Also affects: systemd (Ubuntu Noble)
   Importance: Undecided
     Assignee: Heather Lemon (hypothetical-lemon)
       Status: New

** Also affects: systemd (Ubuntu Mantic)
   Importance: Undecided
       Status: New

** Also affects: systemd (Ubuntu Jammy)
   Importance: Undecided
       Status: New

** Description changed:

  From systemd version 245+ an option was added x-initrd.attach, which
  
  Setup this encrypted block device in the initrd, similarly to
  systemd.mount(5) units marked with x-initrd.mount.
  
-  Although it's not necessary to mark the mount entry for the root file
+  Although it's not necessary to mark the mount entry for the root file
  system with x-initrd.mount, x-initrd.attach is still recommended with
  the encrypted block device containing the root file system as otherwise
  systemd will attempt to detach the device during the regular system
  shutdown while it's still in use. With this option the device will still
  be detached but later after the root file system is unmounted.
  
  All other encrypted block devices that contain file systems mounted in
  the initrd should use this option.
  
-  Added in version 245. [0]
+  Added in version 245. [0]
  
  ---------
  
- release: noble 
+ release: noble
  systemd version: 253.5-1ubuntu6
  
  Install noble to a vm with virt-manager and encrypt the lvm during subiquity 
install.
  After successful install,
- Modify /etc/crypttab to include the parameter in the 4th column 
+ Modify /etc/crypttab to include the parameter in the 4th column
  example:
  sda6_crypt UUID=099aae4a-b11b-49a6-a6c4-62939eddf7a0 none luks,x-initrd.attach
  
  update-initramfs -u -k all
  
- During boot or shutdown the logs show 
+ During boot or shutdown the logs show
  cryptsetup: WARNING: dm_crypt-0: ignoring unknown option x-initrd.attach
  
- There are two separate problems 
- 1. crypttab doesn't recognize x-initrd.attach option in /etc/crypttab file. 
-      cryptsetup: WARNING: dm_crypt-0: ignoring unknown option x-initrd.attach
- 2. this error happens on shutdown/restart 
-       [systemd-cryptsetup]: Device dm-crypt-0 is still in use.
-       [systemd-cryptsetup]: Failed to deactivate: Device or resource busy. 
- The vm does eventually shutdown after throwing the above warnings. 
+ There are two separate problems
+ 1. crypttab doesn't recognize x-initrd.attach option in /etc/crypttab file.
+      cryptsetup: WARNING: dm_crypt-0: ignoring unknown option x-initrd.attach
+ 2. this error happens on shutdown/restart
+       [systemd-cryptsetup]: Device dm-crypt-0 is still in use.
+       [systemd-cryptsetup]: Failed to deactivate: Device or resource busy.
+ The vm does eventually shutdown after throwing the above warnings.
  
  [0]
  
https://www.freedesktop.org/software/systemd/man/latest/crypttab.html#x-initrd.attach
+ 
+ These patches look like they could fix the issue, The last one might not be 
needed.
+ git format-patch -1 8ce02b87cece09797c1030c778db4180e1e2ce2e
+ 
https://github.com/systemd/systemd/commit/8ce02b87cece09797c1030c778db4180e1e2ce2e
+ 
+ git format-patch -1 1dc85eff1d0dff18aaeaae530c91bf53f34b726e
+ 
https://github.com/systemd/systemd/commit/1dc85eff1d0dff18aaeaae530c91bf53f34b726e
+ 
+ git format-patch -1 bf1484c70a24cf04c145a9509c8124ffd7fb0879
+ 
https://github.com/systemd/systemd/commit/bf1484c70a24cf04c145a9509c8124ffd7fb0879

** Description changed:

- From systemd version 245+ an option was added x-initrd.attach, which
+ From systemd version 245+ an option was added x-initrd.attach
  
  Setup this encrypted block device in the initrd, similarly to
  systemd.mount(5) units marked with x-initrd.mount.
  
   Although it's not necessary to mark the mount entry for the root file
  system with x-initrd.mount, x-initrd.attach is still recommended with
  the encrypted block device containing the root file system as otherwise
  systemd will attempt to detach the device during the regular system
  shutdown while it's still in use. With this option the device will still
  be detached but later after the root file system is unmounted.
  
  All other encrypted block devices that contain file systems mounted in
  the initrd should use this option.
  
   Added in version 245. [0]
  
  ---------
  
  release: noble
  systemd version: 253.5-1ubuntu6
  
  Install noble to a vm with virt-manager and encrypt the lvm during subiquity 
install.
  After successful install,
  Modify /etc/crypttab to include the parameter in the 4th column
  example:
  sda6_crypt UUID=099aae4a-b11b-49a6-a6c4-62939eddf7a0 none luks,x-initrd.attach
  
  update-initramfs -u -k all
  
  During boot or shutdown the logs show
  cryptsetup: WARNING: dm_crypt-0: ignoring unknown option x-initrd.attach
  
  There are two separate problems
  1. crypttab doesn't recognize x-initrd.attach option in /etc/crypttab file.
       cryptsetup: WARNING: dm_crypt-0: ignoring unknown option x-initrd.attach
  2. this error happens on shutdown/restart
        [systemd-cryptsetup]: Device dm-crypt-0 is still in use.
        [systemd-cryptsetup]: Failed to deactivate: Device or resource busy.
  The vm does eventually shutdown after throwing the above warnings.
  
  [0]
  
https://www.freedesktop.org/software/systemd/man/latest/crypttab.html#x-initrd.attach
  
  These patches look like they could fix the issue, The last one might not be 
needed.
  git format-patch -1 8ce02b87cece09797c1030c778db4180e1e2ce2e
  
https://github.com/systemd/systemd/commit/8ce02b87cece09797c1030c778db4180e1e2ce2e
  
  git format-patch -1 1dc85eff1d0dff18aaeaae530c91bf53f34b726e
  
https://github.com/systemd/systemd/commit/1dc85eff1d0dff18aaeaae530c91bf53f34b726e
  
  git format-patch -1 bf1484c70a24cf04c145a9509c8124ffd7fb0879
  
https://github.com/systemd/systemd/commit/bf1484c70a24cf04c145a9509c8124ffd7fb0879

** Description changed:

  From systemd version 245+ an option was added x-initrd.attach
+ 
+ ---------
  
  Setup this encrypted block device in the initrd, similarly to
  systemd.mount(5) units marked with x-initrd.mount.
  
   Although it's not necessary to mark the mount entry for the root file
  system with x-initrd.mount, x-initrd.attach is still recommended with
  the encrypted block device containing the root file system as otherwise
  systemd will attempt to detach the device during the regular system
  shutdown while it's still in use. With this option the device will still
  be detached but later after the root file system is unmounted.
  
  All other encrypted block devices that contain file systems mounted in
  the initrd should use this option.
  
   Added in version 245. [0]
  
  ---------
  
  release: noble
  systemd version: 253.5-1ubuntu6
  
  Install noble to a vm with virt-manager and encrypt the lvm during subiquity 
install.
  After successful install,
  Modify /etc/crypttab to include the parameter in the 4th column
  example:
  sda6_crypt UUID=099aae4a-b11b-49a6-a6c4-62939eddf7a0 none luks,x-initrd.attach
  
  update-initramfs -u -k all
  
  During boot or shutdown the logs show
  cryptsetup: WARNING: dm_crypt-0: ignoring unknown option x-initrd.attach
  
  There are two separate problems
  1. crypttab doesn't recognize x-initrd.attach option in /etc/crypttab file.
       cryptsetup: WARNING: dm_crypt-0: ignoring unknown option x-initrd.attach
  2. this error happens on shutdown/restart
        [systemd-cryptsetup]: Device dm-crypt-0 is still in use.
        [systemd-cryptsetup]: Failed to deactivate: Device or resource busy.
  The vm does eventually shutdown after throwing the above warnings.
  
  [0]
  
https://www.freedesktop.org/software/systemd/man/latest/crypttab.html#x-initrd.attach
  
  These patches look like they could fix the issue, The last one might not be 
needed.
  git format-patch -1 8ce02b87cece09797c1030c778db4180e1e2ce2e
  
https://github.com/systemd/systemd/commit/8ce02b87cece09797c1030c778db4180e1e2ce2e
  
  git format-patch -1 1dc85eff1d0dff18aaeaae530c91bf53f34b726e
  
https://github.com/systemd/systemd/commit/1dc85eff1d0dff18aaeaae530c91bf53f34b726e
  
  git format-patch -1 bf1484c70a24cf04c145a9509c8124ffd7fb0879
  
https://github.com/systemd/systemd/commit/bf1484c70a24cf04c145a9509c8124ffd7fb0879

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2056802

Title:
  crypttab does not honor `x-initrd.attach` option

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2056802/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to