?
Solved

raw devices disappear after rebooting linux red shat enterprise server 5

Posted on 2009-07-07
8
Medium Priority
?
1,088 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 1600 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 48

Assisted Solution

by:schwertner
schwertner earned 400 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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to recover a database from a user managed backup
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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