NetBSD-Users archive

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

Re: Making a localized, educational live-usb version of Netbsd? Possible, and is worth it?



Hi Chris,

On Sat, Mar 29, 2014 at 02:07:46AM +1300, Chris Bannister wrote:
> How do you know when to use /dev/sd0a vs /dev/rsd0a

It depends on whether you need character-oriented or block-oriented access. For
example, you usually mount a disk in the block-device way, but OTOH it helps to
write a disklabel to a raw device.

Some man pages will you which access method is preferred, or at least which
methods are available.

On Sat, Mar 29, 2014 at 02:07:46AM +1300, Chris Bannister wrote:
> Found this, http://www.openbsd.org/faq/faq14.html
> "... The device files would be /dev/sd0a for the block device,
> /dev/rsd0a would be the device file for the "raw" (character) device."
> 
> Is that like /dev/sda1 vs /dev/sda in Linux, where /dev/sda represents
> the whole device, and /dev/sda1 represents the first partition on
> /dev/sda?

The answer is no. Actually, you answered your own question. The NetBSD/OpenBSD
"r" convention has nothing to do with partitions -- it means, as you correctly
mention, that you want to access some device (and/or a particular partition) in
a character-oriented way (1 byte at a time), rather than a block-oriented way
(many bytes at a time).

For example, in NetBSD and OpenBSD you refer to the second partition of the
first sd(4) raw device like this: /dev/rsd0b ("0" == 1st device, "b" == 2nd
partition).

-Christian


Home | Main Index | Thread Index | Old Index