Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Usage of dd in this context is so pervasive that it’s being hailed as the magic gatekeeper of raw devices.

That's the thing; it isn't. Author forgot to explain (if he knows that at all) that /dev/sda2 on Linux is not a raw device. It's a block device.

So if dd is hailed as something to use on /dev/sda, that's not an example of being hailed for a raw device.

dd's capability to control the read/write size is needed for classic raw devices on Unix, which require transfers to follow certain sizes.

E.g if a classic Unix tape needs 512 byte blocks, but you do 1024 byte writes, you lose half the data; each write creates a block.

The raw/block terminology comes from Unix. You have a raw device and a block device representing the same device. The block device allows arbitrarily sized reads and writes, doing the re-blocking underneath. That overhead costs something, which you can avoid by using the raw device (and doing so correctly).



At least this used to be the case. Nowadays FreeBSD doesn’t implement block devices at all - there are only raw disk devices.


Something that, IIRC, came from Linux and it's allowance on at least some block devices to support "character" style access.

Tapes are still annoying on both in their block-ness, iirc?


In a way, but in Linux block devices can still be accessed as block devices, while in FreeBSD (since around 1999) they can't - there's no caching at that level anymore; raw devices (which Linux got a few years before that) are the only kind of devices. (If you do "ls -al /dev", you'll still see block devices, but it's maintained only to pretend to userspace, just like major/minor numbers.)

Tapes aren't block devices at all - that's why you can't mount them :-)


Mounting and a device being a block device or not had zero relation in classic unix though :)

Tapes by nature are block devices due to only being accessible in block increments, and writing them in transparent way is a bit more problematic than with disks, as being able to just re-read a block to do read-update-write cycle isn't guaranteed - or necessarily easy.

And yes, there used to be a time where you could mount tape as filesystem ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: