Solved

raw devices disappear after rebooting linux red shat enterprise server 5

Posted on 2009-07-07
8
939 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now