#1111649 apt: Fails to detect systemd on mdadm system during dist-upgrade

Package:
mdadm
Source:
mdadm
Description:
Tool to administer Linux MD arrays (software RAID)
Submitter:
Thorsten Behrens
Date:
2026-04-28 05:49:03 UTC
Severity:
normal
#1111649#5
Date:
2025-08-20 15:09:36 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?

   I am coming from a Debian 12 system to Debian 13 using apt dist-upgrade. This gives me an error message
   that systemd cannot be found. The system uses mdadm and is a bare metal server by provider OVH. In
   some cases when testing this, grub EFI wasn't updated and restart failed.

   I can reproduce this and have a small zoo of test servers to continue testing, should you confirm this
   is a bug and wish to have me test a fix

   * What exactly did you do (or not do) that was effective (or
     ineffective)?
     ```
     sudo sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
     sudo find /etc/apt/sources.list.d -type f -exec sed -i 's/bookworm/trixie/g' {} \;
     sudo apt-get update && sudo apt-get dist-upgrade --autoremove -y
     ```
   * What was the outcome of this action?
     apt showed an error message:
     ```
     no systemd init system detected

     The root filesystem of this system was detected to be on a RAID device, so mdadm might be required to run during boot to properly start your system.

     Beginning with newer versions of the madm package, init-system integration is available for systemd only. This system seems to use an alternative init-system which might or might not leave your system unbootable and will not run any of the maintenance jobs automatically.
     ```
   * What outcome did you expect instead?
     apt detects the existing Debian 12 systemd correctly and does what it needs to do to function on mdadm

     df -h output:
     ```
     debian@aztec-prover-test-09:~$ df -h
     Filesystem      Size  Used Avail Use% Mounted on
     udev             63G     0   63G   0% /dev
     tmpfs            13G  2.0M   13G   1% /run
     /dev/md3        878G   26G  807G   4% /
     tmpfs            63G     0   63G   0% /dev/shm
     tmpfs           5.0M     0  5.0M   0% /run/lock
     /dev/md2        988M  191M  730M  21% /boot
     /dev/nvme1n1p1  511M  4.5M  507M   1% /boot/efi
     ```

     lsblk output:
     ```
     debian@aztec-prover-test-09:~$ lsblk
     NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
     nvme0n1     259:0    0 894.3G  0 disk
     |-nvme0n1p1 259:2    0   511M  0 part
     |-nvme0n1p2 259:3    0     1G  0 part
     | `-md2       9:2    0  1022M  0 raid1 /boot
     |-nvme0n1p3 259:4    0 892.3G  0 part
     | `-md3       9:3    0 892.1G  0 raid1 /
     |-nvme0n1p4 259:5    0   512M  0 part
     `-nvme0n1p5 259:6    0     2M  0 part
     nvme1n1     259:1    0 894.3G  0 disk
     |-nvme1n1p1 259:7    0   511M  0 part  /boot/efi
     |-nvme1n1p2 259:8    0     1G  0 part
     | `-md2       9:2    0  1022M  0 raid1 /boot
     |-nvme1n1p3 259:9    0 892.3G  0 part
     | `-md3       9:3    0 892.1G  0 raid1 /
     `-nvme1n1p4 259:10   0   512M  0 part
     ```

     apt list for systemd:
     ```
     debian@aztec-prover-test-09:~$ apt list --installed | grep systemd

     WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

     libpam-systemd/stable,now 257.7-1 amd64 [installed]
     libsystemd-shared/stable,now 257.7-1 amd64 [installed,automatic]
     libsystemd0/stable,now 257.7-1 amd64 [installed]
     systemd-cryptsetup/stable,now 257.7-1 amd64 [installed,automatic]
     systemd-resolved/stable,now 257.7-1 amd64 [installed]
     systemd-sysv/stable,now 257.7-1 amd64 [installed,automatic]
     systemd/stable,now 257.7-1 amd64 [installed,automatic]
     ```

#1111649#10
Date:
2025-08-20 17:00:08 UTC
From:
To:
On Wed, 2025-08-20 at 15:09 +0000, Thorsten Behrens wrote:

[...]
[...]

That error message is being producd by the mdadm package. Thus
reassigning this bug there.

Regards,

Adam

#1111649#21
Date:
2025-08-20 19:42:32 UTC
From:
To:
This is not the recommended way to upgrade Debian. While it usually
works, the safe and recommended way consists of a few more steps and is
outlined in the Release Notes.

It is also recommended to look at what apt says it will do.

Greetings
Marc

#1111649#26
Date:
2025-08-20 20:16:49 UTC
From:
To:
Sure, let’s take this a little slower.

Following release notes, get to the apt full-upgrade step:

```
debian@aztec-prover-test-11:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  g++-12 libabsl20220623 libaio1 libargon2-1 libassuan0 libavif15 libcbor0.8 libdav1d6 libfuse2 libfuse3-3 libicu72 libldap-2.5-0 libnetplan0 libnsl-dev libnsl2 libperl5.36
  libpython3.11 libpython3.11-dev libpython3.11-minimal libpython3.11-stdlib librav1e0 libstdc++-12-dev libsvtav1enc1 libtirpc-dev libutempter0 libx265-199 perl-modules-5.36
  python3-httplib2 python3-netifaces python3-pycurl python3-pyparsing python3-pyrsistent python3-pysimplesoap python3-serial python3-six python3.11 python3.11-dev python3.11-minimal
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libcurl3-gnutls libcurl4 libdb5.3 libefiboot1 libefivar1 libelf1 libext2fs2 libgdbm-compat4 libgdbm6 libglib2.0-0 libgnutls30 libhogweed6 libmagic1 libnettle8 libnpth0 libpcap0.8
  libpng16-16 libpsl5 libreadline8 libssh2-1 libssl3 libtirpc3 libuv1 python3-distutils python3-lib2to3
The following NEW packages will be installed:
  cpp-14 cpp-14-x86-64-linux-gnu cpp-x86-64-linux-gnu dracut-install firmware-ath9k-htc firmware-carl9170 firmware-intel-graphics firmware-intel-misc firmware-mediatek
  firmware-nvidia-graphics fonts-dejavu-mono g++-14 g++-14-x86-64-linux-gnu g++-x86-64-linux-gnu gcc-14 gcc-14-base gcc-14-x86-64-linux-gnu gcc-x86-64-linux-gnu grub-efi-amd64-unsigned
  initramfs-tools-bin libabsl20240722 libaio1t64 libapt-pkg7.0 libassuan9 libavif16 libcbor0.10 libcurl3t64-gnutls libcurl4t64 libdav1d7 libdb5.3t64 libefiboot1t64 libefivar1t64
  libelf1t64 libext2fs2t64 libfuse3-4 libgcc-14-dev libgdbm-compat4t64 libgdbm6t64 libglib2.0-0t64 libglib2.0-data libgnutls30t64 libheif-plugin-aomenc libheif-plugin-dav1d
  libheif-plugin-libde265 libheif-plugin-x265 libhogweed6t64 libhwasan0 libimagequant0 liblastlog2-2 libldap-common libldap2 libmagic1t64 libnetplan1 libnettle8t64 libnghttp3-9
  libngtcp2-16 libngtcp2-crypto-gnutls8 libnpth0t64 libpcap0.8t64 libperl5.40 libpng16-16t64 libpsl5t64 libpython3.13 libpython3.13-dev libpython3.13-minimal libpython3.13-stdlib
  librav1e0.7 libreadline8t64 libreiserfscore0t64 libsframe1 libsharpyuv0 libssh2-1t64 libssl3t64 libstdc++-14-dev libsvtav1enc2 libtext-charwidth-perl libtext-wrapi18n-perl
  libtirpc3t64 libunistring5 liburcu8t64 libuv1t64 libwtmpdb0 libx265-215 linux-image-6.12.41+deb13-amd64 linux-sysctl-defaults login.defs netcat-openbsd netplan-generator
  openssl-provider-legacy perl-modules-5.40 publicsuffix python3-arrow python3-autocommand python3-bcrypt python3-dateutil python3-fqdn python3-inflect python3-isoduration
  python3-jaraco.context python3-jaraco.functools python3-jaraco.text python3-jsonschema-specifications python3-linkify-it python3-more-itertools python3-netplan python3-packaging
  python3-referencing python3-rfc3339-validator python3-rfc3986-validator python3-rpds-py python3-typeguard python3-typeshed python3-typing-extensions python3-uc-micro python3-zipp
  python3.13 python3.13-dev python3.13-minimal shared-mime-info sqv systemd-cryptsetup xdg-user-dirs
The following packages have been kept back:
  teleport-ent
The following packages will be upgraded:
  adduser amd64-microcode apparmor apt apt-listchanges apt-utils base-files base-passwd bash bash-completion bc bind9-host bind9-libs binutils binutils-common binutils-x86-64-linux-gnu
  bsd-mailx bsdextrautils bsdutils btrfs-progs build-essential bzip2 ca-certificates chrony cloud-init cloud-initramfs-growroot containerd.io coreutils cpio cpp cpp-12 cron
  cron-daemon-common curl dash dbus dbus-bin dbus-daemon dbus-session-bus-common dbus-system-bus-common dbus-user-session debconf debian-archive-keyring debianutils diffutils dirmngr
  distro-info-data dmeventd dmsetup docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin dpkg dpkg-dev e2fsprogs eject ethtool fakeroot fdisk
  file findutils firmware-amd-graphics firmware-linux firmware-linux-free firmware-linux-nonfree firmware-misc-nonfree fontconfig-config fonts-dejavu-core g++ g++-12 gcc gcc-12
  gcc-12-base gdisk genisoimage gettext-base git git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grep groff-base grub-common
  grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed grub2-common gsasl-common gzip hostname htop init init-system-helpers initramfs-tools initramfs-tools-core intel-microcode
  iproute2 iptables iputils-ping isc-dhcp-client javascript-common jq klibc-utils kmod less libacl1 libalgorithm-diff-xs-perl libaom3 libapparmor1 libargon2-1 libasan8 libatomic1
  libattr1 libaudit-common libaudit1 libbinutils libblkid1 libbpf1 libbrotli1 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc-devtools libc-l10n libc6 libc6-dev libcap-ng0 libcap2
  libcap2-bin libcc1-0 libcom-err2 libcrypt-dev libcrypt1 libcryptsetup12 libctf-nobfd0 libctf0 libdbus-1-3 libde265-0 libdebconfclient0 libdeflate0 libdevmapper-event1.02.1
  libdevmapper1.02.1 libdpkg-perl libduktape207 libedit2 liberror-perl libexpat1 libexpat1-dev libfakeroot libfdisk1 libffi8 libfido2-1 libfile-fcntllock-perl libfontconfig1
  libfreetype6 libfstrm0 libgav1-1 libgcc-12-dev libgcc-s1 libgcrypt20 libgd3 libgmp10 libgomp1 libgpg-error0 libgpm2 libgprofng0 libgsasl18 libgssapi-krb5-2 libgssglue1 libheif1
  libidn12 libidn2-0 libintl-perl libintl-xs-perl libip4tc2 libip6tc2 libisl23 libitm1 libjansson4 libjbig0 libjemalloc2 libjpeg62-turbo libjq1 libjs-sphinxdoc libjson-c5 libk5crypto3
  libkeyutils1 libklibc libkmod2 libkrb5-3 libkrb5support0 libksba8 liblerc4 liblmdb0 liblocale-gettext-perl liblockfile-bin liblockfile1 liblsan0 liblvm2cmd2.03 liblz4-1 liblzma5
  liblzo2-2 libmagic-mgc libmaxminddb0 libmd0 libmnl0 libmodule-find-perl libmount1 libmpc3 libmpfr6 libncursesw6 libnetfilter-conntrack3 libnewt0.52 libnfnetlink0 libnftnl11
  libnghttp2-14 libnl-3-200 libnl-genl-3-200 libnsl-dev libnsl2 libnss-myhostname libntlm0 libnuma1 libonig5 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam-systemd
  libpam0g libpci3 libpcre2-8-0 libpipeline1 libpolkit-agent-1-0 libpolkit-gobject-1-0 libpopt0 libproc-processtable-perl libproc2-0 libprotobuf-c1 libpython3-dev libpython3-stdlib
  libquadmath0 librtmp1 libsasl2-2 libsasl2-modules-db libseccomp2 libsecret-1-0 libsecret-common libsecret-tools libselinux1 libsemanage-common libsemanage2 libsepol2 libslang2
  libslirp0 libsmartcols1 libsodium23 libsqlite3-0 libss2 libstdc++-12-dev libstdc++6 libsystemd-shared libsystemd0 libtasn1-6 libterm-readkey-perl libtiff6 libtinfo6 libtirpc-common
  libtirpc-dev libtsan2 libubsan1 libuchardet0 libudev1 liburing2 libutempter0 libuuid1 libwebp7 libwrap0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxtables12
  libxxhash0 libyaml-0-2 libyuv0 libzstd1 linux-base linux-image-amd64 linux-libc-dev locales login logsave lsb-release lvm2 make man-db manpages manpages-dev mawk mdadm media-types
  mokutil mount msmtp msmtp-mta nano ncurses-base ncurses-bin needrestart netbase netplan.io openssh-client openssh-server openssh-sftp-server openssl passwd patch pci.ids pciutils perl
  perl-base pigz pinentry-curses polkitd procps psmisc python-apt-common python3 python3-apt python3-attr python3-blinker python3-certifi python3-cffi-backend python3-chardet
  python3-charset-normalizer python3-configobj python3-cryptography python3-dbus python3-debconf python3-debian python3-debianbts python3-dev python3-distro python3-distro-info
  python3-httplib2 python3-idna python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-jwt python3-markdown-it python3-markupsafe python3-minimal
  python3-netifaces python3-oauthlib python3-pip python3-pkg-resources python3-pycurl python3-pygments python3-pyparsing python3-pyrsistent python3-reportbug python3-requests
  python3-rich python3-serial python3-setuptools python3-six python3-urllib3 python3-wheel python3-yaml qemu-utils readline-common reportbug runit-helper screen sed sensible-utils
  sgml-base shim-helpers-amd64-signed shim-signed shim-signed-common shim-unsigned slirp4netns smartmontools socat ssh-import-id sudo systemd systemd-resolved systemd-sysv
  sysvinit-utils tar tcpdump traceroute tzdata ucf udev ufw unattended-upgrades usr-is-merged util-linux util-linux-extra uuid-runtime vim vim-common vim-runtime vim-tiny wget whiptail
  xml-core xz-utils zlib1g zlib1g-dev zstd
430 upgraded, 122 newly installed, 25 to remove and 1 not upgraded.
Need to get 608 MB of archives.
After this operation, 655 MB of additional disk space will be used.
```

