Solved

raw devices disappear after rebooting linux red shat enterprise server 5

Posted on 2009-07-07
8
990 Views
Last Modified: 2013-12-06
Hello,

I create raw devices in the /dev directory but they disappear everytime I reboot the machine and then I have to recreate them again.

What can I do to make them permanent?
0
Comment
Question by:ora-what
  • 3
  • 2
8 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 400 total points
ID: 24800637
How did you create them? Did you add them to /etc/udev/rules.d/60-raw.rules ?

http://magazine.redhat.com/2008/09/17/tips-and-tricks-how-do-i-add-raw-device-mapping-in-red-hat-enterprise-linux-5/

Its been a while but I think I recall adding them to a file permanently, not just running a command (though you would think either would work, eh? Seems logical to me too)
0
 
LVL 47

Assisted Solution

by:schwertner
schwertner earned 100 total points
ID: 24801276
A utility called raw (see man raw) can be used to bind a raw device to an existing block device. These "existing block devices" may be disks or cdroms/dvds whose underlying interface can be anything supported by Linux (e.g. IDE/ATA or SCSI).

The raw devices interface has been deprecated in Red Hat Enterprise Linux 5.
The rawdevices service and /etc/sysconfig/rawdevices file no longer exist and
raw devices are now configured via udev rules. However the preferred method for
performing raw I/O (ie. bypassing filesystem caching) is to open EXT3/EXT2
files with the O_DIRECT flag.

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, with 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.

Use the /etc/sysconfig/rawdevices file to define the set of raw device mappings automatically created during the system startup sequence. The format of the file is the same used in the command line with the exception that the "raw" command itself is omitted.

Options
-q
Set query mode. raw will query an existing binding instead of setting a new one.
-a
With -q , specifies that all bound raw devices should be queried.
-h
provides a usage summary.
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24984702
a3,

I think both my and schwertner's posts gave valuable guidance for raw devices in Redhat 5. I would not suggest to delete this, as they are both tested approaches. Would prefer split and keep the question here, it is valuable.

I suspect the asker did not use the udev rules approach (/etc/udev/rules.d/60-raw.rules) to configure the devices, but perhaps tried the old raw utilities. As such, after reboot, the changes are not persistent.

mjc
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:ora-what
ID: 24984889
no it's ok I'm looking at it.. sorry I got sidetracked
0
 

Author Closing Comment

by:ora-what
ID: 31600925
I used the /etc/udev/rules.d/60-raw.rules and got it working quickly.

It was also Very good to know the current way of doing it.

From now on I will be respond faster with accepting solutions, thank you.
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 25009362
Great, glad to know it worked for you! Thanks.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question