GNU bug report logs -
#19065
dd design bug
Previous Next
Reported by: bt <bdtitus108 <at> yahoo.com>
Date: Sun, 16 Nov 2014 01:48:02 UTC
Severity: normal
Tags: moreinfo, unreproducible
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 19065 <at> debbugs.gnu.org (full text, mbox):
On 16/11/14 01:11, bt wrote:
> The following undocumented behavior of dd is (IMO) a design flaw.
>
> If dd is used to copy one partition to another, as in
>
> #dd if=/dev/sda3 of=/dev/sdb3 ...
>
> and if in fact sdb3 does not exist, then dd will overwrite the first part of
> an existing partition *sda1*.
>
> It doesn't make sense that if the "of=" device doesn't exist, then another
> pre-existing device, not mentioned in the command line, is overwritten.
> Several websites have incorrect information about the behavior of dd in this
> situation.
> At the very least, this should be documented--maybe I'm missing something, but didn't see it in the man pages or the texinfo manual.
What version of dd are you seeing this with?
What operating system version are you seeing this with?
I'm struggling to see how dd could ever do this itself.
Perhaps you have a dynamic devfs on /dev or something
and when you create /dev/sdb3 it creates a device node
for /dev/sda or something?
That's a major gotcha and I would suggest passing the
conv=nocreat option to dd to avoid that behavior
(yes it would have been better called 'nocreate'
but not worth changing now after 10 years).
cheers,
Pádraig.
This bug report was last modified 6 years and 208 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.