Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Unusable system during dd to USB block device



> On Mon, 28 Dec 2020, Arto Huusko wrote:

> > I just accidentally tried to write about 3 gigabytes of data with dd
> > to USB disk via the block device instead of raw device.

> > The transfer did work, but it was excruciatingly slow, under 2 Mb /
> > sec. But that wasn't the only problem: it also made most other
> > activities on the system unusable, at least if there was any disk
> > access involved.

> This is why there is a raw device--to bypass the buffer cache. When
> you use dd, write to the raw device. Or pass `iflag=direct' and
> `oflag=direct' if you use the normal disk device. Linux needs those,
> otherwise dd will fill up all available buffers there too.

> RVP

What is the raw device in the case of a USB stick or USB hard drive?

I tried to dd to /dev/sd2 (or whatever the number was), and it looked good on the screen, no error message, but nothing happened on the USB stick.

dd to /dev/da2 (or whatever the number was) worked in FreeBSD.

In each case, I used bs=1m ; otherwise it uses something like 1024 or 512 bytes and is excruciatingly slow.

NomadBSD (nomadbsd.org) is a live USB version of FreeBSD (currently 12.1) and has instructions on writing to USB stick from FreeBSD, NetBSD, OpenBSD, DragonFlyBSD, Mac OS, Linux and Windows.

There needs to be better documentation on how to write using dd to a USB stick from NetBSD, distinction between raw device and block device.

Tom



Home | Main Index | Thread Index | Old Index