Page MenuHomePhabricator

Swap partition issue when installing a DB with Debian Trixie
Closed, ResolvedPublic

Description

When doing a reimage of es1033 with reuse-parts.cfg (where we basically preserve /srv dir) I am running into issues in the installer - see below screenshot

Captura de pantalla 2025-10-30 a las 9.08.50.png (536×247 px, 30 KB)

If I hit "No" the system installs correctly (of course without swap, which is not what we want but still, seems to be the only issue).

I've not tested the installation with partman/custom/db.cfg yet (which formats /srv)

Details

Event Timeline

This also seems to happen with - partman/custom/db.cfg as well so not only with reuse-parts.cfg
I discussed with @MoritzMuehlenhoff whether it is a good moment to migrate our installs to UEFI and stop using legacy BIOS. We don't really have any strong preference on any or other method, whatever is easier for everyone.
The only requirement is to keep being able to reimage hosts with the option to keep /srv intact and another recipe to fully format the OS.

Change #1202047 had a related patch set uploaded (by Marostegui; author: Marostegui):

[operations/puppet@production] installserver: Remove es2028

https://gerrit.wikimedia.org/r/1202047

Change #1202047 merged by Marostegui:

[operations/puppet@production] installserver: Remove es2028

https://gerrit.wikimedia.org/r/1202047

Change #1202918 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] preseed: Configure es2028 with db.cfg

https://gerrit.wikimedia.org/r/1202918

Change #1202918 merged by Muehlenhoff:

[operations/puppet@production] preseed: Configure es2028 with db.cfg

https://gerrit.wikimedia.org/r/1202918

I've debugged this and the issue is unrelated to the Partman recipe, but what makes it fail is the pre-existing swap partition. The swap partition is correctly parsed and detected by d-i, but ultimately when the d-i component responsible for setting up swap (partman-basicfilesystems) attempts to create the swap partition using "mkswap /dev/sda2" this fails with

mkswap: write error: Text file busy

And in fact the existing swap partition is activated:

~ # cat /proc/swaps
Filename                                Type            Size            Used            Priority
/dev/sda2                               partition       7812092         0               -2

That also explains that if one acknowledges the error message over the serial console, the installation simply proceeds fine (since the pre-existing swap partition simply continues to be used).

Maybe something changed in an earlier part of d-i or maybe the initrd, so that a pre-existing swap partition from an earlier installation is now activated, but wasn't with Bookworm? Needs to be narrowed down further.

Change #1203011 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Add temporary trixie variant of db.cfg for debugging

https://gerrit.wikimedia.org/r/1203011

Change #1203011 merged by Muehlenhoff:

[operations/puppet@production] Add temporary trixie variant of db.cfg for debugging

https://gerrit.wikimedia.org/r/1203011

Change #1203030 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Add temporary trixie variant of db.cfg for debugging

https://gerrit.wikimedia.org/r/1203030

Change #1203030 merged by Muehlenhoff:

[operations/puppet@production] Add temporary trixie variant of db.cfg for debugging

https://gerrit.wikimedia.org/r/1203030

Change #1203770 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] partman: Test Partman recipe for DB reuse on trixie

https://gerrit.wikimedia.org/r/1203770

Change #1203770 merged by Muehlenhoff:

[operations/puppet@production] partman: Test Partman recipe for DB reuse on trixie

https://gerrit.wikimedia.org/r/1203770

Change #1203778 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Test Partman workaround to also cover the reuse workflow

https://gerrit.wikimedia.org/r/1203778

Change #1203778 merged by Muehlenhoff:

[operations/puppet@production] Test Partman workaround to also cover the reuse workflow

https://gerrit.wikimedia.org/r/1203778

Change #1203788 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] es2028: Test standard reuse recipe

https://gerrit.wikimedia.org/r/1203788

Change #1203788 merged by Muehlenhoff:

[operations/puppet@production] es2028: Test standard reuse recipe

