From: Sven-Haegar Koch <haegar@sdinet.de>
To: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Cc: Linux List Kernel Mailing <linux-kernel@vger.kernel.org>
Subject: Re: [question] What happens when dd writes data to a missing device?
Date: Sun, 11 Oct 2020 21:52:20 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.23.453.2010112150070.3140856@aurora.sdinet.de> (raw)
In-Reply-To: <CABXGCsOVXh89h2e4EuNbDKiCNwKm8599UE-h0GN-jPhpfyoCVA@mail.gmail.com>
On Mon, 12 Oct 2020, Mikhail Gavrilov wrote:
> I have a question.
> What happens when dd writes data to a missing device?
>
> For example:
> # dd if=/home/mikhail/Downloads/Fedora-Workstation-Live-x86_64-Rawhide-20201010.n.0.iso
> of=/dev/adb
>
> Today I and wrongly entered /dev/adb instead of /dev/sdb,
> and what my surprise was when the data began to be written to the
> /dev/adb device without errors.
>
> But my surprise was even greater when cat /dev/adb started to display
> the written data.
>
> I have a question:
> Where the data was written and could it damage the stored data in
> memory or on disk?
If the device node /dev/adb does not exist (most likely udev case when
you don't have the device/no module loaded for it) then dd as root will
just create a normal file inside the /dev ramdisk.
Only if the device node exists but is not handled then something else
like an open error will happen.
c'ya
sven-haegar
--
Three may keep a secret, if two of them are dead.
- Ben F.
next prev parent reply other threads:[~2020-10-11 20:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-11 19:46 Mikhail Gavrilov
2020-10-11 19:52 ` Sven-Haegar Koch [this message]
2020-10-11 20:31 ` Al Viro
2020-10-12 1:57 ` Douglas Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.23.453.2010112150070.3140856@aurora.sdinet.de \
--to=haegar@sdinet.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mikhail.v.gavrilov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®