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