https://gerrit.wikimedia.org/r/1203788

Change #1203806 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] reuse-db-trixie.cfg: Try different option

https://gerrit.wikimedia.org/r/1203806

Change #1203806 merged by Muehlenhoff:

[operations/puppet@production] reuse-db-trixie.cfg: Try different option

https://gerrit.wikimedia.org/r/1203806

Change #1203847 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Cleanup unused setting

https://gerrit.wikimedia.org/r/1203847

Change #1203847 merged by Muehlenhoff:

[operations/puppet@production] Cleanup unused setting

https://gerrit.wikimedia.org/r/1203847

The reason we haven't seen this behaviour so far is most probably because all the other roles on trixie either use the flat layout of a VM or an LVM-based Partman recipe (while the DB layouts don't use LVM).

I'm going to report this to Debian next week (and plan to propose a patch to address this by scanning currently used swap in partman-basicfilesystems and then running swapoff on them).

But to unblock us, I've also created a workaround:

  • partman/custom/db-trixie.cfg is identical to db.cfg but has been extended to skip the confirmation dialogue in d-i (which is perfectly fine, since we can simply reuse the existing swap partition, the format hasn't changed since the Linux 1.x)
  • reuse-db-trixie.cfg also needed a patch to suppress a warning about the swap partition

As a test I installed es2028 with trixie, placed a dummy file in /srv and reinstalled with reuse-db-trixie.cfg and the file in /srv was kept.

One question is whether we want to integrate the trixie changes into the existing db variants. It's probably fine (given the conditions don't trigger on Bookworm), but needs testing for confirmation.

Thanks @MoritzMuehlenhoff for debugging and finding a workaround for this.
I think ideally we should try to integrate the changes so we don't have to keep track of both files whilst we do the migration. We are very far from migrating so maybe we can try to integrate them in the mean time, but this is of course up to you and if you'd have time for it.
This would simplify the migration, as we'd not need to maintain to different regex and move hosts while migrating them.

Thanks again for the time.

As we've discussed on IRC, I will try to reimage es2028 back to bookworm using partman/custom/reuse-db-trixie.cfg and see how it goes.

Change #1206067 had a related patch set uploaded (by Marostegui; author: Marostegui):

[operations/puppet@production] installserver: Configure es2028 with db-trixie.cfg

https://gerrit.wikimedia.org/r/1206067

Change #1206067 merged by Marostegui:

[operations/puppet@production] installserver: Configure es2028 with db-trixie.cfg

https://gerrit.wikimedia.org/r/1206067

Cookbook cookbooks.sre.hosts.reimage was started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm

Cookbook cookbooks.sre.hosts.reimage started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm completed:

  • es2028 (WARN)
    • Downtimed on Icinga/Alertmanager
    • Disabled Puppet
    • Removed from Puppet and PuppetDB if present and deleted any certificates
    • Removed from Debmonitor if present
    • Forced PXE for next reboot
    • Host rebooted via IPMI
    • Host up (Debian installer)
    • Add puppet_version metadata (7) to Debian installer
    • Checked BIOS boot parameters are back to normal
    • Host up (new fresh bookworm OS)
    • Generated Puppet certificate
    • Signed new Puppet certificate
    • Run Puppet in NOOP mode to populate exported resources in PuppetDB
    • Found Nagios_host resource for this host in PuppetDB
    • Downtimed the new host on Icinga/Alertmanager
    • Removed previous downtime on Alertmanager (old OS)
    • First Puppet run completed and logged in /var/log/spicerack/sre/hosts/reimage/202511170744_marostegui_929371_es2028.out
    • configmaster.wikimedia.org updated with the host new SSH public key for wmf-update-known-hosts-production
    • Rebooted
    • Automatic Puppet run was successful
    • Forced a re-check of all Icinga services for the host
    • Icinga status is not optimal, downtime not removed
    • Updated Netbox data from PuppetDB

