1RAW(8)                      System Manager's Manual                     RAW(8)
2
3
4

NAME

6       raw - bind a Linux raw character device
7

SYNOPSIS

9       raw /dev/raw/raw<N> <major> <minor>
10
11       raw /dev/raw/raw<N> /dev/<blockdev>
12
13       raw -q /dev/raw/raw<N>
14
15       raw -qa
16

DESCRIPTION

18       raw  is  used  to  bind a Linux raw character device to a block device.
19       Any block device may be used: at the time of binding, the device driver
20       does  not  even  have to be accessible (it may be loaded on demand as a
21       kernel module later).
22
23       raw is used in two modes: it either sets raw  device  bindings,  or  it
24       queries  existing bindings.  When setting a raw device, /dev/raw/raw<N>
25       is the device name of an existing raw device node  in  the  filesystem.
26       The  block device to which it is to be bound can be specified either in
27       terms of its major  and  minor  device  numbers,  or  as  a  path  name
28       /dev/<blockdev> to an existing block device file.
29
30       The  bindings  already  in existence can be queried with the -q option,
31       with is used either with a  raw  device  filename  to  query  that  one
32       device, or with the -a option to query all bound raw devices.
33
34       Unbinding can be done by specifying major and minor 0.
35
36       Once  bound  to  a  block  device, a raw device can be opened, read and
37       written, just like the block device it is bound to.  However,  the  raw
38       device  does  not behave exactly like the block device.  In particular,
39       access to the raw device  bypasses  the  kernel's  block  buffer  cache
40       entirely: all I/O is done directly to and from the address space of the
41       process performing the I/O.  If the underlying block device driver  can
42       support  DMA,  then  no data copying at all is required to complete the
43       I/O.
44
45       Because raw I/O involves direct hardware access to a process's  memory,
46       a  few extra restrictions must be observed.  All I/Os must be correctly
47       aligned in memory and on disk: they must start at a  sector  offset  on
48       disk, they must be an exact number of sectors long, and the data buffer
49       in virtual memory must also be aligned to  a  multiple  of  the  sector
50       size.  The sector size is 512 bytes for most devices.
51

OPTIONS

53       -q     Set  query  mode.  raw will query an existing binding instead of
54              setting a new one.
55
56       -a     With -q ,  specifies  that  all  bound  raw  devices  should  be
57              queried.
58
59       -h     provides a usage summary.
60

BUGS

62       The  Linux  dd  (1)  command  should  be used without bs= option or the
63       blocksize needs to be a multiple of the sector size of the device  (512
64       bytes  usually) otherwise it will fail with "Invalid Argument" messages
65       (EINVAL).
66
67
68       Raw I/O devices do not maintain cache coherency with  the  Linux  block
69       device  buffer  cache.  If you use raw I/O to overwrite data already in
70       the buffer cache, the buffer cache will no  longer  correspond  to  the
71       contents  of the actual storage device underneath.  This is deliberate,
72       but is regarded either a bug or a feature depending on who you ask!
73

AUTHOR

75       Stephen Tweedie (sct@redhat.com)
76

AVAILABILITY

78       The raw command is part of the util-linux-ng package and  is  available
79       from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
80
81
82
83Version 0.1                        Aug 1999                             RAW(8)
Impressum