Disable partitioning of installation media (was: Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected)

2026-09-15 Thread Pascal Hambourg
[Bug#1141839 is archived, so changing the subject and resending to the 
debian-boot list]


On 15/07/2026 at 09:11, Pascal Hambourg wrote:


- 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.


I updated the merge request [1] to implement the above.


Update to also cope with GNU/Hurd partition device node naming scheme:



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-*.



partman-auto-* need to be adjusted too. I will open MRs after this one 
is merged.




Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-08-09 Thread Pascal Hambourg

On 06/08/2026 at 21:08, Holger Wansing wrote:

Kevin Locke  wrote (Mon, 27 Jul 2026 11:31:46 -0600):

To summarize the options we've discussed and add a few of my own:

1. Leave the issue unsolved for netboot.

(...)

I tend to option 1.

(...)

Objections?


No objection. Further improvements can be implemented later.



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-08-07 Thread Kevin Locke
On Thu, 2026-08-06 at 21:08 +0200, Holger Wansing wrote:
> Kevin Locke  wrote (Mon, 27 Jul 2026 11:31:46 -0600):
>> 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.
> 
> 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?

None from me.  It's a pragmatic solution that I support.  Thanks again
for implementing it!

Cheers,
Kevin



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-08-06 Thread Holger Wansing
Hi,

Kevin Locke  wrote (Mon, 27 Jul 2026 11:31:46 -0600):
> 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.

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


-- 
Holger Wansing 
PGP-Fingerprint: 496A C6E8 1442 4B34 8508  3529 59F1 87CA 156E B076



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-27 Thread Kevin Locke
On Thu, 2026-07-23 at 19:49 +0200, Pascal Hambourg wrote:
> On 23/07/2026 at 16:05, Kevin Locke wrote:
>> "Installing to this disk will modify the installation media.
>>  "
>
> 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.

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



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-26 Thread Pascal Hambourg

On 26/07/2026 at 21:26, Holger Wansing wrote:


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?


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.




Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-26 Thread Holger Wansing
Hi,

Pascal Hambourg  wrote (Thu, 23 Jul 2026 08:38:31 
+0200):
> On 19/07/2026 at 21:04, Kevin Locke wrote:
> > 
> > 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?
> 
> Yes. The netboot installer included in mini.iso images does not mount a 
> 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.
> 
> > 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:
> 
> I also had this idea as a last resort.
> 
> > "No disks were detected other than the one containing this installer.
> > Installing to this disk will modify the installer media.  Continue?"
> 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.

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




-- 
Holger Wansing 
PGP-Fingerprint: 496A C6E8 1442 4B34 8508  3529 59F1 87CA 156E B076



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-23 Thread Pascal Hambourg

On 23/07/2026 at 16:05, Kevin Locke wrote:

On Thu, 2026-07-23 at 08:38 +0200, Pascal Hambourg wrote:


The netboot installer included in mini.iso images does not mount a
local installation media, it loads everything from a network mirror.


Thanks for mentioning that it's a netboot image.  So netboot media
will still be affected after the fix is merged?


Yes.


It would be nice to
avoid inadvertently overwriting installation media for netboot too,
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.



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.


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.
 "
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.




Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-23 Thread Kevin Locke
On Thu, 2026-07-23 at 08:38 +0200, Pascal Hambourg wrote:
> On 19/07/2026 at 21:04, Kevin Locke wrote:
>> 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?
> 
> Yes. The netboot installer included in mini.iso images does not mount a
> 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.

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?

> 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.

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).

>> 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:
> 
> I also had this idea as a last resort.
> 
>> "No disks were detected other than the one containing this installer.
>> Installing to this disk will modify the installer media.  Continue?"
>
> 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.

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.
 "

What do you think?

Cheers,
Kevin



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-22 Thread Pascal Hambourg

On 19/07/2026 at 21:04, Kevin Locke wrote:


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?


Yes. The netboot installer included in mini.iso images does not mount a 
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.



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:


I also had this idea as a last resort.


"No disks were detected other than the one containing this installer.
Installing to this disk will modify the installer media.  Continue?"
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.




Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-19 Thread Kevin Locke
On Sun, 2026-07-19 at 21:38 +0200, Holger Wansing wrote:
> 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.

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



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-19 Thread Holger Wansing
Hi,

