Solved

raw devices disappear after rebooting linux red shat enterprise server 5

Posted on 2009-07-07
8
960 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

939 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

10 Experts available now in Live!

Get 1:1 Help Now