Say yes

Get the aforementioned error during “configuring mdadm”

Mdadm lines in term.log

```
Preparing to unpack .../118-mdadm_4.4-11_amd64.deb ...
Unpacking mdadm (4.4-11) over (4.2-5) ...
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev/rules.d': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/systemd/system-shutdown': Directory not empty
Preparing to unpack .../119-needrestart_3.11-1_all.deb …
…
Setting up mdadm (4.4-11) ...
Installing new version of config file /etc/logcheck/ignore.d.server/mdadm ...
update-initramfs: deferring update (trigger activated)
Generating grub configuration file ...
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.12.41+deb13-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-38-amd64
Found initrd image: /boot/initrd.img-6.1.0-38-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-37-amd64
Found initrd image: /boot/initrd.img-6.1.0-37-amd64
Adding boot menu entry for UEFI Firmware Settings ...
done
Removing obsolete conffile /etc/cron.d/mdadm ...
Removing obsolete conffile /etc/cron.daily/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm-waitidle ...
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_continue.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_continue.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_start.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_start.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdmonitor-oneshot.timer' <E2><86><92> '/usr/lib/systemd/system/mdmonitor-oneshot.timer'.
Setting up libpython3-stdlib:amd64 (3.13.5-1) ...
Setting up systemd-resolved (257.7-1) ...
Installing new version of config file /etc/systemd/resolved.conf ...
Setting up binutils-x86-64-linux-gnu (2.44-3) ...
Setting up libpython3.13:amd64 (3.13.5-2) ...
Setting up cpp-x86-64-linux-gnu (4:14.2.0-1) ...
Setting up needrestart (3.11-1) ...
Installing new version of config file /etc/needrestart/hook.d/10-dpkg ...
Installing new version of config file /etc/needrestart/hook.d/20-rpm ...
Installing new version of config file /etc/needrestart/hook.d/90-none ...
Installing new version of config file /etc/needrestart/needrestart.conf ...
Installing new version of config file /etc/needrestart/notify.d/200-write ...
Installing new version of config file /etc/needrestart/notify.d/400-notify-send ...
Installing new version of config file /etc/needrestart/notify.d/600-mail ...
Installing new version of config file /etc/needrestart/restart.d/dbus.service ...
Setting up gpg-agent (2.4.7-21+b3) ...
Installing new version of config file /etc/X11/Xsession.d/90gpg-agent ...
Setting up initramfs-tools (0.148.3) ...
Installing new version of config file /etc/kernel/postinst.d/initramfs-tools ...
Installing new version of config file /etc/kernel/postrm.d/initramfs-tools ...
update-initramfs: deferring update (trigger activated)
Setting up msmtp (1.8.28-3) …
```

I’m happy to get you anything from this system that’ll help. It’s currently in this state, a reboot has not been attempted.

I don’t think the trouble stems from me not following release note instructions. Though some more digging may tell for sure, if you can tell me what to dig for.

Yours
Thorsten

From: Marc Haber <mh+debian-packages@zugschlus.de>
Date: Wednesday, August 20, 2025 at 9:00 PM

This is not the recommended way to upgrade Debian. While it usually
works, the safe and recommended way consists of a few more steps and is
outlined in the Release Notes.

It is also recommended to look at what apt says it will do.

Greetings
Marc

#1111649#31
Date:
2025-08-21 04:16:23 UTC
From:
To:
Good morning,

One more data point: sudo apt install --reinstall mdadm​ does not throw a warning about not detecting systemd. What’s more, after that, I can successfully reboot.

This isn’t necessarily conclusive, but gets close: I can reproduce the mdadm error message during initial sudo apt full-upgrade​ across multiple servers, after following release notes to verify disk space, update the bookworm system fully. And if I then reboot, “more often than not” that reboot will fail, with an error message by grub that it can’t find symbols. Typically that means EFI and installed grub don’t match.

And at least in this one case, doing an mdadm reinstall allowed me to reboot.

I can confirm by running this across more servers that are set up the same way. But before I do, I’ll hang loose and see what other data you might want from me.

Yours
Thorsten

From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Wednesday, August 20, 2025 at 9:16 PM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Sure, let’s take this a little slower.

Following release notes, get to the apt full-upgrade step:

```
debian@aztec-prover-test-11:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  g++-12 libabsl20220623 libaio1 libargon2-1 libassuan0 libavif15 libcbor0.8 libdav1d6 libfuse2 libfuse3-3 libicu72 libldap-2.5-0 libnetplan0 libnsl-dev libnsl2 libperl5.36
  libpython3.11 libpython3.11-dev libpython3.11-minimal libpython3.11-stdlib librav1e0 libstdc++-12-dev libsvtav1enc1 libtirpc-dev libutempter0 libx265-199 perl-modules-5.36
  python3-httplib2 python3-netifaces python3-pycurl python3-pyparsing python3-pyrsistent python3-pysimplesoap python3-serial python3-six python3.11 python3.11-dev python3.11-minimal
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libcurl3-gnutls libcurl4 libdb5.3 libefiboot1 libefivar1 libelf1 libext2fs2 libgdbm-compat4 libgdbm6 libglib2.0-0 libgnutls30 libhogweed6 libmagic1 libnettle8 libnpth0 libpcap0.8
  libpng16-16 libpsl5 libreadline8 libssh2-1 libssl3 libtirpc3 libuv1 python3-distutils python3-lib2to3
The following NEW packages will be installed:
  cpp-14 cpp-14-x86-64-linux-gnu cpp-x86-64-linux-gnu dracut-install firmware-ath9k-htc firmware-carl9170 firmware-intel-graphics firmware-intel-misc firmware-mediatek
  firmware-nvidia-graphics fonts-dejavu-mono g++-14 g++-14-x86-64-linux-gnu g++-x86-64-linux-gnu gcc-14 gcc-14-base gcc-14-x86-64-linux-gnu gcc-x86-64-linux-gnu grub-efi-amd64-unsigned
  initramfs-tools-bin libabsl20240722 libaio1t64 libapt-pkg7.0 libassuan9 libavif16 libcbor0.10 libcurl3t64-gnutls libcurl4t64 libdav1d7 libdb5.3t64 libefiboot1t64 libefivar1t64
  libelf1t64 libext2fs2t64 libfuse3-4 libgcc-14-dev libgdbm-compat4t64 libgdbm6t64 libglib2.0-0t64 libglib2.0-data libgnutls30t64 libheif-plugin-aomenc libheif-plugin-dav1d
  libheif-plugin-libde265 libheif-plugin-x265 libhogweed6t64 libhwasan0 libimagequant0 liblastlog2-2 libldap-common libldap2 libmagic1t64 libnetplan1 libnettle8t64 libnghttp3-9
  libngtcp2-16 libngtcp2-crypto-gnutls8 libnpth0t64 libpcap0.8t64 libperl5.40 libpng16-16t64 libpsl5t64 libpython3.13 libpython3.13-dev libpython3.13-minimal libpython3.13-stdlib
  librav1e0.7 libreadline8t64 libreiserfscore0t64 libsframe1 libsharpyuv0 libssh2-1t64 libssl3t64 libstdc++-14-dev libsvtav1enc2 libtext-charwidth-perl libtext-wrapi18n-perl
  libtirpc3t64 libunistring5 liburcu8t64 libuv1t64 libwtmpdb0 libx265-215 linux-image-6.12.41+deb13-amd64 linux-sysctl-defaults login.defs netcat-openbsd netplan-generator
  openssl-provider-legacy perl-modules-5.40 publicsuffix python3-arrow python3-autocommand python3-bcrypt python3-dateutil python3-fqdn python3-inflect python3-isoduration
  python3-jaraco.context python3-jaraco.functools python3-jaraco.text python3-jsonschema-specifications python3-linkify-it python3-more-itertools python3-netplan python3-packaging
  python3-referencing python3-rfc3339-validator python3-rfc3986-validator python3-rpds-py python3-typeguard python3-typeshed python3-typing-extensions python3-uc-micro python3-zipp
  python3.13 python3.13-dev python3.13-minimal shared-mime-info sqv systemd-cryptsetup xdg-user-dirs
The following packages have been kept back:
  teleport-ent
The following packages will be upgraded:
  adduser amd64-microcode apparmor apt apt-listchanges apt-utils base-files base-passwd bash bash-completion bc bind9-host bind9-libs binutils binutils-common binutils-x86-64-linux-gnu
  bsd-mailx bsdextrautils bsdutils btrfs-progs build-essential bzip2 ca-certificates chrony cloud-init cloud-initramfs-growroot containerd.io coreutils cpio cpp cpp-12 cron
  cron-daemon-common curl dash dbus dbus-bin dbus-daemon dbus-session-bus-common dbus-system-bus-common dbus-user-session debconf debian-archive-keyring debianutils diffutils dirmngr
  distro-info-data dmeventd dmsetup docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin dpkg dpkg-dev e2fsprogs eject ethtool fakeroot fdisk
  file findutils firmware-amd-graphics firmware-linux firmware-linux-free firmware-linux-nonfree firmware-misc-nonfree fontconfig-config fonts-dejavu-core g++ g++-12 gcc gcc-12
  gcc-12-base gdisk genisoimage gettext-base git git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grep groff-base grub-common
  grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed grub2-common gsasl-common gzip hostname htop init init-system-helpers initramfs-tools initramfs-tools-core intel-microcode
  iproute2 iptables iputils-ping isc-dhcp-client javascript-common jq klibc-utils kmod less libacl1 libalgorithm-diff-xs-perl libaom3 libapparmor1 libargon2-1 libasan8 libatomic1
  libattr1 libaudit-common libaudit1 libbinutils libblkid1 libbpf1 libbrotli1 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc-devtools libc-l10n libc6 libc6-dev libcap-ng0 libcap2
  libcap2-bin libcc1-0 libcom-err2 libcrypt-dev libcrypt1 libcryptsetup12 libctf-nobfd0 libctf0 libdbus-1-3 libde265-0 libdebconfclient0 libdeflate0 libdevmapper-event1.02.1
  libdevmapper1.02.1 libdpkg-perl libduktape207 libedit2 liberror-perl libexpat1 libexpat1-dev libfakeroot libfdisk1 libffi8 libfido2-1 libfile-fcntllock-perl libfontconfig1
  libfreetype6 libfstrm0 libgav1-1 libgcc-12-dev libgcc-s1 libgcrypt20 libgd3 libgmp10 libgomp1 libgpg-error0 libgpm2 libgprofng0 libgsasl18 libgssapi-krb5-2 libgssglue1 libheif1
  libidn12 libidn2-0 libintl-perl libintl-xs-perl libip4tc2 libip6tc2 libisl23 libitm1 libjansson4 libjbig0 libjemalloc2 libjpeg62-turbo libjq1 libjs-sphinxdoc libjson-c5 libk5crypto3
  libkeyutils1 libklibc libkmod2 libkrb5-3 libkrb5support0 libksba8 liblerc4 liblmdb0 liblocale-gettext-perl liblockfile-bin liblockfile1 liblsan0 liblvm2cmd2.03 liblz4-1 liblzma5
  liblzo2-2 libmagic-mgc libmaxminddb0 libmd0 libmnl0 libmodule-find-perl libmount1 libmpc3 libmpfr6 libncursesw6 libnetfilter-conntrack3 libnewt0.52 libnfnetlink0 libnftnl11
  libnghttp2-14 libnl-3-200 libnl-genl-3-200 libnsl-dev libnsl2 libnss-myhostname libntlm0 libnuma1 libonig5 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam-systemd
  libpam0g libpci3 libpcre2-8-0 libpipeline1 libpolkit-agent-1-0 libpolkit-gobject-1-0 libpopt0 libproc-processtable-perl libproc2-0 libprotobuf-c1 libpython3-dev libpython3-stdlib
  libquadmath0 librtmp1 libsasl2-2 libsasl2-modules-db libseccomp2 libsecret-1-0 libsecret-common libsecret-tools libselinux1 libsemanage-common libsemanage2 libsepol2 libslang2
  libslirp0 libsmartcols1 libsodium23 libsqlite3-0 libss2 libstdc++-12-dev libstdc++6 libsystemd-shared libsystemd0 libtasn1-6 libterm-readkey-perl libtiff6 libtinfo6 libtirpc-common
  libtirpc-dev libtsan2 libubsan1 libuchardet0 libudev1 liburing2 libutempter0 libuuid1 libwebp7 libwrap0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxtables12
  libxxhash0 libyaml-0-2 libyuv0 libzstd1 linux-base linux-image-amd64 linux-libc-dev locales login logsave lsb-release lvm2 make man-db manpages manpages-dev mawk mdadm media-types
  mokutil mount msmtp msmtp-mta nano ncurses-base ncurses-bin needrestart netbase netplan.io openssh-client openssh-server openssh-sftp-server openssl passwd patch pci.ids pciutils perl
  perl-base pigz pinentry-curses polkitd procps psmisc python-apt-common python3 python3-apt python3-attr python3-blinker python3-certifi python3-cffi-backend python3-chardet
  python3-charset-normalizer python3-configobj python3-cryptography python3-dbus python3-debconf python3-debian python3-debianbts python3-dev python3-distro python3-distro-info
  python3-httplib2 python3-idna python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-jwt python3-markdown-it python3-markupsafe python3-minimal
  python3-netifaces python3-oauthlib python3-pip python3-pkg-resources python3-pycurl python3-pygments python3-pyparsing python3-pyrsistent python3-reportbug python3-requests
  python3-rich python3-serial python3-setuptools python3-six python3-urllib3 python3-wheel python3-yaml qemu-utils readline-common reportbug runit-helper screen sed sensible-utils
  sgml-base shim-helpers-amd64-signed shim-signed shim-signed-common shim-unsigned slirp4netns smartmontools socat ssh-import-id sudo systemd systemd-resolved systemd-sysv
  sysvinit-utils tar tcpdump traceroute tzdata ucf udev ufw unattended-upgrades usr-is-merged util-linux util-linux-extra uuid-runtime vim vim-common vim-runtime vim-tiny wget whiptail
  xml-core xz-utils zlib1g zlib1g-dev zstd
430 upgraded, 122 newly installed, 25 to remove and 1 not upgraded.
Need to get 608 MB of archives.
After this operation, 655 MB of additional disk space will be used.
```

