summaryrefslogtreecommitdiffstats
path: root/disk-utils/raw.8
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--disk-utils/raw.893
-rw-r--r--disk-utils/raw.8.adoc67
2 files changed, 160 insertions, 0 deletions
diff --git a/disk-utils/raw.8 b/disk-utils/raw.8
new file mode 100644
index 0000000..adf2c6d
--- /dev/null
+++ b/disk-utils/raw.8
@@ -0,0 +1,93 @@
+'\" t
+.\" Title: raw
+.\" Author: [see the "AUTHOR(S)" section]
+.\" Generator: Asciidoctor 2.0.15
+.\" Date: 2022-05-11
+.\" Manual: System Administration
+.\" Source: util-linux 2.38.1
+.\" Language: English
+.\"
+.TH "RAW" "8" "2022-05-11" "util\-linux 2.38.1" "System Administration"
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.ss \n[.ss] 0
+.nh
+.ad l
+.de URL
+\fI\\$2\fP <\\$1>\\$3
+..
+.als MTO URL
+.if \n[.g] \{\
+. mso www.tmac
+. am URL
+. ad l
+. .
+. am MTO
+. ad l
+. .
+. LINKSTYLE blue R < >
+.\}
+.SH "NAME"
+raw \- bind a Linux raw character device
+.SH "SYNOPSIS"
+.sp
+\fBraw\fP \fI/dev/raw/raw<N>\fP \fI<major>\fP \fI<minor>\fP
+.sp
+\fBraw\fP \fI/dev/raw/raw<N>\fP \fI/dev/<blockdev>\fP
+.sp
+\fBraw\fP \fB\-q\fP \fI/dev/raw/raw<N>\fP
+.sp
+\fBraw\fP \fB\-qa\fP
+.SH "DESCRIPTION"
+.sp
+\fBraw\fP is used to bind a Linux raw character device to a block device. Any block device may be used: at the time of binding, the device driver does not even have to be accessible (it may be loaded on demand as a kernel module later).
+.sp
+\fBraw\fP is used in two modes: it either sets raw device bindings, or it queries existing bindings. When setting a raw device, \fI/dev/raw/raw<N>\fP is the device name of an existing raw device node in the filesystem. The block device to which it is to be bound can be specified either in terms of its \fImajor\fP and \fIminor\fP device numbers, or as a path name \fI/dev/<blockdev>\fP to an existing block device file.
+.sp
+The bindings already in existence can be queried with the \fB\-q\fP option, which is used either with a raw device filename to query that one device, or with the \fB\-a\fP option to query all bound raw devices.
+.sp
+Unbinding can be done by specifying major and minor 0.
+.sp
+Once bound to a block device, a raw device can be opened, read and written, just like the block device it is bound to. However, the raw device does not behave exactly like the block device. In particular, access to the raw device bypasses the kernel\(cqs 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 I/O.
+.sp
+Because raw I/O involves direct hardware access to a process\(cqs memory, a few extra restrictions must be observed. All I/Os must be correctly aligned in 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 virtual memory must also be aligned to a multiple of the sector size. The sector size is 512 bytes for most devices.
+.SH "OPTIONS"
+.sp
+\fB\-q\fP, \fB\-\-query\fP
+.RS 4
+Set query mode. \fBraw\fP will query an existing binding instead of setting a new one.
+.RE
+.sp
+\fB\-a\fP, \fB\-\-all\fP
+.RS 4
+With \fB\-q\fP, specify that all bound raw devices should be queried.
+.RE
+.sp
+\fB\-h\fP, \fB\-\-help\fP
+.RS 4
+Display help text and exit.
+.RE
+.sp
+\fB\-V\fP, \fB\-\-version\fP
+.RS 4
+Print version and exit.
+.RE
+.SH "NOTES"
+.sp
+Rather than using raw devices applications should prefer \fBopen\fP(2) devices, such as \fI/dev/sda1\fP, with the \fBO_DIRECT\fP flag.
+.SH "BUGS"
+.sp
+The Linux \fBdd\fP(1) command should be used without the \fBbs=\fP option, or the blocksize needs to be a multiple of the sector size of the device (512 bytes usually), otherwise it will fail with "Invalid Argument" messages (\fBEINVAL\fP).
+.sp
+Raw I/O devices do not maintain cache coherency with the Linux block device buffer cache. If you use raw I/O to overwrite data already in 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 as either a bug or a feature, depending on who you ask!
+.SH "AUTHORS"
+.sp
+.MTO "sct\(atredhat.com" "Stephen Tweedie" ""
+.SH "REPORTING BUGS"
+.sp
+For bug reports, use the issue tracker at \c
+.URL "https://github.com/util\-linux/util\-linux/issues" "" "."
+.SH "AVAILABILITY"
+.sp
+The \fBraw\fP command is part of the util\-linux package which can be downloaded from \c
+.URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "." \ No newline at end of file
diff --git a/disk-utils/raw.8.adoc b/disk-utils/raw.8.adoc
new file mode 100644
index 0000000..3c570eb
--- /dev/null
+++ b/disk-utils/raw.8.adoc
@@ -0,0 +1,67 @@
+//po4a: entry man manual
+= raw(8)
+:doctype: manpage
+:man manual: System Administration
+:man source: util-linux {release-version}
+:page-layout: base
+:command: raw
+
+== NAME
+
+raw - bind a Linux raw character device
+
+== SYNOPSIS
+
+*raw* _/dev/raw/raw<N>_ _<major>_ _<minor>_
+
+*raw* _/dev/raw/raw<N>_ _/dev/<blockdev>_
+
+*raw* *-q* _/dev/raw/raw<N>_
+
+*raw* *-qa*
+
+== DESCRIPTION
+
+*raw* is used to bind a Linux raw character device to a block device. Any block device may be used: at the time of binding, the device driver does not even have to be accessible (it may be loaded on demand as a kernel module later).
+
+*raw* is used in two modes: it either sets raw device bindings, or it queries existing bindings. When setting a raw device, _/dev/raw/raw<N>_ is the device name of an existing raw device node in the filesystem. The block device to which it is to be bound can be specified either in 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 existence can be queried with the *-q* option, which is used either with a raw device filename to query that one device, or with the *-a* option to query all bound raw devices.
+
+Unbinding can be done by specifying major and minor 0.
+
+Once bound to a block device, a raw device can be opened, read and written, just like the block device it is bound to. However, the raw device does not behave exactly like the block device. In particular, access to the raw 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 I/O.
+
+Because raw I/O involves direct hardware access to a process's memory, a few extra restrictions must be observed. All I/Os must be correctly aligned in 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 virtual memory must also be aligned to a multiple of the sector size. The sector size is 512 bytes for most devices.
+
+== OPTIONS
+
+*-q*, *--query*::
+Set query mode. *raw* will query an existing binding instead of setting a new one.
+
+*-a*, *--all*::
+With *-q*, specify that all bound raw devices should be queried.
+
+include::man-common/help-version.adoc[]
+
+== NOTES
+
+Rather than using raw devices applications should prefer *open*(2) devices, such as _/dev/sda1_, with the *O_DIRECT* flag.
+
+== BUGS
+
+The Linux *dd*(1) command should be used without the *bs=* option, or the blocksize needs to be a multiple of the sector size of the device (512 bytes usually), otherwise it will fail with "Invalid Argument" messages (*EINVAL*).
+
+Raw I/O devices do not maintain cache coherency with the Linux block device buffer cache. If you use raw I/O to overwrite data already in 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 as either a bug or a feature, depending on who you ask!
+
+== AUTHORS
+
+mailto:sct@redhat.com[Stephen Tweedie]
+
+include::man-common/bugreports.adoc[]
+
+include::man-common/footer.adoc[]
+
+ifdef::translation[]
+include::man-common/translation.adoc[]
+endif::[]