the new patch is attached.

On 09/09/2026 09:42, ii  writes:
>I have revised the patch substantially:


remove the file‑system structure overwrite check entirely.



remove  the libblkid dependency – the new implementation
does not pull in any extra library.


retain only a best-effort check that warns  the output block
device appears to be: currently mounted,  LVM physical volume,
or containing an MBR or GPT partition table




>These checks are performed by reading a few initial sectors directly
>and parsing the on‑disk signatures. The detection is purely advisory: 
>any failure during probing is silently ignored and treated as
>"nothing detected",  so dd will never fail or change its behaviour
>because of pre-write safety check. The warning is only issued when
>dd is run interactively, and it asks for user confirmation before 
proceeding.




&gt;Pádraig&nbsp;Brady&nbsp;<[email protected]&gt;&nbsp;wrote:
&gt;&nbsp;On&nbsp;04/09/2026&nbsp;10:22,&nbsp;ii&nbsp;via&nbsp;GNU&nbsp;coreutils&nbsp;Bug&nbsp;Reports&nbsp;wrote:
&gt;&gt;&nbsp;if&nbsp;dd&nbsp;is&nbsp;used&nbsp;to&nbsp;write&nbsp;block&nbsp;device,&nbsp;would&nbsp;destroy&nbsp;in-use&nbsp;devices,&nbsp;or&nbsp;LVM,&nbsp;&amp;nbsp;partition&nbsp;tables&nbsp;on&nbsp;devices.&nbsp;&amp;nbsp;
&gt;&gt;&nbsp;Before&nbsp;opening&nbsp;the&nbsp;output,&nbsp;probe&nbsp;with&nbsp;libblkid&nbsp;and&nbsp;warn&nbsp;if&nbsp;content&nbsp;is&nbsp;recognized,&nbsp;prompting&nbsp;for&nbsp;confirmation.
&gt;
&gt;&nbsp;Checking&nbsp;whether&nbsp;a&nbsp;device&nbsp;is&nbsp;mounted&nbsp;does&nbsp;seem&nbsp;potentially&nbsp;useful.
&gt;
&gt;&nbsp;Checking&nbsp;whether&nbsp;to&nbsp;overwrite&nbsp;existing&nbsp;file&nbsp;system&nbsp;structures&nbsp;seems&nbsp;less&nbsp;useful,
&gt;&nbsp;as&nbsp;that&nbsp;would&nbsp;be&nbsp;a&nbsp;very&nbsp;common&nbsp;scenario.&nbsp;&nbsp;Also&nbsp;that&nbsp;functionality&nbsp;adds&nbsp;the
&gt;&nbsp;libblkid&nbsp;dependency&nbsp;which&nbsp;isn't&nbsp;ideal.








ii
[email protected]

Attachment: dd-pre-write-safety-check.patch
Description: Binary data

Reply via email to