Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected
Kevin Locke <[email protected]> Sun, 19 Jul 2026 13:04:53 -0600
| Newsgroups | gmane.linux.debian.devel.boot |
|---|---|
| Message-ID | <al0f1VMqVEE6uxqn__6103.12719816051$1784488046$gmane$org@kevinlocke.name> |
--SgSX5u9buDMdiKNd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, 2026-07-15 at 09:11 +0200, Pascal Hambourg wrote: > On 13/07/2026 at 23:01, Holger Wansing wrote: >> Am 13. Juli 2026 20:14:11 MESZ schrieb Pascal Hambourg <[email protected]>: >>> >>> 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. > > 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. 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. >>> 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. > > This will require extra changes in partman-auto, and maybe partman-auto-*. If I write the ISO[1] to a USB stick and boot it (on either real 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? >> Sounds really smart to me. > > You and Kevin deserve credit for challenging me about "the best we can do" > and giving me new ideas. 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 --SgSX5u9buDMdiKNd Content-Type: application/x-sh Content-Disposition: attachment; filename=repro-salsaci.sh Content-Transfer-Encoding: quoted-printable #!/bin/sh=0Aset -Ceux=0Awget https://salsa.debian.org/pham/partman-base/-/j= obs/9958958/artifacts/file/debian/output/debian-202607XX+salsaci+20260715+3= 9-amd64-gtkmini.iso=0A# Extract initrd.gz for modification=0Aosirrox -indev= debian-202607XX+salsaci+20260715+39-amd64-gtkmini.iso -extract initrd.gz i= nitrd.gz -extract isolinux.cfg isolinux.cfg=0A# Boot installer by default= =0Ased -i 's/^default [[:graph:]]*/default install/' isolinux.cfg=0A# Prese= ed the installer=0Agunzip initrd.gz=0Achmod u+w initrd=0Acat >preseed.cfg <= <PRESEED=0A# preseed.cfg extracted from openmediavault_8.3.1-amd64.iso via= =0A# osirrox -indev openmediavault_8.3.1-amd64.iso -concat append - install= /preseed.cfg |=0A# grep -Ev -e '^[[:space:]]*(#|$)' -e anna-install=0Ad= -i any ethdetect/prompt_missing_firmware boolean false=0Ad-i hw-detect/load= _firmware boolean true=0Ad-i netcfg/get_hostname string openmediavault=0Ad-= i netcfg/get_hostname seen false=0Ad-i netcfg/get_domain string internal=0A= d-i netcfg/get_domain seen false=0Ad-i passwd/make-user boolean false=0Ad-i= partman-auto/method string regular=0Ad-i partman-auto/init_automatically_p= artition select some_device=0Ad-i partman-auto/choose_recipe select atomic= =0Ad-i partman/default_filesystem string ext4=0Ad-i partman/choose_partitio= n select finish=0Ad-i partman/confirm_write_new_label boolean true=0Ad-i pa= rtman/confirm_nooverwrite boolean true=0Ad-i partman/confirm boolean true= =0Ad-i partman-lvm/device_remove_lvm boolean true=0Ad-i partman-md/device_r= emove_md boolean true=0Ad-i grub-installer/only_debian boolean true=0Ad-i g= rub-installer/with_other_os boolean false=0Ad-i apt-setup/cdrom/set-first b= oolean false=0Ad-i apt-setup/non-free-firmware boolean true=0Ad-i apt-setup= /non-free boolean true=0Ad-i apt-setup/contrib boolean true=0Ad-i apt-setup= /use_mirror boolean true=0Ad-i apt-setup/disable-cdrom-entries boolean true= =0Ad-i pkgsel/run_tasksel boolean false=0Ad-i cdrom-detect/eject boolean tr= ue=0Apopularity-contest popularity-contest/participate boolean false=0A=0A#= My preseed.cfg options to avoid any user prompts in reproduction=0Ad-i deb= ian-installer/locale string en_US.UTF-8=0Ad-i finish-install/reboot_in_prog= ress note=0Ad-i keyboard-configuration/xkb-keymap select us=0Ad-i mirror/co= untry string manual=0Ad-i mirror/http/hostname string deb.debian.org=0Ad-i = mirror/http/directory string /debian=0Ad-i mirror/http/proxy string=0Ad-i n= etcfg/get_hostname seen true=0Ad-i netcfg/get_domain seen true=0Ad-i passwd= /root-password password r00tme=0Ad-i passwd/root-password-again password r0= 0tme=0Ad-i passwd/make-user boolean false=0Ad-i time/zone string US/Mountai= n=0APRESEED=0Aecho preseed.cfg | cpio -H newc -o -A -F initrd=0Agzip initrd= =0A# Add the modified files to a modified ISO image=0Axorriso -indev debian= -202607XX+salsaci+20260715+39-amd64-gtkmini.iso -outdev debian-202607XX+sal= saci+20260715+39-amd64-gtkmini-custom.iso \=0A -map initrd.gz initrd.gz \= =0A -map isolinux.cfg isolinux.cfg \=0A -boot_image any replay=0Atruncate -= -size=3D3GiB debian-202607XX+salsaci+20260715+39-amd64-gtkmini-custom.iso= =0Acp debian-202607XX+salsaci+20260715+39-amd64-gtkmini-custom.iso debian-2= 02607XX+salsaci+20260715+39-amd64-gtkmini-custom-orig.iso=0Aqemu-system-x86= _64 \=0A -enable-kvm \=0A -no-reboot \=0A -m 1G \=0A -drive if= =3Dnone,id=3Ddiiso,format=3Draw,file=3Ddebian-202607XX+salsaci+20260715+39-= amd64-gtkmini-custom.iso \=0A -device qemu-xhci,id=3Dxhci \=0A -devic= e usb-storage,bus=3Dxhci.0,drive=3Ddiiso,removable=3Dtrue=0A# Choose whethe= r or not to install the boot loader, overwriting isolinux=0Adiff -qs debian= -202607XX+salsaci+20260715+39-amd64-gtkmini-custom.iso debian-202607XX+sals= aci+20260715+39-amd64-gtkmini-custom-orig.iso=0A --SgSX5u9buDMdiKNd--