Penguin
Annotated edit history of raw(8) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 RAW
2 !!!RAW
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 OPTIONS
7 BUGS
8 AUTHOR
9 ----
10 !!NAME
11
12
13 raw - bind a Linux raw character device
14 !!SYNOPSIS
15
16
17 __raw__ ''/dev/raw/raw
18 ''
19
20
21 __raw__ ''/dev/raw/raw
22 ''
23
24
25 __raw -q__ ''/dev/raw/raw''
26
27
28 __raw -qa__
29 !!DESCRIPTION
30
31
32 __raw__ is used to bind a Linux raw character device to a
33 block device. Any block device may be used: at the time of
34 binding, the device driver does not even have to be
35 accessible (it may be loaded on demand as a kernel module
36 later).
37
38
39 __raw__ is used in two modes: it either sets raw device
40 bindings, or it queries existing bindings. When setting a
41 raw device, ''/dev/raw/raw'' is the device name
42 of an existing raw device node in the filesystem. The block
43 device to which it is to be bound can be specified either in
44 terms of its ''major'' and ''minor'' device numbers,
45 or as a path name ''/dev/'' to an
46 existing block device file.
47
48
49 The bindings already in existence can be queried with the
50 ''-q'' option, with is used either with a raw device
51 filename to query that one device, or with the ''-a''
52 option to query all bound raw devices.
53
54
55 Once bound to a block device, a raw device can be opened,
56 read and written, just like the block device it is bound to.
57 However, the raw device does not behave exactly like the
58 block device. In particular, access to the raw device
59 bypasses the kernel's block buffer cache entirely: all I/O
60 is done directly to and from the address space of the
61 process performing the I/O. If the underlying block device
62 driver can support DMA, then no data copying at all is
63 required to complete the I/O.
64
65
66 Because raw I/O involves direct hardware access to a
67 process's memory, a few extra restrictions must be observed.
68 All I/Os must be correctly aligned in memory and on disk:
69 they must start at a sector offset on disk, they must be an
70 exact number of sectors long, and the data buffer in virtual
71 memory must also be aligned to a multiple of the sector
72 size. The sector size is 512 bytes for most
73 devices.
74 !!OPTIONS
75
76
77 __-q__
78
79
80 Set query mode. __raw__ will query an existing binding
81 instead of setting a new one.
82
83
84 __-a__
85
86
87 With __-q__ , specifies that all bound raw devices should
88 be queried.
89
90
91 __-h__
92
93
94 provides a usage summary.
95 !!BUGS
96
97
98 The Linux __dd__ (1) command does not currently align its
99 buffers correctly, and so cannot be used on raw
100 devices.
101
102
103 Raw I/O devices do not maintain cache coherency with the
104 Linux block device buffer cache. If you use raw I/O to
105 overwrite data already in the buffer cache, the buffer cache
106 will no longer correspond to the contents of the actual
107 storage device underneath. This is deliberate, but is
108 regarded either a bug or a feature depending on who you
109 ask!
110 !!AUTHOR
111
112
113 Stephen Tweedie (sct@redhat.com)
114 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.