Seth Woolley's Man Viewer

Manual for raw - man 8 raw

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

RAW(8)                                                                  RAW(8)

       raw(3x,7,8,3x cbreak) - bind(2,n,1 builtins) a Linux raw(3x,7,8,3x cbreak) character device

       raw(3x,7,8,3x cbreak) /dev/raw(3x,7,8,3x cbreak)/raw(3x,7,8,3x cbreak)<N> <major> <minor>

       raw(3x,7,8,3x cbreak) /dev/raw(3x,7,8,3x cbreak)/raw(3x,7,8,3x cbreak)<N> /dev/<blockdev>

       raw(3x,7,8,3x cbreak) -q /dev/raw(3x,7,8,3x cbreak)/raw(3x,7,8,3x cbreak)<N>

       raw(3x,7,8,3x cbreak) -qa

       raw(3x,7,8,3x cbreak)  is  used  to  bind(2,n,1 builtins) a Linux raw(3x,7,8,3x cbreak) character device to a block device.
       Any block device may be used: at the time(1,2,n) of binding, the device driver
       does  not  even  have to be accessible (it may be loaded on demand as a
       kernel module later).

       raw(3x,7,8,3x cbreak) is used in(1,8) two modes: it either sets raw(3x,7,8,3x cbreak)  device  bindings,  or  it
       queries  existing bindings.  When setting a raw(3x,7,8,3x cbreak) device, /dev/raw(3x,7,8,3x cbreak)/raw(3x,7,8,3x cbreak)<N>
       is the device name of an existing raw(3x,7,8,3x cbreak) device node  in(1,8)  the  filesystem.
       The  block device to which it is to be bound can be specified either in(1,8)
       terms of its major  and  minor  device  numbers,  or  as  a  path  name
       /dev/<blockdev> to an existing block device file.

       The  bindings  already  in(1,8) existence can be queried with the -q option,
       with is used either with a  raw(3x,7,8,3x cbreak)  device  filename  to  query  that  one
       device, or with the -a option to query all bound raw(3x,7,8,3x cbreak) devices.

       Unbinding can be done by specifying major and minor 0.

       Once  bound  to  a  block  device, a raw(3x,7,8,3x cbreak) device can be opened, read(2,n,1 builtins) and
       written, just like the block device it is bound to.  However,  the  raw(3x,7,8,3x cbreak)
       device  does  not behave exactly like the block device.  In particular,
       access(2,5) to the raw(3x,7,8,3x cbreak) device  bypasses  the  kernel's  block  buffer  cache
       entirely: all I/O is done directly to and from the address space of the
       process performing the I/O.  If the underlying block device driver  can
       support  DMA,  then  no data copying at all is required to complete the

       Because raw(3x,7,8,3x cbreak) I/O involves direct hardware access(2,5) to a process's  memory,
       a  few extra restrictions must be observed.  All I/Os must be correctly
       aligned in(1,8) memory and on disk: they must start at a  sector  offset  on
       disk, they must be an exact number of sectors long, and the data buffer
       in(1,8) virtual(5,8) memory must also be aligned to  a  multiple  of  the  sector
       size.  The sector size is 512 bytes for most devices.

       -q     Set  query  mode.  raw(3x,7,8,3x cbreak) will query an existing binding instead of
              setting a new one.

       -a     With -q ,  specifies  that  all  bound  raw(3x,7,8,3x cbreak)  devices  should  be

       -h     provides a usage summary.

       The  Linux  dd  (1)  command  does not currently align its buffers cor-
       rectly, and so cannot be used on raw(3x,7,8,3x cbreak) devices.

       Raw I/O devices do not maintain cache coherency with  the  Linux  block
       device  buffer  cache.  If you use raw(3x,7,8,3x cbreak) I/O to overwrite data already in(1,8)
       the buffer cache, the buffer cache will no  longer  correspond  to  the
       contents  of the actual storage device underneath.  This is deliberate,
       but is regarded either a bug or a feature depending on who you ask!

       Stephen Tweedie (

Version 0.1                        Aug 1999                             RAW(8)

References for this manual (incoming links)