Cookbook cookbooks.sre.hosts.reimage was started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm

Cookbook cookbooks.sre.hosts.reimage started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm completed:

  • es2028 (WARN)
    • Downtimed on Icinga/Alertmanager
    • Disabled Puppet
    • Removed from Puppet and PuppetDB if present and deleted any certificates
    • Removed from Debmonitor if present
    • Forced PXE for next reboot
    • Host rebooted via IPMI
    • Host up (Debian installer)
    • Add puppet_version metadata (7) to Debian installer
    • Checked BIOS boot parameters are back to normal
    • Host up (new fresh bookworm OS)
    • Generated Puppet certificate
    • Signed new Puppet certificate
    • Run Puppet in NOOP mode to populate exported resources in PuppetDB
    • Found Nagios_host resource for this host in PuppetDB
    • Downtimed the new host on Icinga/Alertmanager
    • Removed previous downtime on Alertmanager (old OS)
    • First Puppet run completed and logged in /var/log/spicerack/sre/hosts/reimage/202511170854_marostegui_937644_es2028.out
    • Unable to run puppet on config-master2001.codfw.wmnet,config-master1001.eqiad.wmnet to update configmaster.wikimedia.org with the new host SSH public key for wmf-update-known-hosts-production
    • Rebooted
    • Automatic Puppet run was successful
    • Forced a re-check of all Icinga services for the host
    • Icinga status is not optimal, downtime not removed
    • Updated Netbox data from PuppetDB

Cookbook cookbooks.sre.hosts.reimage was started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS trixie

Change #1206195 had a related patch set uploaded (by Marostegui; author: Marostegui):

[operations/puppet@production] installserver: Reformat es2028

https://gerrit.wikimedia.org/r/1206195

Change #1206195 merged by Marostegui:

[operations/puppet@production] installserver: Reformat es2028

https://gerrit.wikimedia.org/r/1206195

Cookbook cookbooks.sre.hosts.reimage started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS trixie completed:

  • es2028 (WARN)
    • Downtimed on Icinga/Alertmanager
    • Disabled Puppet
    • Removed from Puppet and PuppetDB if present and deleted any certificates
    • Removed from Debmonitor if present
    • Forced PXE for next reboot
    • Host rebooted via IPMI
    • Host up (Debian installer)
    • Add puppet_version metadata (7) to Debian installer
    • Checked BIOS boot parameters are back to normal
    • Host up (new fresh trixie OS)
    • Generated Puppet certificate
    • Signed new Puppet certificate
    • Run Puppet in NOOP mode to populate exported resources in PuppetDB
    • Found Nagios_host resource for this host in PuppetDB
    • Downtimed the new host on Icinga/Alertmanager
    • Removed previous downtime on Alertmanager (old OS)
    • First Puppet run completed and logged in /var/log/spicerack/sre/hosts/reimage/202511170938_marostegui_943606_es2028.out
    • configmaster.wikimedia.org updated with the host new SSH public key for wmf-update-known-hosts-production
    • Rebooted
    • Automatic Puppet run was successful
    • Forced a re-check of all Icinga services for the host
    • Icinga status is not optimal, downtime not removed
    • Updated Netbox data from PuppetDB

Cookbook cookbooks.sre.hosts.reimage was started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm

Cookbook cookbooks.sre.hosts.reimage started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm executed with errors:

  • es2028 (FAIL)
    • Downtimed on Icinga/Alertmanager
    • Disabled Puppet
    • Removed from Puppet and PuppetDB if present and deleted any certificates
    • Removed from Debmonitor if present
    • Forced PXE for next reboot
    • Host rebooted via IPMI
    • Host up (Debian installer)
    • Add puppet_version metadata (7) to Debian installer
    • Checked BIOS boot parameters are back to normal
    • Host up (new fresh bookworm OS)
    • Generated Puppet certificate
    • The reimage failed, see the cookbook logs for the details. You can also try typing "sudo install-console es2028.codfw.wmnet" to get a root shell, but depending on the failure this may not work.