Kevin Locke  wrote (Sun, 19 Jul 2026 13:04:53 -0600):
> 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?

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



-- 
Holger Wansing 
PGP-Fingerprint: 496A C6E8 1442 4B34 8508  3529 59F1 87CA 156E B076



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-19 Thread Kevin Locke
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 
>> :
>>> 
>>> 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


repro-salsaci.sh
Description: Bourne shell script


Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-15 Thread Pascal Hambourg

On 13/07/2026 at 23:01, Holger Wansing wrote:

Am 13. Juli 2026 20:14:11 MESZ schrieb Pascal Hambourg :


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.



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-*.


Sounds really smart to me.
You and Kevin deserve credit for challenging me about "the best we can 
do" and giving me new ideas.



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 :-)


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] 

[2] 





Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-14 Thread Kevin Locke
On Mon, 2026-07-13 at 20:14 +0200, Pascal Hambourg wrote:
> After giving some more thought, I think we can do better without breaking
> any sensible use case.
> 
> [...]
> 
> Opinions ?

Sounds great to me!  Let me know if there's anything I can do to
assist.

>> 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 :-)
> 
> I cannot make any promises for the near future. Persistent heat drains all
> my energy...

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



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-13 Thread Holger Wansing



Am 13. Juli 2026 20:14:11 MESZ schrieb Pascal Hambourg :
>After giving some more thought, I think we can do better without 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 ?

Sounds really smart to me.
If you get that cleanly implemented: +1


>> 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 :-)
>
>I cannot make any promises for the near future. Persistent heat drains all my 
>energy...


No problem. Climat change is more and more coming to day life ...


Holger



-- 
Sent from /e/ OS on Fairphone3



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-13 Thread Pascal Hambourg

On 12/07/2026 at 14:04, Kevin Locke wrote:


Another idea:  Could we exclude the drive with installation media if
its only partition is the installer?  Or if the drive is removable
media?


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.



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-13 Thread Pascal Hambourg

On 12/07/2026 at 11:07, Holger Wansing wrote:

Am 12. Juli 2026 08:25:51 MESZ schrieb Pascal Hambourg 
:.

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 ?


Sounds like a good compromise to me...
And most probably the best we can do here.


After giving some more thought, I think we can do better without 
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 ?


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 :-)


I cannot make any promises for the near future. Persistent heat drains 
all my energy...




Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-12 Thread Holger Wansing
Hi,

Am 13. Juli 2026 00:18:53 MESZ schrieb Kevin Locke :
>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.  

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



-- 
Sent from /e/ OS on Fairphone3



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-12 Thread Kevin Locke
On Sun, 2026-07-12 at 14:42 +0200, Holger Wansing wrote:
> Kevin Locke  wrote (Sun, 12 Jul 2026 06:04:11 -0600):
>> 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.
> 
> Just to make sure:
> 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?

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



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-12 Thread Holger Wansing
Hi,

Kevin Locke  wrote (Sun, 12 Jul 2026 06:04:11 -0600):
> 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.

Just to make sure:
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



-- 
Holger Wansing 
PGP-Fingerprint: 496A C6E8 1442 4B34 8508  3529 59F1 87CA 156E B076



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-12 Thread Kevin Locke
On Sun, 2026-07-12 at 11:07 +0200, Holger Wansing wrote:
> Am 12. Juli 2026 08:25:51 MESZ schrieb Pascal Hambourg 
> :.
>> 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 ?

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.

> Sounds like a good compromise to me...
> 
> And most probably the best we can do here.

Is that because it would be difficult to exclude the installation
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?

> 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 :-)

Absolutely!  I'd be happy to.  ;)

Cheers,
Kevin



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-12 Thread Holger Wansing
Hi,

Am 12. Juli 2026 08:25:51 MESZ schrieb Pascal Hambourg 
:.
>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 ?

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 



-- 
Sent from /e/ OS on Fairphone3



Bug#1141839: installation-reports: preseed overwrites installer USB stick if no other drives are detected

2026-07-11 Thread Pascal Hambourg

On 10/07/2026 at 21:58, Kevin Locke wrote:


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 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.
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]