#1141839 installation-reports: preseed overwrites installer USB stick if no other drives are detected #1141839
- Package:
- installation-reports
- Source:
- installation-reports
- Submitter:
- Kevin Locke
- Date:
- 2026-08-16 19:09:02 UTC
- Severity:
- normal
Boot method: USB
Image version: https://cdimage.debian.org/cdimage/daily-builds/daily/20260705-1/amd64/iso-cd/debian-testing-amd64-netinst.iso
Date: 2026-07-10
Machine: QEMU and Dell XPS 8940
Partitions: None
Base System Installation Checklist:
[O] = OK, [E] = Error (please elaborate below), [ ] = didn't try it
Initial boot: [O]
Detect network card: [O]
Configure network: [O]
Detect media: [O]
Load installer modules: [O]
Clock/timezone setup: [O]
User/password setup: [O]
Detect hard drives: [O]
Partition hard drives: [E]
Install base system: [ ]
Install tasks: [ ]
Install boot loader: [ ]
Overall install: [ ]
Comments/Problems:
When the Debian Installer Netinst ISO is booted from a USB stick and
preseeded for partman to automatically partition without confirmation,
if no disks are present or detected (e.g. due to Intel RST, see Bug
1035101, or hardware issues) partman will overwrite the installer USB
stick, rendering it unbootable.
I initially encountered this issue attempting to install
OpenMediaVault, which is based on Debian. Volker Theile contends this
is an issue in the Debian Installer.[1] I agree and have been able to
reproduce the issue using the Debian Installer weekly build from
2026-06-29[2] and daily build for 2026-07-05[3] in QEMU with the
following process:
wget https://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/amd64/iso-cd/debian-testing-amd64-netinst.iso
# Extract initrd.gz and isolinux.cfg for modification
osirrox -indev /var/tmp/debian-testing-amd64-netinst.iso -extract install.amd/initrd.gz initrd.gz -extract isolinux/isolinux.cfg isolinux.cfg
# Boot text installer by default
sed -i 's/^default .*/default install/' isolinux.cfg
# Preseed the installer
gunzip initrd.gz
chmod u+w initrd
cat >preseed.cfg <<PRESEED
# preseed.cfg extracted from openmediavault_8.3.1-amd64.iso via
# osirrox -indev openmediavault_8.3.1-amd64.iso -concat append - install/preseed.cfg |
# grep -Ev -e '^[[:space:]]*(#|$)' -e anna-install
d-i any ethdetect/prompt_missing_firmware boolean false
d-i hw-detect/load_firmware boolean true
d-i netcfg/get_hostname string openmediavault
d-i netcfg/get_hostname seen false
d-i netcfg/get_domain string internal
d-i netcfg/get_domain seen false
d-i passwd/make-user boolean false
d-i partman-auto/method string regular
d-i partman-auto/init_automatically_partition select some_device
d-i partman-auto/choose_recipe select atomic
d-i partman/default_filesystem string ext4
d-i partman/choose_partition select finish
d-i partman/confirm_write_new_label boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean false
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/non-free-firmware boolean true
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
d-i apt-setup/use_mirror boolean true
d-i apt-setup/disable-cdrom-entries boolean true
d-i pkgsel/run_tasksel boolean false
d-i cdrom-detect/eject boolean true
popularity-contest popularity-contest/participate boolean false
# My preseed.cfg options to avoid any user prompts in reproduction
d-i debian-installer/locale string en_US.UTF-8
d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/get_hostname seen true
d-i netcfg/get_domain seen true
d-i passwd/root-password password r00tme
d-i passwd/root-password-again password r00tme
d-i passwd/make-user boolean false
d-i time/zone string US/Mountain
PRESEED
echo preseed.cfg | cpio -H newc -o -A -F initrd
gzip initrd
# Add the modified files to a modified ISO image
xorriso -indev debian-testing-amd64-netinst.iso -outdev debian-testing-amd64-custom.iso \
-map initrd.gz install.amd/initrd.gz \
-map isolinux.cfg isolinux/isolinux.cfg \
-boot_image any replay
truncate --size=3GiB debian-testing-amd64-custom.iso
cp debian-testing-amd64-custom.iso debian-testing-amd64-custom-orig.iso
qemu-system-x86_64 \
-enable-kvm \
-no-reboot \
-m 1G \
-drive if=none,id=diiso,format=raw,file=debian-testing-amd64-custom.iso \
-device qemu-xhci,id=xhci \
-device usb-storage,bus=xhci.0,drive=diiso,removable=true
# Select "<Go Back>" when the "Partition(s) 1 on /dev/sda have been written, but [...]"
# error message appears, then "Abort the installation", which halts QEMU
At this point, the modifications to the ISO can be demonstrated by:
diff -qs debian-testing-amd64-custom.iso debian-testing-amd64-custom-orig.iso
In particular, it affects the System Area, as demonstrated by:
echo 'Original System Area:'
xorriso -indev debian-testing-amd64-custom-orig.iso -report_system_area plain
echo 'Modified System Area:'
xorriso -indev debian-testing-amd64-custom.iso -report_system_area plain
Note that the USB stick must be larger than ~2GiB to avoid failing with:
If the USB stick is larger than ~2GiB (3GiB in the reproduction), the
stick is overwritten, rendering it unbootable and reuse impossible.
I contend that partman should have a sanity check to avoid overwriting
the installation media, so that a more useful error message can be
presented to users indicating the lack of usable drives.
Thanks for considering,
Kevin
[1]: https://github.com/openmediavault/openmediavault/issues/2140
[2]: https://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-cd/debian-testing-amd64-netinst.iso
[3]: https://cdimage.debian.org/cdimage/daily-builds/daily/20260705-1/amd64/iso-cd/debian-testing-amd64-netinst.iso
(...) I had opened a merge request against partman-base [1] to skip a drive if mounted on /cdrom or /hd-media, but put it on hold after considering that it might break some (admittedly edge) use cases. Maybe that check should apply only to automatic partitioning ? [1] <https://salsa.debian.org/installer-team/partman-base/-/merge_requests/8>
Hi, Am 12. Juli 2026 08:25:51 MESZ schrieb Pascal Hambourg <pascal@plouf.fr.eu.org>:. Sounds like a good compromise to me... And most probably the best we can do here. If you have time to adapt the MR like this, and we get a mini.iso out of this, Kevin could test it directly, since he has all the bits ready for such test :-) Holger
Excluding the installation media from partitioning sounds like a great idea to me. I think it would reduce confusion, especially for new users, reduce the risk of breakage due to installing to the wrong drive/partition, and reduce the mental burden a little for most users. media partition without excluding the whole drive, in order to support the use case of installing to another partition on the same drive? Another idea: Could we exclude the drive with installation media if its only partition is the installer? Or if the drive is removable media? Absolutely! I'd be happy to. ;) Cheers, Kevin
Hi, Kevin Locke <kevin@kevinlocke.name> wrote (Sun, 12 Jul 2026 06:04:11 -0600): for a default installation this is no problem. If you perform a normal installation (I mean without preseeding), you would get an error message, that no hard drives were found, and if you want to provide driver modules etc. to support additional drives. Kevin: can you confirm this? Holger
If the installer[1] is booted from an optical drive, the "No disk drive was detected" error is shown.[2] However, if the installer is booted from a USB stick,[3] the installer disk is shown as the only choice in partman. If it is selected, either the "[...] the selected disk or free space is too small [...]" (if the USB stick is ~2GiB or less) or the "unable to inform the kernel of the change" error after overwriting the installation media, as in the preseed use case. Cheers, Kevin [1]: https://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-cd/debian-testing-amd64-netinst.iso [2]: qemu-system-x86_64 -enable-kvm -m 1G -cdrom debian-testing-amd64-netinst.iso [3]: qemu-system-x86_64 -enable-kvm -m 1G -drive if=none,id=diiso,format=raw,file=debian-testing-amd64-netinst.iso -device qemu-xhci,id=xhci -device usb-storage,bus=xhci.0,drive=diiso,removable=true
Hi, Am 13. Juli 2026 00:18:53 MESZ schrieb Kevin Locke <kevin@kevinlocke.name>: Ah, yes. I forgot that. Typically I do testing things with qemu and boot the ISO with -cdrom= So that's the "boot from optical drive" szenario. Holger
breaking any sensible use case. There are 3 possible situations regarding the source installation media: - the entire disk is mounted - a partition is mounted and seen by parted - a partition is mounted and unseen by parted (because it considers the partition table in installation/live ISOhybrid images invalid for various legitimate reasons) For all partitioning modes: - if the entire disk is mounted -> skip the disk - if a partition is mounted and unseen by parted -> skip the disk "Skip" means that the disk will not be visible nor usable for partitioning. For manual partitioning: - lock the mounted partition "Lock" means that the partition is visible but altering or deleting it or creating a new partition table on its disk is prohibited. This is an existing feature designed to protect RAID members and physical volumes for LVM and encryption, but AFAICS the lock is checked only in manual partitioning. For automatic partitioning using an entire disk: - skip the disk with a mounted partition "Skip" means that the disk is not added to the available disk list. For automatic partitioning using the largest free space: - nothing more to do, an unusable disk would already be skipped by the general checks for all partitioning modes. Opinions ? I cannot make any promises for the near future. Persistent heat drains all my energy...
No, it would break legitimate use cases such as - Installing on USB (USB 3 can be as fast as SATA) - Typical scenario with SD-card hd-media image for ARM.
Am 13. Juli 2026 20:14:11 MESZ schrieb Pascal Hambourg <pascal@plouf.fr.eu.org>: If you get that cleanly implemented: +1 No problem. Climat change is more and more coming to day life ... Holger
Sounds great to me! Let me know if there's anything I can do to assist. Me too. No hurry on my end. I appreciate all of the thought you've put into it already, especially given the heat! Cheers, Kevin
I updated the merge request [1] to implement the above. It should address this bug report when using official images written to an entire USB drive. This will require extra changes in partman-auto, and maybe partman-auto-*. You and Kevin deserve credit for challenging me about "the best we can do" and giving me new ideas. I have only done very basic tests in a VM, so more testing is welcome. mini.iso is available in salsa's pipeline [2]. [1] <https://salsa.debian.org/installer-team/partman-base/-/merge_requests/8> [2] <https://salsa.debian.org/pham/partman-base/-/jobs/9958958/artifacts/browse/debian/output/>
Thank you so much for working on it, especially with such a quick turn-around! Sorry it has taken me so long to test it. I can confirm that the ISO from Salsa CI does not produce the "Partition(s) 1 on /dev/sda have been written, but [...]" error message. However, it does still overwrite the USB stick. Is that expected? I've attached an updated script to reproduce the issue with the ISO from Salsa in QEMU. hardware or QEMU) without modification or preseed: - If I select "Guided - use the largest continuous free space" it installs to the USB stick in new partitions added after the ones from the ISO. The bootloader is overwritten so the USB stick boots to the new installation and the installer is no longer accessible. - If I select "Guided - use whole disk" it overwrites the USB stick. (This is expected until changes are made to parman-auto?) - If I select "Manual" it appears that all partitions can be changed, removed, or discarded by selecting the whole disk. Note: I don't see /dev/sda in /proc/mounts. Is that expected with how isohybrid images are loaded? Could that explain why I'm not seeing any partitions locked? And why it didn't produce the "failed to reread partition table [...] partitions in use" error message? Or perhaps I'm testing it wrong? It's much easier to come up with ideas than implement them. Thanks for doing the hard work! One other idea we haven't discussed, which might be helpful to distinguish the use cases you outlined from missing disks, would be to prompt the user to modify the installer media. For example: "No disks were detected other than the one containing this installer. Installing to this disk will modify the installer media. Continue?" Thanks again for all your work and explanation on this. Cheers, Kevin
Hi, Kevin Locke <kevin@kevinlocke.name> wrote (Sun, 19 Jul 2026 13:04:53 -0600): We (Pascal and me) already noticed, that the test with the ISO produced by Salsa CI is not 100% realistic. The underlying concept of that images means, that the installation image is not mounted to /cdrom. And that means, that Pascal's changes do not take effect. So, we should have mentioned, that while testing you need to take some extra tour: Go through the installation until the "Partitioning hard drives" step. When you go to "Manual" there, you see all your drives including your USB stick listed. Write down, which device your USB stick is, for example "sda". If you are not sure, look for the size of the drives; your USB stick is probably something like 4 or 16 GB). Then, you have to say "Go back" and then select "Execute a shell" from the menu. There you will have to mount the device, which is hosting the installation image, to /cdrom, with the following two commands: mkdir /cdrom mount -t iso9660 /dev/sda /cdrom (here, I assume your USB stick is sda !!! If your stick has another device notation, adapt the command accordingly!) Then say "exit" on the shell and you will come back to the partitioning step. Now, you should no longer see your USB stick in the list of devices :-) Holger
Ah, that makes sense. Thanks for the explanation and workaround! I gave it a try and can confirm that when the installer USB stick is mounted at /cdrom, and there are no other disks, the "Partition disks" step no longer has Guided or Manual options and no disks are shown. If I attach a second USB stick, the Guided and Manual options reappear and only the disk for the second USB stick is shown. That seems perfect to me. Thanks again, Kevin
local installation media, it loads everything from a network mirror. To simulate the cdrom installer included in netinst and DVD images, you need to mount the installation media by hand. Note: when a isohybrid image is written to a USB drive /dev/sdX, the cdrom installer mounts the partition /dev/sdX1 instead of the entire device /dev/sdX (because it scans USB partitions before entire disks, do not ask me why). So you also need to test with a mounted partition. I also had this idea as a last resort. Prompting only when there is no other disk would break the use case where there is another disk and the user still wants to install on the disk containing installation media. IMO it should not matter whether there are other disks or not.
Thanks for mentioning that it's a netboot image. So netboot media will still be affected after the fix is merged? It would be nice to avoid inadvertently overwriting installation media for netboot too, although it is probably a less significant issue. What do you think? Good thought. I just tested and can confirm that I observe the same behavior with /dev/sda1 mounted at /cdrom (the "Partition disks" step no longer has Guided or Manual options and no disks are shown, when a second disk is added only it is shown). Good point. Perhaps we could cover this case with a more general message? Maybe something like: "Installing to this disk will modify the installation media. <Continue> <Go Back>" What do you think? Cheers, Kevin
Yes. This is what the last part of my previous reply was about, as we already know how to deal with mounted media. But it is a headache. First we need to identify a netboot installation media. But then it is not trivial (if even possible) to tell if the netboot installer was booted from this media, the network or any other source. IIUC this needs to be inserted in every menu item and action which affect a disk. IMO it would be simpler to ask if the disk should be used for partitioning when starting partman and ignore it otherwise.
Hi, Pascal Hambourg <pascal@plouf.fr.eu.org> wrote (Thu, 23 Jul 2026 08:38:31 +0200): I would be unhappy with adding one more question to all installations/ all installation media. Can we manage to display this new message only on netboot image installations? Holger
On netboot d-i initrd, yes, this is my intent. But I do not know how to distinguish whether it was booted from the network or local mini.iso installation media, having no experience with network boot.
That's unfortunate. I would be hesitant to add a prompt for all
users, which adds a cost (in time/complexity/effort) for all (netboot)
users, given the scope and impact of this issue.
To summarize the options we've discussed and add a few of my own:
1. Leave the issue unsolved for netboot.
Pros:
- Only affects netboot (more often used by power users)
- No additional changes required.
Cons:
- Users may still inadvertently overwrite the installation media
(interactively or preseed).
2. Prompt to use install media when starting partman on netboot.
Pros:
- Nearly eliminates risk of overwriting installation media.
- Relatively simple to implement.
Cons:
- Adds time/complexity/effort for all users.
- Non-interactive preseeds must be updated for netboot, and
requirements will differ between netboot and other media.
3. Prompt to modify installation media at key points.
If it's infeasible to ask for every action which might affect a
disk, perhaps we could ask at key points? For example,
during/after "If you continue, the changes below will be written to
the disks" and when installing the bootloader?
Pros:
- Reduces risk of overwriting installation media.
- Only users at risk of overwriting must answer the question.
Cons:
- Implementation complexity.
- May not cover all cases.
4. Add a non-user-visible debconf prompt to allow overwriting
installation media. Default to allow.
Pros:
- Gives preseed authors a mechanism to use to prevent overwriting.
- Relatively simple to implement.
- No time/complexity/effort for most users.
Cons:
- Users may still inadvertently overwrite the installation media
(interactively or preseed) in the default state.
Does that match your understanding as well? If there are other
options, or other pros and cons worth considering, please chime in.
My preference would be 3 > 4 > 1 > 2, but I'll defer to your
expertise and implementation willingness.
Thanks again,
Kevin
Hi, Kevin Locke <kevin@kevinlocke.name> wrote (Mon, 27 Jul 2026 11:31:46 -0600): I tend to option 1. The MR would be ready for this, and using this, we would at least have a solution for the most relevant use cases (leaving out power-user use-cases via netboot images). Waiting for the big solution, which deals with all use cases seems to make us wait for a longer time (if not for ever), and will most likely not be implemented before Forky. Objections? Holger
None from me. It's a pragmatic solution that I support. Thanks again for implementing it! Cheers, Kevin
(...) (...) No objection. Further improvements can be implemented later.
We believe that the bug you reported is fixed in the latest version of
partman-base, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1141839@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Holger Wansing <hwansing@mailbox.org> (supplier of updated partman-base package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 16 Aug 2026 20:20:23 +0200
Source: partman-base
Architecture: source
Version: 241
Distribution: unstable
Urgency: medium
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Holger Wansing <hwansing@mailbox.org>
Closes: 1141839
Changes:
partman-base (241) unstable; urgency=medium
.
* Team upload.
.
[ Holger Wansing ]
* Add lintian-overrides for false-positives.
.
[ Pascal Hambourg ]
* Skip installation media from partitioning; closes: #1141839:
* Lock partition containing installation media.
* Skip installation media with invalid partition table.
* Skip the device if mounted on /cdrom or /hd-media.
Checksums-Sha1:
4d9e42b97a6f8720d268287f2c0472c7751f006a 1853 partman-base_241.dsc
b71eade1b61403b75895a6c405d2a465ff80b22d 180460 partman-base_241.tar.xz
94bf9e221ba758da9e34331c0db7ca6fb4213763 6398 partman-base_241_amd64.buildinfo
Checksums-Sha256:
7c8495064bd9831806a49355bd7c296c5aed0c95cadd604ddc82ea4b66a29f0c 1853 partman-base_241.dsc
562b7e24e8373567b1b1f4da156ab10f975f5aeedd464b89921ed951f5d7eb78 180460 partman-base_241.tar.xz
f4c36519ecaf22656562a9cdc45dc1eceb8407e5f865c512766eb15857d70f82 6398 partman-base_241_amd64.buildinfo
Files:
238fe3e07b0c62db5300f89b62fc6fe3 1853 debian-installer standard partman-base_241.dsc
cd0b406dd4d5205adf7f58234ecf8e2a 180460 debian-installer standard partman-base_241.tar.xz
35fd033d74a8b92d7e8e375a56d19918 6398 debian-installer standard partman-base_241_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQJJBAEBCgAzFiEESWrG6BRCSzSFCDUpWfGHyhVusHYFAmqCA+4VHGh3YW5zaW5n
QG1haWxib3gub3JnAAoJEFnxh8oVbrB2yf8P/2p8w/8Deq5U/PiX004tGpLzYEWR
efOppJsyuvyYJE+KrtO1nkXCTmtEdRvL+OANJ167ZtOIpvRhzDARxW+emFMY4rpq
YjCFjzO3YiarH56z7HWvKcrgZUPhifTJTPIwo7RXUjPrRD3lOz+TTSfnapB/kzgA
4CBUb13iuRD4G7CRouT5m79B/iFgyPii9Vwvrk8I1/GwizPIwaW4hWUKkbivMO4j
RJ15dg4C1GPrS92eEcGr6kvzzO4q7UiRvPGNGX4jdcswdDL+zxKTwVW78zJW67q2
5GdGnKKNTxt4MSpIlH97JXj5vdu6MDN259rvwKDvM5e7au8D+42TdAhciz3hH4to
xubzaStoReSrciDfCPQrS4VOw78tydqGfkoldb0kGQYQ1H3rkv0Nf3LdEXj4cRuw
UnI2m+XWUaN7HdngNShr1o0biH9kkr5Xnnz8PgnbcntN9fENE/mHX6dYbIdUU4II
HGgT+HUdF93RB8wDDMILmmt7cykb8kjuP8ATEmk2EmUlYqsDc+kazEs416+BHAx6
Vhgl3pnPkVuPeexet7/s/uTH0VyYKDrHbwCLC/c5zxBCxWB+E/leBJSoHib30ZN4
JI1XpunujIlZp/fuh/xrcSyhcqpmmvz72tmcEjbStswF1hjv1j9xIe9NNvWByVA4
TCQt/I2U+TiUoPk4
=8wke
-----END PGP SIGNATURE-----