I've tried to reimage es2028 with bookworm formatting its /srv with db-trixie.cfg using: https://gerrit.wikimedia.org/r/c/operations/puppet/+/1206067/2/modules/profile/data/profile/installserver/preseed.yaml#215 but /srv wasn't formatted.

Doing the same with Trixie resulted in the same, not getting /srvformatted
After talking to @MoritzMuehlenhoff we decided to test whether db.cfg works at all, as we've not used it for anything else apart from fresh installs for a while and indeed, it doesn't seem to be working: https://gerrit.wikimedia.org/r/c/operations/puppet/+/1206195 this and a reimage to bookworm didn't format /srv/ for es2028.

Cookbook cookbooks.sre.hosts.reimage was started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm

This also seems to happen with - partman/custom/db.cfg as well so not only with reuse-parts.cfg
I discussed with @MoritzMuehlenhoff whether it is a good moment to migrate our installs to UEFI and stop using legacy BIOS. We don't really have any strong preference on any or other method, whatever is easier for everyone.
The only requirement is to keep being able to reimage hosts with the option to keep /srv intact and another recipe to fully format the OS.

We have to re-test everything because puppet has been disabled in apt1002 since Friday.

Change #1206319 had a related patch set uploaded (by Marostegui; author: Marostegui):

[operations/puppet@production] installserver: Add db-trixie.cfg to es2028

https://gerrit.wikimedia.org/r/1206319

Change #1206319 merged by Marostegui:

[operations/puppet@production] installserver: Add db-trixie.cfg to es2028

https://gerrit.wikimedia.org/r/1206319

Cookbook cookbooks.sre.hosts.reimage started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm completed:

  • es2028 (WARN)
    • Removed from Puppet and PuppetDB if present and deleted any certificates
    • Removed from Debmonitor if present
    • Forced PXE for next reboot
    • Host rebooted via IPMI
    • Host up (Debian installer)
    • Add puppet_version metadata (7) to Debian installer
    • Checked BIOS boot parameters are back to normal
    • Host up (new fresh bookworm OS)
    • Generated Puppet certificate
    • Signed new Puppet certificate
    • Run Puppet in NOOP mode to populate exported resources in PuppetDB
    • Found Nagios_host resource for this host in PuppetDB
    • Downtimed the new host on Icinga/Alertmanager
    • First Puppet run completed and logged in /var/log/spicerack/sre/hosts/reimage/202511171103_marostegui_1009723_es2028.out
    • configmaster.wikimedia.org updated with the host new SSH public key for wmf-update-known-hosts-production
    • Rebooted
    • Automatic Puppet run was successful
    • Forced a re-check of all Icinga services for the host
    • Icinga status is not optimal, downtime not removed
    • Updated Netbox data from PuppetDB

Cookbook cookbooks.sre.hosts.reimage was started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm

Reimaged es2028 into bookworm with db-trixie.cfg and it correctly formatted /srv

I am now going to place a file in /srv and reimage it with reuse-db-trixie.cfg with bookworm and see if it is not erased.

Change #1206359 had a related patch set uploaded (by Marostegui; author: Marostegui):

[operations/puppet@production] installserver: Do not format /srv on es2028

https://gerrit.wikimedia.org/r/1206359

Change #1206359 merged by Marostegui:

[operations/puppet@production] installserver: Do not format /srv on es2028

https://gerrit.wikimedia.org/r/1206359