Say yes

Get the aforementioned error during “configuring mdadm”

Mdadm lines in term.log

```
Preparing to unpack .../118-mdadm_4.4-11_amd64.deb ...
Unpacking mdadm (4.4-11) over (4.2-5) ...
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev/rules.d': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/systemd/system-shutdown': Directory not empty
Preparing to unpack .../119-needrestart_3.11-1_all.deb …
…
Setting up mdadm (4.4-11) ...
Installing new version of config file /etc/logcheck/ignore.d.server/mdadm ...
update-initramfs: deferring update (trigger activated)
Generating grub configuration file ...
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.12.41+deb13-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-38-amd64
Found initrd image: /boot/initrd.img-6.1.0-38-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-37-amd64
Found initrd image: /boot/initrd.img-6.1.0-37-amd64
Adding boot menu entry for UEFI Firmware Settings ...
done
Removing obsolete conffile /etc/cron.d/mdadm ...
Removing obsolete conffile /etc/cron.daily/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm-waitidle ...
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_continue.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_continue.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_start.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_start.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdmonitor-oneshot.timer' <E2><86><92> '/usr/lib/systemd/system/mdmonitor-oneshot.timer'.
Setting up libpython3-stdlib:amd64 (3.13.5-1) ...
Setting up systemd-resolved (257.7-1) ...
Installing new version of config file /etc/systemd/resolved.conf ...
Setting up binutils-x86-64-linux-gnu (2.44-3) ...
Setting up libpython3.13:amd64 (3.13.5-2) ...
Setting up cpp-x86-64-linux-gnu (4:14.2.0-1) ...
Setting up needrestart (3.11-1) ...
Installing new version of config file /etc/needrestart/hook.d/10-dpkg ...
Installing new version of config file /etc/needrestart/hook.d/20-rpm ...
Installing new version of config file /etc/needrestart/hook.d/90-none ...
Installing new version of config file /etc/needrestart/needrestart.conf ...
Installing new version of config file /etc/needrestart/notify.d/200-write ...
Installing new version of config file /etc/needrestart/notify.d/400-notify-send ...
Installing new version of config file /etc/needrestart/notify.d/600-mail ...
Installing new version of config file /etc/needrestart/restart.d/dbus.service ...
Setting up gpg-agent (2.4.7-21+b3) ...
Installing new version of config file /etc/X11/Xsession.d/90gpg-agent ...
Setting up initramfs-tools (0.148.3) ...
Installing new version of config file /etc/kernel/postinst.d/initramfs-tools ...
Installing new version of config file /etc/kernel/postrm.d/initramfs-tools ...
update-initramfs: deferring update (trigger activated)
Setting up msmtp (1.8.28-3) …
```

I’m happy to get you anything from this system that’ll help. It’s currently in this state, a reboot has not been attempted.

I don’t think the trouble stems from me not following release note instructions. Though some more digging may tell for sure, if you can tell me what to dig for.

Yours
Thorsten

From: Marc Haber <mh+debian-packages@zugschlus.de>
Date: Wednesday, August 20, 2025 at 9:00 PM

This is not the recommended way to upgrade Debian. While it usually
works, the safe and recommended way consists of a few more steps and is
outlined in the Release Notes.

It is also recommended to look at what apt says it will do.

Greetings
Marc

#1111649#36
Date:
2025-08-21 04:39:04 UTC
From:
To:
I can reproduce the mdadm error message about missing systemd during apt full-upgrade to trixie from bookworm on all my servers I’ve tried, so far.

I can reproduce a reboot failing on most of them. It may be unrelated to the mdadm error message.

Yours
Thorsten

From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Thursday, August 21, 2025 at 5:16 AM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Good morning,

One more data point: sudo apt install --reinstall mdadm​ does not throw a warning about not detecting systemd. What’s more, after that, I can successfully reboot.

This isn’t necessarily conclusive, but gets close: I can reproduce the mdadm error message during initial sudo apt full-upgrade​ across multiple servers, after following release notes to verify disk space, update the bookworm system fully. And if I then reboot, “more often than not” that reboot will fail, with an error message by grub that it can’t find symbols. Typically that means EFI and installed grub don’t match.

And at least in this one case, doing an mdadm reinstall allowed me to reboot.

I can confirm by running this across more servers that are set up the same way. But before I do, I’ll hang loose and see what other data you might want from me.

Yours
Thorsten

From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Wednesday, August 20, 2025 at 9:16 PM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Sure, let’s take this a little slower.

Following release notes, get to the apt full-upgrade step:

```
debian@aztec-prover-test-11:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  g++-12 libabsl20220623 libaio1 libargon2-1 libassuan0 libavif15 libcbor0.8 libdav1d6 libfuse2 libfuse3-3 libicu72 libldap-2.5-0 libnetplan0 libnsl-dev libnsl2 libperl5.36
  libpython3.11 libpython3.11-dev libpython3.11-minimal libpython3.11-stdlib librav1e0 libstdc++-12-dev libsvtav1enc1 libtirpc-dev libutempter0 libx265-199 perl-modules-5.36
  python3-httplib2 python3-netifaces python3-pycurl python3-pyparsing python3-pyrsistent python3-pysimplesoap python3-serial python3-six python3.11 python3.11-dev python3.11-minimal
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libcurl3-gnutls libcurl4 libdb5.3 libefiboot1 libefivar1 libelf1 libext2fs2 libgdbm-compat4 libgdbm6 libglib2.0-0 libgnutls30 libhogweed6 libmagic1 libnettle8 libnpth0 libpcap0.8
  libpng16-16 libpsl5 libreadline8 libssh2-1 libssl3 libtirpc3 libuv1 python3-distutils python3-lib2to3
The following NEW packages will be installed:
  cpp-14 cpp-14-x86-64-linux-gnu cpp-x86-64-linux-gnu dracut-install firmware-ath9k-htc firmware-carl9170 firmware-intel-graphics firmware-intel-misc firmware-mediatek
  firmware-nvidia-graphics fonts-dejavu-mono g++-14 g++-14-x86-64-linux-gnu g++-x86-64-linux-gnu gcc-14 gcc-14-base gcc-14-x86-64-linux-gnu gcc-x86-64-linux-gnu grub-efi-amd64-unsigned
  initramfs-tools-bin libabsl20240722 libaio1t64 libapt-pkg7.0 libassuan9 libavif16 libcbor0.10 libcurl3t64-gnutls libcurl4t64 libdav1d7 libdb5.3t64 libefiboot1t64 libefivar1t64
  libelf1t64 libext2fs2t64 libfuse3-4 libgcc-14-dev libgdbm-compat4t64 libgdbm6t64 libglib2.0-0t64 libglib2.0-data libgnutls30t64 libheif-plugin-aomenc libheif-plugin-dav1d
  libheif-plugin-libde265 libheif-plugin-x265 libhogweed6t64 libhwasan0 libimagequant0 liblastlog2-2 libldap-common libldap2 libmagic1t64 libnetplan1 libnettle8t64 libnghttp3-9
  libngtcp2-16 libngtcp2-crypto-gnutls8 libnpth0t64 libpcap0.8t64 libperl5.40 libpng16-16t64 libpsl5t64 libpython3.13 libpython3.13-dev libpython3.13-minimal libpython3.13-stdlib
  librav1e0.7 libreadline8t64 libreiserfscore0t64 libsframe1 libsharpyuv0 libssh2-1t64 libssl3t64 libstdc++-14-dev libsvtav1enc2 libtext-charwidth-perl libtext-wrapi18n-perl
  libtirpc3t64 libunistring5 liburcu8t64 libuv1t64 libwtmpdb0 libx265-215 linux-image-6.12.41+deb13-amd64 linux-sysctl-defaults login.defs netcat-openbsd netplan-generator
  openssl-provider-legacy perl-modules-5.40 publicsuffix python3-arrow python3-autocommand python3-bcrypt python3-dateutil python3-fqdn python3-inflect python3-isoduration
  python3-jaraco.context python3-jaraco.functools python3-jaraco.text python3-jsonschema-specifications python3-linkify-it python3-more-itertools python3-netplan python3-packaging
  python3-referencing python3-rfc3339-validator python3-rfc3986-validator python3-rpds-py python3-typeguard python3-typeshed python3-typing-extensions python3-uc-micro python3-zipp
  python3.13 python3.13-dev python3.13-minimal shared-mime-info sqv systemd-cryptsetup xdg-user-dirs
The following packages have been kept back:
  teleport-ent
The following packages will be upgraded:
  adduser amd64-microcode apparmor apt apt-listchanges apt-utils base-files base-passwd bash bash-completion bc bind9-host bind9-libs binutils binutils-common binutils-x86-64-linux-gnu
  bsd-mailx bsdextrautils bsdutils btrfs-progs build-essential bzip2 ca-certificates chrony cloud-init cloud-initramfs-growroot containerd.io coreutils cpio cpp cpp-12 cron
  cron-daemon-common curl dash dbus dbus-bin dbus-daemon dbus-session-bus-common dbus-system-bus-common dbus-user-session debconf debian-archive-keyring debianutils diffutils dirmngr
  distro-info-data dmeventd dmsetup docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin dpkg dpkg-dev e2fsprogs eject ethtool fakeroot fdisk
  file findutils firmware-amd-graphics firmware-linux firmware-linux-free firmware-linux-nonfree firmware-misc-nonfree fontconfig-config fonts-dejavu-core g++ g++-12 gcc gcc-12
  gcc-12-base gdisk genisoimage gettext-base git git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grep groff-base grub-common
  grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed grub2-common gsasl-common gzip hostname htop init init-system-helpers initramfs-tools initramfs-tools-core intel-microcode
  iproute2 iptables iputils-ping isc-dhcp-client javascript-common jq klibc-utils kmod less libacl1 libalgorithm-diff-xs-perl libaom3 libapparmor1 libargon2-1 libasan8 libatomic1
  libattr1 libaudit-common libaudit1 libbinutils libblkid1 libbpf1 libbrotli1 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc-devtools libc-l10n libc6 libc6-dev libcap-ng0 libcap2
  libcap2-bin libcc1-0 libcom-err2 libcrypt-dev libcrypt1 libcryptsetup12 libctf-nobfd0 libctf0 libdbus-1-3 libde265-0 libdebconfclient0 libdeflate0 libdevmapper-event1.02.1
  libdevmapper1.02.1 libdpkg-perl libduktape207 libedit2 liberror-perl libexpat1 libexpat1-dev libfakeroot libfdisk1 libffi8 libfido2-1 libfile-fcntllock-perl libfontconfig1
  libfreetype6 libfstrm0 libgav1-1 libgcc-12-dev libgcc-s1 libgcrypt20 libgd3 libgmp10 libgomp1 libgpg-error0 libgpm2 libgprofng0 libgsasl18 libgssapi-krb5-2 libgssglue1 libheif1
  libidn12 libidn2-0 libintl-perl libintl-xs-perl libip4tc2 libip6tc2 libisl23 libitm1 libjansson4 libjbig0 libjemalloc2 libjpeg62-turbo libjq1 libjs-sphinxdoc libjson-c5 libk5crypto3
  libkeyutils1 libklibc libkmod2 libkrb5-3 libkrb5support0 libksba8 liblerc4 liblmdb0 liblocale-gettext-perl liblockfile-bin liblockfile1 liblsan0 liblvm2cmd2.03 liblz4-1 liblzma5
  liblzo2-2 libmagic-mgc libmaxminddb0 libmd0 libmnl0 libmodule-find-perl libmount1 libmpc3 libmpfr6 libncursesw6 libnetfilter-conntrack3 libnewt0.52 libnfnetlink0 libnftnl11
  libnghttp2-14 libnl-3-200 libnl-genl-3-200 libnsl-dev libnsl2 libnss-myhostname libntlm0 libnuma1 libonig5 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam-systemd
  libpam0g libpci3 libpcre2-8-0 libpipeline1 libpolkit-agent-1-0 libpolkit-gobject-1-0 libpopt0 libproc-processtable-perl libproc2-0 libprotobuf-c1 libpython3-dev libpython3-stdlib
  libquadmath0 librtmp1 libsasl2-2 libsasl2-modules-db libseccomp2 libsecret-1-0 libsecret-common libsecret-tools libselinux1 libsemanage-common libsemanage2 libsepol2 libslang2
  libslirp0 libsmartcols1 libsodium23 libsqlite3-0 libss2 libstdc++-12-dev libstdc++6 libsystemd-shared libsystemd0 libtasn1-6 libterm-readkey-perl libtiff6 libtinfo6 libtirpc-common
  libtirpc-dev libtsan2 libubsan1 libuchardet0 libudev1 liburing2 libutempter0 libuuid1 libwebp7 libwrap0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxtables12
  libxxhash0 libyaml-0-2 libyuv0 libzstd1 linux-base linux-image-amd64 linux-libc-dev locales login logsave lsb-release lvm2 make man-db manpages manpages-dev mawk mdadm media-types
  mokutil mount msmtp msmtp-mta nano ncurses-base ncurses-bin needrestart netbase netplan.io openssh-client openssh-server openssh-sftp-server openssl passwd patch pci.ids pciutils perl
  perl-base pigz pinentry-curses polkitd procps psmisc python-apt-common python3 python3-apt python3-attr python3-blinker python3-certifi python3-cffi-backend python3-chardet
  python3-charset-normalizer python3-configobj python3-cryptography python3-dbus python3-debconf python3-debian python3-debianbts python3-dev python3-distro python3-distro-info
  python3-httplib2 python3-idna python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-jwt python3-markdown-it python3-markupsafe python3-minimal
  python3-netifaces python3-oauthlib python3-pip python3-pkg-resources python3-pycurl python3-pygments python3-pyparsing python3-pyrsistent python3-reportbug python3-requests
  python3-rich python3-serial python3-setuptools python3-six python3-urllib3 python3-wheel python3-yaml qemu-utils readline-common reportbug runit-helper screen sed sensible-utils
  sgml-base shim-helpers-amd64-signed shim-signed shim-signed-common shim-unsigned slirp4netns smartmontools socat ssh-import-id sudo systemd systemd-resolved systemd-sysv
  sysvinit-utils tar tcpdump traceroute tzdata ucf udev ufw unattended-upgrades usr-is-merged util-linux util-linux-extra uuid-runtime vim vim-common vim-runtime vim-tiny wget whiptail
  xml-core xz-utils zlib1g zlib1g-dev zstd
430 upgraded, 122 newly installed, 25 to remove and 1 not upgraded.
Need to get 608 MB of archives.
After this operation, 655 MB of additional disk space will be used.
```

Say yes

Get the aforementioned error during “configuring mdadm”

Mdadm lines in term.log

```
Preparing to unpack .../118-mdadm_4.4-11_amd64.deb ...
Unpacking mdadm (4.4-11) over (4.2-5) ...
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev/rules.d': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/systemd/system-shutdown': Directory not empty
Preparing to unpack .../119-needrestart_3.11-1_all.deb …
…
Setting up mdadm (4.4-11) ...
Installing new version of config file /etc/logcheck/ignore.d.server/mdadm ...
update-initramfs: deferring update (trigger activated)
Generating grub configuration file ...
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.12.41+deb13-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-38-amd64
Found initrd image: /boot/initrd.img-6.1.0-38-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-37-amd64
Found initrd image: /boot/initrd.img-6.1.0-37-amd64
Adding boot menu entry for UEFI Firmware Settings ...
done
Removing obsolete conffile /etc/cron.d/mdadm ...
Removing obsolete conffile /etc/cron.daily/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm-waitidle ...
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_continue.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_continue.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_start.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_start.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdmonitor-oneshot.timer' <E2><86><92> '/usr/lib/systemd/system/mdmonitor-oneshot.timer'.
Setting up libpython3-stdlib:amd64 (3.13.5-1) ...
Setting up systemd-resolved (257.7-1) ...
Installing new version of config file /etc/systemd/resolved.conf ...
Setting up binutils-x86-64-linux-gnu (2.44-3) ...
Setting up libpython3.13:amd64 (3.13.5-2) ...
Setting up cpp-x86-64-linux-gnu (4:14.2.0-1) ...
Setting up needrestart (3.11-1) ...
Installing new version of config file /etc/needrestart/hook.d/10-dpkg ...
Installing new version of config file /etc/needrestart/hook.d/20-rpm ...
Installing new version of config file /etc/needrestart/hook.d/90-none ...
Installing new version of config file /etc/needrestart/needrestart.conf ...
Installing new version of config file /etc/needrestart/notify.d/200-write ...
Installing new version of config file /etc/needrestart/notify.d/400-notify-send ...
Installing new version of config file /etc/needrestart/notify.d/600-mail ...
Installing new version of config file /etc/needrestart/restart.d/dbus.service ...
Setting up gpg-agent (2.4.7-21+b3) ...
Installing new version of config file /etc/X11/Xsession.d/90gpg-agent ...
Setting up initramfs-tools (0.148.3) ...
Installing new version of config file /etc/kernel/postinst.d/initramfs-tools ...
Installing new version of config file /etc/kernel/postrm.d/initramfs-tools ...
update-initramfs: deferring update (trigger activated)
Setting up msmtp (1.8.28-3) …
```

I’m happy to get you anything from this system that’ll help. It’s currently in this state, a reboot has not been attempted.

I don’t think the trouble stems from me not following release note instructions. Though some more digging may tell for sure, if you can tell me what to dig for.

Yours
Thorsten

From: Marc Haber <mh+debian-packages@zugschlus.de>
Date: Wednesday, August 20, 2025 at 9:00 PM

This is not the recommended way to upgrade Debian. While it usually
works, the safe and recommended way consists of a few more steps and is
outlined in the Release Notes.

It is also recommended to look at what apt says it will do.

Greetings
Marc

#1111649#41
Date:
2025-08-21 04:45:11 UTC
From:
To:
Verifying that /, /boot and /boot/efi are mounted rw before the upgrade:

```
debian@aztec-prover-test-13:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             63G     0   63G   0% /dev
tmpfs            13G  2.0M   13G   1% /run
/dev/md3        878G   24G  809G   3% /
tmpfs            63G     0   63G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/md2        988M  126M  795M  14% /boot
/dev/nvme1n1p1  511M  5.9M  505M   2% /boot/efi
debian@aztec-prover-test-13:~$ grep "[[:space:]]ro[[:space:],]" /proc/mounts
ramfs /run/credentials/systemd-sysctl.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-sysusers.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-tmpfiles-setup-dev.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-tmpfiles-setup.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
​```


From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Thursday, August 21, 2025 at 5:39 AM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

And one more data point: While the mdadm reinstall doesn’t show an error message, it doesn’t resolve my grub/reboot issues. I tried it on one more machine and had the reboot issue again.

I can reproduce the mdadm error message about missing systemd during apt full-upgrade to trixie from bookworm on all my servers I’ve tried, so far.

I can reproduce a reboot failing on most of them. It may be unrelated to the mdadm error message.

Yours
Thorsten

From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Thursday, August 21, 2025 at 5:16 AM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Good morning,

One more data point: sudo apt install --reinstall mdadm​ does not throw a warning about not detecting systemd. What’s more, after that, I can successfully reboot.

This isn’t necessarily conclusive, but gets close: I can reproduce the mdadm error message during initial sudo apt full-upgrade​ across multiple servers, after following release notes to verify disk space, update the bookworm system fully. And if I then reboot, “more often than not” that reboot will fail, with an error message by grub that it can’t find symbols. Typically that means EFI and installed grub don’t match.

And at least in this one case, doing an mdadm reinstall allowed me to reboot.

I can confirm by running this across more servers that are set up the same way. But before I do, I’ll hang loose and see what other data you might want from me.

Yours
Thorsten

From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Wednesday, August 20, 2025 at 9:16 PM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Sure, let’s take this a little slower.

Following release notes, get to the apt full-upgrade step:

```
debian@aztec-prover-test-11:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  g++-12 libabsl20220623 libaio1 libargon2-1 libassuan0 libavif15 libcbor0.8 libdav1d6 libfuse2 libfuse3-3 libicu72 libldap-2.5-0 libnetplan0 libnsl-dev libnsl2 libperl5.36
  libpython3.11 libpython3.11-dev libpython3.11-minimal libpython3.11-stdlib librav1e0 libstdc++-12-dev libsvtav1enc1 libtirpc-dev libutempter0 libx265-199 perl-modules-5.36
  python3-httplib2 python3-netifaces python3-pycurl python3-pyparsing python3-pyrsistent python3-pysimplesoap python3-serial python3-six python3.11 python3.11-dev python3.11-minimal
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libcurl3-gnutls libcurl4 libdb5.3 libefiboot1 libefivar1 libelf1 libext2fs2 libgdbm-compat4 libgdbm6 libglib2.0-0 libgnutls30 libhogweed6 libmagic1 libnettle8 libnpth0 libpcap0.8
  libpng16-16 libpsl5 libreadline8 libssh2-1 libssl3 libtirpc3 libuv1 python3-distutils python3-lib2to3
The following NEW packages will be installed:
  cpp-14 cpp-14-x86-64-linux-gnu cpp-x86-64-linux-gnu dracut-install firmware-ath9k-htc firmware-carl9170 firmware-intel-graphics firmware-intel-misc firmware-mediatek
  firmware-nvidia-graphics fonts-dejavu-mono g++-14 g++-14-x86-64-linux-gnu g++-x86-64-linux-gnu gcc-14 gcc-14-base gcc-14-x86-64-linux-gnu gcc-x86-64-linux-gnu grub-efi-amd64-unsigned
  initramfs-tools-bin libabsl20240722 libaio1t64 libapt-pkg7.0 libassuan9 libavif16 libcbor0.10 libcurl3t64-gnutls libcurl4t64 libdav1d7 libdb5.3t64 libefiboot1t64 libefivar1t64
  libelf1t64 libext2fs2t64 libfuse3-4 libgcc-14-dev libgdbm-compat4t64 libgdbm6t64 libglib2.0-0t64 libglib2.0-data libgnutls30t64 libheif-plugin-aomenc libheif-plugin-dav1d
  libheif-plugin-libde265 libheif-plugin-x265 libhogweed6t64 libhwasan0 libimagequant0 liblastlog2-2 libldap-common libldap2 libmagic1t64 libnetplan1 libnettle8t64 libnghttp3-9
  libngtcp2-16 libngtcp2-crypto-gnutls8 libnpth0t64 libpcap0.8t64 libperl5.40 libpng16-16t64 libpsl5t64 libpython3.13 libpython3.13-dev libpython3.13-minimal libpython3.13-stdlib
  librav1e0.7 libreadline8t64 libreiserfscore0t64 libsframe1 libsharpyuv0 libssh2-1t64 libssl3t64 libstdc++-14-dev libsvtav1enc2 libtext-charwidth-perl libtext-wrapi18n-perl
  libtirpc3t64 libunistring5 liburcu8t64 libuv1t64 libwtmpdb0 libx265-215 linux-image-6.12.41+deb13-amd64 linux-sysctl-defaults login.defs netcat-openbsd netplan-generator
  openssl-provider-legacy perl-modules-5.40 publicsuffix python3-arrow python3-autocommand python3-bcrypt python3-dateutil python3-fqdn python3-inflect python3-isoduration
  python3-jaraco.context python3-jaraco.functools python3-jaraco.text python3-jsonschema-specifications python3-linkify-it python3-more-itertools python3-netplan python3-packaging
  python3-referencing python3-rfc3339-validator python3-rfc3986-validator python3-rpds-py python3-typeguard python3-typeshed python3-typing-extensions python3-uc-micro python3-zipp
  python3.13 python3.13-dev python3.13-minimal shared-mime-info sqv systemd-cryptsetup xdg-user-dirs
The following packages have been kept back:
  teleport-ent
The following packages will be upgraded:
  adduser amd64-microcode apparmor apt apt-listchanges apt-utils base-files base-passwd bash bash-completion bc bind9-host bind9-libs binutils binutils-common binutils-x86-64-linux-gnu
  bsd-mailx bsdextrautils bsdutils btrfs-progs build-essential bzip2 ca-certificates chrony cloud-init cloud-initramfs-growroot containerd.io coreutils cpio cpp cpp-12 cron
  cron-daemon-common curl dash dbus dbus-bin dbus-daemon dbus-session-bus-common dbus-system-bus-common dbus-user-session debconf debian-archive-keyring debianutils diffutils dirmngr
  distro-info-data dmeventd dmsetup docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin dpkg dpkg-dev e2fsprogs eject ethtool fakeroot fdisk
  file findutils firmware-amd-graphics firmware-linux firmware-linux-free firmware-linux-nonfree firmware-misc-nonfree fontconfig-config fonts-dejavu-core g++ g++-12 gcc gcc-12
  gcc-12-base gdisk genisoimage gettext-base git git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grep groff-base grub-common
  grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed grub2-common gsasl-common gzip hostname htop init init-system-helpers initramfs-tools initramfs-tools-core intel-microcode
  iproute2 iptables iputils-ping isc-dhcp-client javascript-common jq klibc-utils kmod less libacl1 libalgorithm-diff-xs-perl libaom3 libapparmor1 libargon2-1 libasan8 libatomic1
  libattr1 libaudit-common libaudit1 libbinutils libblkid1 libbpf1 libbrotli1 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc-devtools libc-l10n libc6 libc6-dev libcap-ng0 libcap2
  libcap2-bin libcc1-0 libcom-err2 libcrypt-dev libcrypt1 libcryptsetup12 libctf-nobfd0 libctf0 libdbus-1-3 libde265-0 libdebconfclient0 libdeflate0 libdevmapper-event1.02.1
  libdevmapper1.02.1 libdpkg-perl libduktape207 libedit2 liberror-perl libexpat1 libexpat1-dev libfakeroot libfdisk1 libffi8 libfido2-1 libfile-fcntllock-perl libfontconfig1
  libfreetype6 libfstrm0 libgav1-1 libgcc-12-dev libgcc-s1 libgcrypt20 libgd3 libgmp10 libgomp1 libgpg-error0 libgpm2 libgprofng0 libgsasl18 libgssapi-krb5-2 libgssglue1 libheif1
  libidn12 libidn2-0 libintl-perl libintl-xs-perl libip4tc2 libip6tc2 libisl23 libitm1 libjansson4 libjbig0 libjemalloc2 libjpeg62-turbo libjq1 libjs-sphinxdoc libjson-c5 libk5crypto3
  libkeyutils1 libklibc libkmod2 libkrb5-3 libkrb5support0 libksba8 liblerc4 liblmdb0 liblocale-gettext-perl liblockfile-bin liblockfile1 liblsan0 liblvm2cmd2.03 liblz4-1 liblzma5
  liblzo2-2 libmagic-mgc libmaxminddb0 libmd0 libmnl0 libmodule-find-perl libmount1 libmpc3 libmpfr6 libncursesw6 libnetfilter-conntrack3 libnewt0.52 libnfnetlink0 libnftnl11
  libnghttp2-14 libnl-3-200 libnl-genl-3-200 libnsl-dev libnsl2 libnss-myhostname libntlm0 libnuma1 libonig5 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam-systemd
  libpam0g libpci3 libpcre2-8-0 libpipeline1 libpolkit-agent-1-0 libpolkit-gobject-1-0 libpopt0 libproc-processtable-perl libproc2-0 libprotobuf-c1 libpython3-dev libpython3-stdlib
  libquadmath0 librtmp1 libsasl2-2 libsasl2-modules-db libseccomp2 libsecret-1-0 libsecret-common libsecret-tools libselinux1 libsemanage-common libsemanage2 libsepol2 libslang2
  libslirp0 libsmartcols1 libsodium23 libsqlite3-0 libss2 libstdc++-12-dev libstdc++6 libsystemd-shared libsystemd0 libtasn1-6 libterm-readkey-perl libtiff6 libtinfo6 libtirpc-common
  libtirpc-dev libtsan2 libubsan1 libuchardet0 libudev1 liburing2 libutempter0 libuuid1 libwebp7 libwrap0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxtables12
  libxxhash0 libyaml-0-2 libyuv0 libzstd1 linux-base linux-image-amd64 linux-libc-dev locales login logsave lsb-release lvm2 make man-db manpages manpages-dev mawk mdadm media-types
  mokutil mount msmtp msmtp-mta nano ncurses-base ncurses-bin needrestart netbase netplan.io openssh-client openssh-server openssh-sftp-server openssl passwd patch pci.ids pciutils perl
  perl-base pigz pinentry-curses polkitd procps psmisc python-apt-common python3 python3-apt python3-attr python3-blinker python3-certifi python3-cffi-backend python3-chardet
  python3-charset-normalizer python3-configobj python3-cryptography python3-dbus python3-debconf python3-debian python3-debianbts python3-dev python3-distro python3-distro-info
  python3-httplib2 python3-idna python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-jwt python3-markdown-it python3-markupsafe python3-minimal
  python3-netifaces python3-oauthlib python3-pip python3-pkg-resources python3-pycurl python3-pygments python3-pyparsing python3-pyrsistent python3-reportbug python3-requests
  python3-rich python3-serial python3-setuptools python3-six python3-urllib3 python3-wheel python3-yaml qemu-utils readline-common reportbug runit-helper screen sed sensible-utils
  sgml-base shim-helpers-amd64-signed shim-signed shim-signed-common shim-unsigned slirp4netns smartmontools socat ssh-import-id sudo systemd systemd-resolved systemd-sysv
  sysvinit-utils tar tcpdump traceroute tzdata ucf udev ufw unattended-upgrades usr-is-merged util-linux util-linux-extra uuid-runtime vim vim-common vim-runtime vim-tiny wget whiptail
  xml-core xz-utils zlib1g zlib1g-dev zstd
430 upgraded, 122 newly installed, 25 to remove and 1 not upgraded.
Need to get 608 MB of archives.
After this operation, 655 MB of additional disk space will be used.
```

Say yes

Get the aforementioned error during “configuring mdadm”

Mdadm lines in term.log

```
Preparing to unpack .../118-mdadm_4.4-11_amd64.deb ...
Unpacking mdadm (4.4-11) over (4.2-5) ...
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev/rules.d': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/systemd/system-shutdown': Directory not empty
Preparing to unpack .../119-needrestart_3.11-1_all.deb …
…
Setting up mdadm (4.4-11) ...
Installing new version of config file /etc/logcheck/ignore.d.server/mdadm ...
update-initramfs: deferring update (trigger activated)
Generating grub configuration file ...
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.12.41+deb13-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-38-amd64
Found initrd image: /boot/initrd.img-6.1.0-38-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-37-amd64
Found initrd image: /boot/initrd.img-6.1.0-37-amd64
Adding boot menu entry for UEFI Firmware Settings ...
done
Removing obsolete conffile /etc/cron.d/mdadm ...
Removing obsolete conffile /etc/cron.daily/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm-waitidle ...
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_continue.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_continue.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_start.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_start.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdmonitor-oneshot.timer' <E2><86><92> '/usr/lib/systemd/system/mdmonitor-oneshot.timer'.
Setting up libpython3-stdlib:amd64 (3.13.5-1) ...
Setting up systemd-resolved (257.7-1) ...
Installing new version of config file /etc/systemd/resolved.conf ...
Setting up binutils-x86-64-linux-gnu (2.44-3) ...
Setting up libpython3.13:amd64 (3.13.5-2) ...
Setting up cpp-x86-64-linux-gnu (4:14.2.0-1) ...
Setting up needrestart (3.11-1) ...
Installing new version of config file /etc/needrestart/hook.d/10-dpkg ...
Installing new version of config file /etc/needrestart/hook.d/20-rpm ...
Installing new version of config file /etc/needrestart/hook.d/90-none ...
Installing new version of config file /etc/needrestart/needrestart.conf ...
Installing new version of config file /etc/needrestart/notify.d/200-write ...
Installing new version of config file /etc/needrestart/notify.d/400-notify-send ...
Installing new version of config file /etc/needrestart/notify.d/600-mail ...
Installing new version of config file /etc/needrestart/restart.d/dbus.service ...
Setting up gpg-agent (2.4.7-21+b3) ...
Installing new version of config file /etc/X11/Xsession.d/90gpg-agent ...
Setting up initramfs-tools (0.148.3) ...
Installing new version of config file /etc/kernel/postinst.d/initramfs-tools ...
Installing new version of config file /etc/kernel/postrm.d/initramfs-tools ...
update-initramfs: deferring update (trigger activated)
Setting up msmtp (1.8.28-3) …
```

I’m happy to get you anything from this system that’ll help. It’s currently in this state, a reboot has not been attempted.

I don’t think the trouble stems from me not following release note instructions. Though some more digging may tell for sure, if you can tell me what to dig for.

Yours
Thorsten

From: Marc Haber <mh+debian-packages@zugschlus.de>
Date: Wednesday, August 20, 2025 at 9:00 PM

This is not the recommended way to upgrade Debian. While it usually
works, the safe and recommended way consists of a few more steps and is
outlined in the Release Notes.

It is also recommended to look at what apt says it will do.

Greetings
Marc

#1111649#46
Date:
2025-08-22 09:42:44 UTC
From:
To:
Continuing my investigation. Minimal reproduction:


  *
Prep system for bookworm->trixie upgrade as per release notes
  *
sudo apt update && sudo apt install mdadm​


This will bring up the error screen about systemd being the only supported init system. I wanted to see how it behaved outside of full-upgrade​ so I had a smaller reproduction.

Next I wanted to see whether this has anything to do with the order of upgrades.


  *
Prep system for bookworm->trixie upgrade as per release notes
  *
sudo apt update && sudo apt install systemd
  *
sudo apt update && sudo apt install mdadm

Yes. This does not​ cause the warning.

Current conclusion: When mdadm is updated before systemd during apt full-upgrade​, this causes a warning that the systemd init system cannot be found.

How to handle that is something you understand 100x better than I do. Systemd becomes a dependency so it’s always updated before mdadm? Trixie mdadm handles an older systemd as encountered during upgrade gracefully?

Yours
Thorsten


From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Thursday, August 21, 2025 at 5:45 AM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Verifying that /, /boot and /boot/efi are mounted rw before the upgrade:

```
debian@aztec-prover-test-13:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             63G     0   63G   0% /dev
tmpfs            13G  2.0M   13G   1% /run
/dev/md3        878G   24G  809G   3% /
tmpfs            63G     0   63G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/md2        988M  126M  795M  14% /boot
/dev/nvme1n1p1  511M  5.9M  505M   2% /boot/efi
debian@aztec-prover-test-13:~$ grep "[[:space:]]ro[[:space:],]" /proc/mounts
ramfs /run/credentials/systemd-sysctl.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-sysusers.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-tmpfiles-setup-dev.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-tmpfiles-setup.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
​```


From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Thursday, August 21, 2025 at 5:39 AM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

And one more data point: While the mdadm reinstall doesn’t show an error message, it doesn’t resolve my grub/reboot issues. I tried it on one more machine and had the reboot issue again.

I can reproduce the mdadm error message about missing systemd during apt full-upgrade to trixie from bookworm on all my servers I’ve tried, so far.

I can reproduce a reboot failing on most of them. It may be unrelated to the mdadm error message.

Yours
Thorsten

From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Thursday, August 21, 2025 at 5:16 AM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Good morning,

One more data point: sudo apt install --reinstall mdadm​ does not throw a warning about not detecting systemd. What’s more, after that, I can successfully reboot.

This isn’t necessarily conclusive, but gets close: I can reproduce the mdadm error message during initial sudo apt full-upgrade​ across multiple servers, after following release notes to verify disk space, update the bookworm system fully. And if I then reboot, “more often than not” that reboot will fail, with an error message by grub that it can’t find symbols. Typically that means EFI and installed grub don’t match.

And at least in this one case, doing an mdadm reinstall allowed me to reboot.

I can confirm by running this across more servers that are set up the same way. But before I do, I’ll hang loose and see what other data you might want from me.

Yours
Thorsten

From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Wednesday, August 20, 2025 at 9:16 PM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Sure, let’s take this a little slower.

Following release notes, get to the apt full-upgrade step:

```
debian@aztec-prover-test-11:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  g++-12 libabsl20220623 libaio1 libargon2-1 libassuan0 libavif15 libcbor0.8 libdav1d6 libfuse2 libfuse3-3 libicu72 libldap-2.5-0 libnetplan0 libnsl-dev libnsl2 libperl5.36
  libpython3.11 libpython3.11-dev libpython3.11-minimal libpython3.11-stdlib librav1e0 libstdc++-12-dev libsvtav1enc1 libtirpc-dev libutempter0 libx265-199 perl-modules-5.36
  python3-httplib2 python3-netifaces python3-pycurl python3-pyparsing python3-pyrsistent python3-pysimplesoap python3-serial python3-six python3.11 python3.11-dev python3.11-minimal
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libcurl3-gnutls libcurl4 libdb5.3 libefiboot1 libefivar1 libelf1 libext2fs2 libgdbm-compat4 libgdbm6 libglib2.0-0 libgnutls30 libhogweed6 libmagic1 libnettle8 libnpth0 libpcap0.8
  libpng16-16 libpsl5 libreadline8 libssh2-1 libssl3 libtirpc3 libuv1 python3-distutils python3-lib2to3
The following NEW packages will be installed:
  cpp-14 cpp-14-x86-64-linux-gnu cpp-x86-64-linux-gnu dracut-install firmware-ath9k-htc firmware-carl9170 firmware-intel-graphics firmware-intel-misc firmware-mediatek
  firmware-nvidia-graphics fonts-dejavu-mono g++-14 g++-14-x86-64-linux-gnu g++-x86-64-linux-gnu gcc-14 gcc-14-base gcc-14-x86-64-linux-gnu gcc-x86-64-linux-gnu grub-efi-amd64-unsigned
  initramfs-tools-bin libabsl20240722 libaio1t64 libapt-pkg7.0 libassuan9 libavif16 libcbor0.10 libcurl3t64-gnutls libcurl4t64 libdav1d7 libdb5.3t64 libefiboot1t64 libefivar1t64
  libelf1t64 libext2fs2t64 libfuse3-4 libgcc-14-dev libgdbm-compat4t64 libgdbm6t64 libglib2.0-0t64 libglib2.0-data libgnutls30t64 libheif-plugin-aomenc libheif-plugin-dav1d
  libheif-plugin-libde265 libheif-plugin-x265 libhogweed6t64 libhwasan0 libimagequant0 liblastlog2-2 libldap-common libldap2 libmagic1t64 libnetplan1 libnettle8t64 libnghttp3-9
  libngtcp2-16 libngtcp2-crypto-gnutls8 libnpth0t64 libpcap0.8t64 libperl5.40 libpng16-16t64 libpsl5t64 libpython3.13 libpython3.13-dev libpython3.13-minimal libpython3.13-stdlib
  librav1e0.7 libreadline8t64 libreiserfscore0t64 libsframe1 libsharpyuv0 libssh2-1t64 libssl3t64 libstdc++-14-dev libsvtav1enc2 libtext-charwidth-perl libtext-wrapi18n-perl
  libtirpc3t64 libunistring5 liburcu8t64 libuv1t64 libwtmpdb0 libx265-215 linux-image-6.12.41+deb13-amd64 linux-sysctl-defaults login.defs netcat-openbsd netplan-generator
  openssl-provider-legacy perl-modules-5.40 publicsuffix python3-arrow python3-autocommand python3-bcrypt python3-dateutil python3-fqdn python3-inflect python3-isoduration
  python3-jaraco.context python3-jaraco.functools python3-jaraco.text python3-jsonschema-specifications python3-linkify-it python3-more-itertools python3-netplan python3-packaging
  python3-referencing python3-rfc3339-validator python3-rfc3986-validator python3-rpds-py python3-typeguard python3-typeshed python3-typing-extensions python3-uc-micro python3-zipp
  python3.13 python3.13-dev python3.13-minimal shared-mime-info sqv systemd-cryptsetup xdg-user-dirs
The following packages have been kept back:
  teleport-ent
The following packages will be upgraded:
  adduser amd64-microcode apparmor apt apt-listchanges apt-utils base-files base-passwd bash bash-completion bc bind9-host bind9-libs binutils binutils-common binutils-x86-64-linux-gnu
  bsd-mailx bsdextrautils bsdutils btrfs-progs build-essential bzip2 ca-certificates chrony cloud-init cloud-initramfs-growroot containerd.io coreutils cpio cpp cpp-12 cron
  cron-daemon-common curl dash dbus dbus-bin dbus-daemon dbus-session-bus-common dbus-system-bus-common dbus-user-session debconf debian-archive-keyring debianutils diffutils dirmngr
  distro-info-data dmeventd dmsetup docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin dpkg dpkg-dev e2fsprogs eject ethtool fakeroot fdisk
  file findutils firmware-amd-graphics firmware-linux firmware-linux-free firmware-linux-nonfree firmware-misc-nonfree fontconfig-config fonts-dejavu-core g++ g++-12 gcc gcc-12
  gcc-12-base gdisk genisoimage gettext-base git git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grep groff-base grub-common
  grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed grub2-common gsasl-common gzip hostname htop init init-system-helpers initramfs-tools initramfs-tools-core intel-microcode
  iproute2 iptables iputils-ping isc-dhcp-client javascript-common jq klibc-utils kmod less libacl1 libalgorithm-diff-xs-perl libaom3 libapparmor1 libargon2-1 libasan8 libatomic1
  libattr1 libaudit-common libaudit1 libbinutils libblkid1 libbpf1 libbrotli1 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc-devtools libc-l10n libc6 libc6-dev libcap-ng0 libcap2
  libcap2-bin libcc1-0 libcom-err2 libcrypt-dev libcrypt1 libcryptsetup12 libctf-nobfd0 libctf0 libdbus-1-3 libde265-0 libdebconfclient0 libdeflate0 libdevmapper-event1.02.1
  libdevmapper1.02.1 libdpkg-perl libduktape207 libedit2 liberror-perl libexpat1 libexpat1-dev libfakeroot libfdisk1 libffi8 libfido2-1 libfile-fcntllock-perl libfontconfig1
  libfreetype6 libfstrm0 libgav1-1 libgcc-12-dev libgcc-s1 libgcrypt20 libgd3 libgmp10 libgomp1 libgpg-error0 libgpm2 libgprofng0 libgsasl18 libgssapi-krb5-2 libgssglue1 libheif1
  libidn12 libidn2-0 libintl-perl libintl-xs-perl libip4tc2 libip6tc2 libisl23 libitm1 libjansson4 libjbig0 libjemalloc2 libjpeg62-turbo libjq1 libjs-sphinxdoc libjson-c5 libk5crypto3
  libkeyutils1 libklibc libkmod2 libkrb5-3 libkrb5support0 libksba8 liblerc4 liblmdb0 liblocale-gettext-perl liblockfile-bin liblockfile1 liblsan0 liblvm2cmd2.03 liblz4-1 liblzma5
  liblzo2-2 libmagic-mgc libmaxminddb0 libmd0 libmnl0 libmodule-find-perl libmount1 libmpc3 libmpfr6 libncursesw6 libnetfilter-conntrack3 libnewt0.52 libnfnetlink0 libnftnl11
  libnghttp2-14 libnl-3-200 libnl-genl-3-200 libnsl-dev libnsl2 libnss-myhostname libntlm0 libnuma1 libonig5 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam-systemd
  libpam0g libpci3 libpcre2-8-0 libpipeline1 libpolkit-agent-1-0 libpolkit-gobject-1-0 libpopt0 libproc-processtable-perl libproc2-0 libprotobuf-c1 libpython3-dev libpython3-stdlib
  libquadmath0 librtmp1 libsasl2-2 libsasl2-modules-db libseccomp2 libsecret-1-0 libsecret-common libsecret-tools libselinux1 libsemanage-common libsemanage2 libsepol2 libslang2
  libslirp0 libsmartcols1 libsodium23 libsqlite3-0 libss2 libstdc++-12-dev libstdc++6 libsystemd-shared libsystemd0 libtasn1-6 libterm-readkey-perl libtiff6 libtinfo6 libtirpc-common
  libtirpc-dev libtsan2 libubsan1 libuchardet0 libudev1 liburing2 libutempter0 libuuid1 libwebp7 libwrap0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxtables12
  libxxhash0 libyaml-0-2 libyuv0 libzstd1 linux-base linux-image-amd64 linux-libc-dev locales login logsave lsb-release lvm2 make man-db manpages manpages-dev mawk mdadm media-types
  mokutil mount msmtp msmtp-mta nano ncurses-base ncurses-bin needrestart netbase netplan.io openssh-client openssh-server openssh-sftp-server openssl passwd patch pci.ids pciutils perl
  perl-base pigz pinentry-curses polkitd procps psmisc python-apt-common python3 python3-apt python3-attr python3-blinker python3-certifi python3-cffi-backend python3-chardet
  python3-charset-normalizer python3-configobj python3-cryptography python3-dbus python3-debconf python3-debian python3-debianbts python3-dev python3-distro python3-distro-info
  python3-httplib2 python3-idna python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-jwt python3-markdown-it python3-markupsafe python3-minimal
  python3-netifaces python3-oauthlib python3-pip python3-pkg-resources python3-pycurl python3-pygments python3-pyparsing python3-pyrsistent python3-reportbug python3-requests
  python3-rich python3-serial python3-setuptools python3-six python3-urllib3 python3-wheel python3-yaml qemu-utils readline-common reportbug runit-helper screen sed sensible-utils
  sgml-base shim-helpers-amd64-signed shim-signed shim-signed-common shim-unsigned slirp4netns smartmontools socat ssh-import-id sudo systemd systemd-resolved systemd-sysv
  sysvinit-utils tar tcpdump traceroute tzdata ucf udev ufw unattended-upgrades usr-is-merged util-linux util-linux-extra uuid-runtime vim vim-common vim-runtime vim-tiny wget whiptail
  xml-core xz-utils zlib1g zlib1g-dev zstd
430 upgraded, 122 newly installed, 25 to remove and 1 not upgraded.
Need to get 608 MB of archives.
After this operation, 655 MB of additional disk space will be used.
```

