13.2. Basics of Raw Devices


To bind the first raw device /dev/raw/raw1 to the /dev/sdz SCSI disk or LUN you can execute the following command:
Copy to Clipboard Toggle word wrap
# raw /dev/raw/raw1 /dev/sdz
Now when you run the dd command on /dev/raw/raw1, it will write directly to /dev/sdz bypassing the OS block buffer cache:

Warning

The following command will overwrite data on dev/sdz
Copy to Clipboard Toggle word wrap
# dd if=/dev/zero of=/dev/sdz count=1
To permanently bind /dev/raw/raw1 to /dev/sdz, add an entry to the /etc/sysconfig/rawdevices file:
Copy to Clipboard Toggle word wrap
/dev/raw/raw1 /dev/sdz
Now when you run /etc/init.d/rawdevices it will read the /etc/sysconfig/rawdevices file and execute the raw command for each entry:
Copy to Clipboard Toggle word wrap
/etc/init.d/rawdevices start
To have /etc/init.d/rawdevices run each time the system boot, it can be activated by executing the following command:
Copy to Clipboard Toggle word wrap
chkconfig rawdevices on

Note

For each block device you need to use another raw device.
To bind the third raw device to the second partition of /dev/sdz, the entry in /etc/sysconfig/rawdevices would look like this:
Copy to Clipboard Toggle word wrap
/dev/raw/raw3 /dev/sdz2
Or to bind the 100th raw device to /dev/sdz, the entry in /etc/sysconfig/rawdevices would look like this:
Copy to Clipboard Toggle word wrap
/dev/raw/raw100 /dev/sdz
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat, Inc.