Cookbook cookbooks.sre.hosts.reimage started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm completed:

  • es2028 (WARN)
    • Downtimed on Icinga/Alertmanager
    • Disabled Puppet
    • Removed from Puppet and PuppetDB if present and deleted any certificates
    • Removed from Debmonitor if present
    • Forced PXE for next reboot
    • Host rebooted via IPMI
    • Host up (Debian installer)
    • Add puppet_version metadata (7) to Debian installer
    • Checked BIOS boot parameters are back to normal
    • Host up (new fresh bookworm OS)
    • Generated Puppet certificate
    • Signed new Puppet certificate
    • Run Puppet in NOOP mode to populate exported resources in PuppetDB
    • Found Nagios_host resource for this host in PuppetDB
    • Downtimed the new host on Icinga/Alertmanager
    • Removed previous downtime on Alertmanager (old OS)
    • First Puppet run completed and logged in /var/log/spicerack/sre/hosts/reimage/202511171154_marostegui_1063414_es2028.out
    • configmaster.wikimedia.org updated with the host new SSH public key for wmf-update-known-hosts-production
    • Rebooted
    • Automatic Puppet run was successful
    • Forced a re-check of all Icinga services for the host
    • Icinga status is not optimal, downtime not removed
    • Updated Netbox data from PuppetDB

Change #1206362 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] partman: Apply workarounds to swap handling affecting trixie installations

https://gerrit.wikimedia.org/r/1206362

Cookbook cookbooks.sre.hosts.reimage was started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm

Cookbook cookbooks.sre.hosts.reimage started by marostegui@cumin1003 for host es2028.codfw.wmnet with OS bookworm completed:

  • es2028 (WARN)
    • Downtimed on Icinga/Alertmanager
    • Disabled Puppet
    • Removed from Puppet and PuppetDB if present and deleted any certificates
    • Removed from Debmonitor if present
    • Forced PXE for next reboot
    • Host rebooted via IPMI
    • Host up (Debian installer)
    • Add puppet_version metadata (7) to Debian installer
    • Checked BIOS boot parameters are back to normal
    • Host up (new fresh bookworm OS)
    • Generated Puppet certificate
    • Signed new Puppet certificate
    • Run Puppet in NOOP mode to populate exported resources in PuppetDB
    • Found Nagios_host resource for this host in PuppetDB
    • Downtimed the new host on Icinga/Alertmanager
    • Removed previous downtime on Alertmanager (old OS)
    • First Puppet run completed and logged in /var/log/spicerack/sre/hosts/reimage/202511171304_marostegui_1135655_es2028.out
    • configmaster.wikimedia.org updated with the host new SSH public key for wmf-update-known-hosts-production
    • Rebooted
    • Automatic Puppet run was successful
    • Forced a re-check of all Icinga services for the host
    • Icinga status is not optimal, downtime not removed
    • Updated Netbox data from PuppetDB

Change #1206362 merged by Marostegui:

[operations/puppet@production] partman: Apply workarounds to swap handling affecting trixie installations

https://gerrit.wikimedia.org/r/1206362

Marostegui assigned this task to MoritzMuehlenhoff.

The installation worked and es2028 got installed with bookworm and the file wasn't deleted.
I've merged: https://gerrit.wikimedia.org/r/c/operations/puppet/+/1206362 which is what makes db.cfg and db-reuse.cfg usable by both Bookworm and Trixie and then I will clean up es2028 from the preseed list.
es2028 will remain up before it gets decommissioned (T408407) so @MoritzMuehlenhoff can fix+test this upstream

Thanks a lot @MoritzMuehlenhoff for all the help!

Change #1206381 had a related patch set uploaded (by Marostegui; author: Marostegui):

[operations/puppet@production] installserver: Clean up es2028

https://gerrit.wikimedia.org/r/1206381

Change #1206381 merged by Marostegui:

[operations/puppet@production] installserver: Clean up es2028

https://gerrit.wikimedia.org/r/1206381

Change #1206708 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] installserver: Readd es2028 with modified db-trixie partman config

https://gerrit.wikimedia.org/r/1206708

Change #1206708 merged by Muehlenhoff:

[operations/puppet@production] installserver: Readd es2028 with modified db-trixie partman config

https://gerrit.wikimedia.org/r/1206708