Say yes

Get the aforementioned error during “configuring mdadm”

Mdadm lines in term.log

```
Preparing to unpack .../118-mdadm_4.4-11_amd64.deb ...
Unpacking mdadm (4.4-11) over (4.2-5) ...
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev/rules.d': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/systemd/system-shutdown': Directory not empty
Preparing to unpack .../119-needrestart_3.11-1_all.deb …
…
Setting up mdadm (4.4-11) ...
Installing new version of config file /etc/logcheck/ignore.d.server/mdadm ...
update-initramfs: deferring update (trigger activated)
Generating grub configuration file ...
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.12.41+deb13-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-38-amd64
Found initrd image: /boot/initrd.img-6.1.0-38-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-37-amd64
Found initrd image: /boot/initrd.img-6.1.0-37-amd64
Adding boot menu entry for UEFI Firmware Settings ...
done
Removing obsolete conffile /etc/cron.d/mdadm ...
Removing obsolete conffile /etc/cron.daily/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm-waitidle ...
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_continue.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_continue.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_start.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_start.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdmonitor-oneshot.timer' <E2><86><92> '/usr/lib/systemd/system/mdmonitor-oneshot.timer'.
Setting up libpython3-stdlib:amd64 (3.13.5-1) ...
Setting up systemd-resolved (257.7-1) ...
Installing new version of config file /etc/systemd/resolved.conf ...
Setting up binutils-x86-64-linux-gnu (2.44-3) ...
Setting up libpython3.13:amd64 (3.13.5-2) ...
Setting up cpp-x86-64-linux-gnu (4:14.2.0-1) ...
Setting up needrestart (3.11-1) ...
Installing new version of config file /etc/needrestart/hook.d/10-dpkg ...
Installing new version of config file /etc/needrestart/hook.d/20-rpm ...
Installing new version of config file /etc/needrestart/hook.d/90-none ...
Installing new version of config file /etc/needrestart/needrestart.conf ...
Installing new version of config file /etc/needrestart/notify.d/200-write ...
Installing new version of config file /etc/needrestart/notify.d/400-notify-send ...
Installing new version of config file /etc/needrestart/notify.d/600-mail ...
Installing new version of config file /etc/needrestart/restart.d/dbus.service ...
Setting up gpg-agent (2.4.7-21+b3) ...
Installing new version of config file /etc/X11/Xsession.d/90gpg-agent ...
Setting up initramfs-tools (0.148.3) ...
Installing new version of config file /etc/kernel/postinst.d/initramfs-tools ...
Installing new version of config file /etc/kernel/postrm.d/initramfs-tools ...
update-initramfs: deferring update (trigger activated)
Setting up msmtp (1.8.28-3) …
```

I’m happy to get you anything from this system that’ll help. It’s currently in this state, a reboot has not been attempted.

I don’t think the trouble stems from me not following release note instructions. Though some more digging may tell for sure, if you can tell me what to dig for.

Yours
Thorsten

From: Marc Haber <mh+debian-packages@zugschlus.de>
Date: Wednesday, August 20, 2025 at 9:00 PM

This is not the recommended way to upgrade Debian. While it usually
works, the safe and recommended way consists of a few more steps and is
outlined in the Release Notes.

It is also recommended to look at what apt says it will do.

Greetings
Marc

#1111649#51
Date:
2025-08-22 16:41:27 UTC
From:
To:
My current conclusion:


  *
There is an order-of-operations issue when going from Debian 12 to Debian 13, where systemd has to be updated before mdadm. Not doing so triggers the error message about systemd missing.
  *

  *
Independent of this, I am seeing boot failures on at least half my fleet, after update. It’s related to grub somehow, but not resolved by working around the order-of-operations issue. That may become a separate bug report, and need not be discussed further in this one.


Yours
Thorsten


From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Friday, August 22, 2025 at 10:42 AM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Continuing my investigation. Minimal reproduction:


  *
Prep system for bookworm->trixie upgrade as per release notes
  *
sudo apt update && sudo apt install mdadm​


This will bring up the error screen about systemd being the only supported init system. I wanted to see how it behaved outside of full-upgrade​ so I had a smaller reproduction.

Next I wanted to see whether this has anything to do with the order of upgrades.


  *
Prep system for bookworm->trixie upgrade as per release notes
  *
sudo apt update && sudo apt install systemd
  *
sudo apt update && sudo apt install mdadm

Yes. This does not​ cause the warning.

Current conclusion: When mdadm is updated before systemd during apt full-upgrade​, this causes a warning that the systemd init system cannot be found.

How to handle that is something you understand 100x better than I do. Systemd becomes a dependency so it’s always updated before mdadm? Trixie mdadm handles an older systemd as encountered during upgrade gracefully?

Yours
Thorsten


From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Thursday, August 21, 2025 at 5:45 AM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Verifying that /, /boot and /boot/efi are mounted rw before the upgrade:

```
debian@aztec-prover-test-13:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             63G     0   63G   0% /dev
tmpfs            13G  2.0M   13G   1% /run
/dev/md3        878G   24G  809G   3% /
tmpfs            63G     0   63G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/md2        988M  126M  795M  14% /boot
/dev/nvme1n1p1  511M  5.9M  505M   2% /boot/efi
debian@aztec-prover-test-13:~$ grep "[[:space:]]ro[[:space:],]" /proc/mounts
ramfs /run/credentials/systemd-sysctl.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-sysusers.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-tmpfiles-setup-dev.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
ramfs /run/credentials/systemd-tmpfiles-setup.service ramfs ro,nosuid,nodev,noexec,relatime,mode=700 0 0
​```


From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Thursday, August 21, 2025 at 5:39 AM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

And one more data point: While the mdadm reinstall doesn’t show an error message, it doesn’t resolve my grub/reboot issues. I tried it on one more machine and had the reboot issue again.

I can reproduce the mdadm error message about missing systemd during apt full-upgrade to trixie from bookworm on all my servers I’ve tried, so far.

I can reproduce a reboot failing on most of them. It may be unrelated to the mdadm error message.

Yours
Thorsten

From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Thursday, August 21, 2025 at 5:16 AM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Good morning,

One more data point: sudo apt install --reinstall mdadm​ does not throw a warning about not detecting systemd. What’s more, after that, I can successfully reboot.

This isn’t necessarily conclusive, but gets close: I can reproduce the mdadm error message during initial sudo apt full-upgrade​ across multiple servers, after following release notes to verify disk space, update the bookworm system fully. And if I then reboot, “more often than not” that reboot will fail, with an error message by grub that it can’t find symbols. Typically that means EFI and installed grub don’t match.

And at least in this one case, doing an mdadm reinstall allowed me to reboot.

I can confirm by running this across more servers that are set up the same way. But before I do, I’ll hang loose and see what other data you might want from me.

Yours
Thorsten

From: Thorsten Behrens <Thorsten.Behrens@galaxy.com>
Date: Wednesday, August 20, 2025 at 9:16 PM
To: Marc Haber <mh+debian-packages@zugschlus.de>, 1111649@bugs.debian.org <1111649@bugs.debian.org>
Subject: Re: [EXT]Re: Bug#1111649: apt: Fails to detect systemd on mdadm system during dist-upgrade

Sure, let’s take this a little slower.

Following release notes, get to the apt full-upgrade step:

```
debian@aztec-prover-test-11:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  g++-12 libabsl20220623 libaio1 libargon2-1 libassuan0 libavif15 libcbor0.8 libdav1d6 libfuse2 libfuse3-3 libicu72 libldap-2.5-0 libnetplan0 libnsl-dev libnsl2 libperl5.36
  libpython3.11 libpython3.11-dev libpython3.11-minimal libpython3.11-stdlib librav1e0 libstdc++-12-dev libsvtav1enc1 libtirpc-dev libutempter0 libx265-199 perl-modules-5.36
  python3-httplib2 python3-netifaces python3-pycurl python3-pyparsing python3-pyrsistent python3-pysimplesoap python3-serial python3-six python3.11 python3.11-dev python3.11-minimal
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libcurl3-gnutls libcurl4 libdb5.3 libefiboot1 libefivar1 libelf1 libext2fs2 libgdbm-compat4 libgdbm6 libglib2.0-0 libgnutls30 libhogweed6 libmagic1 libnettle8 libnpth0 libpcap0.8
  libpng16-16 libpsl5 libreadline8 libssh2-1 libssl3 libtirpc3 libuv1 python3-distutils python3-lib2to3
The following NEW packages will be installed:
  cpp-14 cpp-14-x86-64-linux-gnu cpp-x86-64-linux-gnu dracut-install firmware-ath9k-htc firmware-carl9170 firmware-intel-graphics firmware-intel-misc firmware-mediatek
  firmware-nvidia-graphics fonts-dejavu-mono g++-14 g++-14-x86-64-linux-gnu g++-x86-64-linux-gnu gcc-14 gcc-14-base gcc-14-x86-64-linux-gnu gcc-x86-64-linux-gnu grub-efi-amd64-unsigned
  initramfs-tools-bin libabsl20240722 libaio1t64 libapt-pkg7.0 libassuan9 libavif16 libcbor0.10 libcurl3t64-gnutls libcurl4t64 libdav1d7 libdb5.3t64 libefiboot1t64 libefivar1t64
  libelf1t64 libext2fs2t64 libfuse3-4 libgcc-14-dev libgdbm-compat4t64 libgdbm6t64 libglib2.0-0t64 libglib2.0-data libgnutls30t64 libheif-plugin-aomenc libheif-plugin-dav1d
  libheif-plugin-libde265 libheif-plugin-x265 libhogweed6t64 libhwasan0 libimagequant0 liblastlog2-2 libldap-common libldap2 libmagic1t64 libnetplan1 libnettle8t64 libnghttp3-9
  libngtcp2-16 libngtcp2-crypto-gnutls8 libnpth0t64 libpcap0.8t64 libperl5.40 libpng16-16t64 libpsl5t64 libpython3.13 libpython3.13-dev libpython3.13-minimal libpython3.13-stdlib
  librav1e0.7 libreadline8t64 libreiserfscore0t64 libsframe1 libsharpyuv0 libssh2-1t64 libssl3t64 libstdc++-14-dev libsvtav1enc2 libtext-charwidth-perl libtext-wrapi18n-perl
  libtirpc3t64 libunistring5 liburcu8t64 libuv1t64 libwtmpdb0 libx265-215 linux-image-6.12.41+deb13-amd64 linux-sysctl-defaults login.defs netcat-openbsd netplan-generator
  openssl-provider-legacy perl-modules-5.40 publicsuffix python3-arrow python3-autocommand python3-bcrypt python3-dateutil python3-fqdn python3-inflect python3-isoduration
  python3-jaraco.context python3-jaraco.functools python3-jaraco.text python3-jsonschema-specifications python3-linkify-it python3-more-itertools python3-netplan python3-packaging
  python3-referencing python3-rfc3339-validator python3-rfc3986-validator python3-rpds-py python3-typeguard python3-typeshed python3-typing-extensions python3-uc-micro python3-zipp
  python3.13 python3.13-dev python3.13-minimal shared-mime-info sqv systemd-cryptsetup xdg-user-dirs
The following packages have been kept back:
  teleport-ent
The following packages will be upgraded:
  adduser amd64-microcode apparmor apt apt-listchanges apt-utils base-files base-passwd bash bash-completion bc bind9-host bind9-libs binutils binutils-common binutils-x86-64-linux-gnu
  bsd-mailx bsdextrautils bsdutils btrfs-progs build-essential bzip2 ca-certificates chrony cloud-init cloud-initramfs-growroot containerd.io coreutils cpio cpp cpp-12 cron
  cron-daemon-common curl dash dbus dbus-bin dbus-daemon dbus-session-bus-common dbus-system-bus-common dbus-user-session debconf debian-archive-keyring debianutils diffutils dirmngr
  distro-info-data dmeventd dmsetup docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin dpkg dpkg-dev e2fsprogs eject ethtool fakeroot fdisk
  file findutils firmware-amd-graphics firmware-linux firmware-linux-free firmware-linux-nonfree firmware-misc-nonfree fontconfig-config fonts-dejavu-core g++ g++-12 gcc gcc-12
  gcc-12-base gdisk genisoimage gettext-base git git-man gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv grep groff-base grub-common
  grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed grub2-common gsasl-common gzip hostname htop init init-system-helpers initramfs-tools initramfs-tools-core intel-microcode
  iproute2 iptables iputils-ping isc-dhcp-client javascript-common jq klibc-utils kmod less libacl1 libalgorithm-diff-xs-perl libaom3 libapparmor1 libargon2-1 libasan8 libatomic1
  libattr1 libaudit-common libaudit1 libbinutils libblkid1 libbpf1 libbrotli1 libbsd0 libbz2-1.0 libc-bin libc-dev-bin libc-devtools libc-l10n libc6 libc6-dev libcap-ng0 libcap2
  libcap2-bin libcc1-0 libcom-err2 libcrypt-dev libcrypt1 libcryptsetup12 libctf-nobfd0 libctf0 libdbus-1-3 libde265-0 libdebconfclient0 libdeflate0 libdevmapper-event1.02.1
  libdevmapper1.02.1 libdpkg-perl libduktape207 libedit2 liberror-perl libexpat1 libexpat1-dev libfakeroot libfdisk1 libffi8 libfido2-1 libfile-fcntllock-perl libfontconfig1
  libfreetype6 libfstrm0 libgav1-1 libgcc-12-dev libgcc-s1 libgcrypt20 libgd3 libgmp10 libgomp1 libgpg-error0 libgpm2 libgprofng0 libgsasl18 libgssapi-krb5-2 libgssglue1 libheif1
  libidn12 libidn2-0 libintl-perl libintl-xs-perl libip4tc2 libip6tc2 libisl23 libitm1 libjansson4 libjbig0 libjemalloc2 libjpeg62-turbo libjq1 libjs-sphinxdoc libjson-c5 libk5crypto3
  libkeyutils1 libklibc libkmod2 libkrb5-3 libkrb5support0 libksba8 liblerc4 liblmdb0 liblocale-gettext-perl liblockfile-bin liblockfile1 liblsan0 liblvm2cmd2.03 liblz4-1 liblzma5
  liblzo2-2 libmagic-mgc libmaxminddb0 libmd0 libmnl0 libmodule-find-perl libmount1 libmpc3 libmpfr6 libncursesw6 libnetfilter-conntrack3 libnewt0.52 libnfnetlink0 libnftnl11
  libnghttp2-14 libnl-3-200 libnl-genl-3-200 libnsl-dev libnsl2 libnss-myhostname libntlm0 libnuma1 libonig5 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam-systemd
  libpam0g libpci3 libpcre2-8-0 libpipeline1 libpolkit-agent-1-0 libpolkit-gobject-1-0 libpopt0 libproc-processtable-perl libproc2-0 libprotobuf-c1 libpython3-dev libpython3-stdlib
  libquadmath0 librtmp1 libsasl2-2 libsasl2-modules-db libseccomp2 libsecret-1-0 libsecret-common libsecret-tools libselinux1 libsemanage-common libsemanage2 libsepol2 libslang2
  libslirp0 libsmartcols1 libsodium23 libsqlite3-0 libss2 libstdc++-12-dev libstdc++6 libsystemd-shared libsystemd0 libtasn1-6 libterm-readkey-perl libtiff6 libtinfo6 libtirpc-common
  libtirpc-dev libtsan2 libubsan1 libuchardet0 libudev1 liburing2 libutempter0 libuuid1 libwebp7 libwrap0 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxml2 libxpm4 libxtables12
  libxxhash0 libyaml-0-2 libyuv0 libzstd1 linux-base linux-image-amd64 linux-libc-dev locales login logsave lsb-release lvm2 make man-db manpages manpages-dev mawk mdadm media-types
  mokutil mount msmtp msmtp-mta nano ncurses-base ncurses-bin needrestart netbase netplan.io openssh-client openssh-server openssh-sftp-server openssl passwd patch pci.ids pciutils perl
  perl-base pigz pinentry-curses polkitd procps psmisc python-apt-common python3 python3-apt python3-attr python3-blinker python3-certifi python3-cffi-backend python3-chardet
  python3-charset-normalizer python3-configobj python3-cryptography python3-dbus python3-debconf python3-debian python3-debianbts python3-dev python3-distro python3-distro-info
  python3-httplib2 python3-idna python3-jinja2 python3-json-pointer python3-jsonpatch python3-jsonschema python3-jwt python3-markdown-it python3-markupsafe python3-minimal
  python3-netifaces python3-oauthlib python3-pip python3-pkg-resources python3-pycurl python3-pygments python3-pyparsing python3-pyrsistent python3-reportbug python3-requests
  python3-rich python3-serial python3-setuptools python3-six python3-urllib3 python3-wheel python3-yaml qemu-utils readline-common reportbug runit-helper screen sed sensible-utils
  sgml-base shim-helpers-amd64-signed shim-signed shim-signed-common shim-unsigned slirp4netns smartmontools socat ssh-import-id sudo systemd systemd-resolved systemd-sysv
  sysvinit-utils tar tcpdump traceroute tzdata ucf udev ufw unattended-upgrades usr-is-merged util-linux util-linux-extra uuid-runtime vim vim-common vim-runtime vim-tiny wget whiptail
  xml-core xz-utils zlib1g zlib1g-dev zstd
430 upgraded, 122 newly installed, 25 to remove and 1 not upgraded.
Need to get 608 MB of archives.
After this operation, 655 MB of additional disk space will be used.
```

Say yes

Get the aforementioned error during “configuring mdadm”

Mdadm lines in term.log

```
Preparing to unpack .../118-mdadm_4.4-11_amd64.deb ...
Unpacking mdadm (4.4-11) over (4.2-5) ...
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev/rules.d': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/udev': Directory not empty
ESC[1mdpkg:ESC[0m ESC[1;33mwarning:ESC[0m unable to delete old directory '/lib/systemd/system-shutdown': Directory not empty
Preparing to unpack .../119-needrestart_3.11-1_all.deb …
…
Setting up mdadm (4.4-11) ...
Installing new version of config file /etc/logcheck/ignore.d.server/mdadm ...
update-initramfs: deferring update (trigger activated)
Generating grub configuration file ...
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.12.41+deb13-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Warning: version_test_numeric() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-38-amd64
Found initrd image: /boot/initrd.img-6.1.0-38-amd64
Warning: version_find_latest() is deprecated. Use version_sort() instead.
Warning: version_test_gt() is deprecated. Use version_sort() instead.
Found linux image: /boot/vmlinuz-6.1.0-37-amd64
Found initrd image: /boot/initrd.img-6.1.0-37-amd64
Adding boot menu entry for UEFI Firmware Settings ...
done
Removing obsolete conffile /etc/cron.d/mdadm ...
Removing obsolete conffile /etc/cron.daily/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm ...
Removing obsolete conffile /etc/init.d/mdadm-waitidle ...
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_continue.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_continue.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdcheck_start.timer' <E2><86><92> '/usr/lib/systemd/system/mdcheck_start.timer'.
Created symlink '/etc/systemd/system/mdmonitor.service.wants/mdmonitor-oneshot.timer' <E2><86><92> '/usr/lib/systemd/system/mdmonitor-oneshot.timer'.
Setting up libpython3-stdlib:amd64 (3.13.5-1) ...
Setting up systemd-resolved (257.7-1) ...
Installing new version of config file /etc/systemd/resolved.conf ...
Setting up binutils-x86-64-linux-gnu (2.44-3) ...
Setting up libpython3.13:amd64 (3.13.5-2) ...
Setting up cpp-x86-64-linux-gnu (4:14.2.0-1) ...
Setting up needrestart (3.11-1) ...
Installing new version of config file /etc/needrestart/hook.d/10-dpkg ...
Installing new version of config file /etc/needrestart/hook.d/20-rpm ...
Installing new version of config file /etc/needrestart/hook.d/90-none ...
Installing new version of config file /etc/needrestart/needrestart.conf ...
Installing new version of config file /etc/needrestart/notify.d/200-write ...
Installing new version of config file /etc/needrestart/notify.d/400-notify-send ...
Installing new version of config file /etc/needrestart/notify.d/600-mail ...
Installing new version of config file /etc/needrestart/restart.d/dbus.service ...
Setting up gpg-agent (2.4.7-21+b3) ...
Installing new version of config file /etc/X11/Xsession.d/90gpg-agent ...
Setting up initramfs-tools (0.148.3) ...
Installing new version of config file /etc/kernel/postinst.d/initramfs-tools ...
Installing new version of config file /etc/kernel/postrm.d/initramfs-tools ...
update-initramfs: deferring update (trigger activated)
Setting up msmtp (1.8.28-3) …
```

I’m happy to get you anything from this system that’ll help. It’s currently in this state, a reboot has not been attempted.

I don’t think the trouble stems from me not following release note instructions. Though some more digging may tell for sure, if you can tell me what to dig for.

Yours
Thorsten

From: Marc Haber <mh+debian-packages@zugschlus.de>
Date: Wednesday, August 20, 2025 at 9:00 PM

This is not the recommended way to upgrade Debian. While it usually
works, the safe and recommended way consists of a few more steps and is
outlined in the Release Notes.

It is also recommended to look at what apt says it will do.

Greetings
Marc

#1111649#56
Date:
2025-09-08 06:36:17 UTC
From:
To:
This issue remains present when going from 12.12 -> 13.1.

Recap:

There is an order-of-operations issue when going from Debian 12 to Debian 13, where systemd has to be updated before mdadm. Not doing so triggers the error message about systemd missing.

Minimal reproduction:


  *
Prep system for bookworm->trixie upgrade as per release notes
  *
sudo apt update && sudo apt install mdadm​

This will bring up the error screen about systemd being the only supported init system. I wanted to see how it behaved outside of full-upgrade​ so I had a smaller reproduction.

Next I wanted to see whether this has anything to do with the order of upgrades.


  *
Prep system for bookworm->trixie upgrade as per release notes
  *
sudo apt update && sudo apt install systemd
  *
sudo apt update && sudo apt install mdadm

This does not​ cause the warning.

Current conclusion: When mdadm is updated before systemd during apt full-upgrade​, this causes a warning that the systemd init system cannot be found.

A workaround can be to hold mdadm, run the full-upgrade, unhold mdadm, and run full-upgrade again. Alternatively, running an apt install systemd, then running full-upgrade, will also succeed.

How to handle that is something you understand 100x better than I do. Systemd becomes a dependency so it’s always updated before mdadm? Trixie mdadm handles an older systemd as encountered during upgrade gracefully?

Yours
Thorsten
Please see the important legal disclaimer at https://www.galaxy.com/email-disclaimer which must be read and considered in connection with the information in and attached to this email.

#1111649#61
Date:
2026-04-27 22:33:03 UTC
From:
To:
Hello mdadm maintainers,

Testing this upgrade behavior again from Debian 12.13 to Debian 13.4, the error messages mdadm used to show have been resolved. Thank you.

This bug can be closed

Kind Regards
Thorsten

#1111649#66
Date:
2026-04-28 05:46:09 UTC
From:
To:
close 1111649 4.4-11
thanks

Hi,

thanks, closing then hereby.

Regards,
Daniel