1834883 Members
2515 Online
110071 Solutions
New Discussion

RAW device

 
Anit
Occasional Contributor

RAW device

what is the function of raw device and how its works.
5 REPLIES 5
Bharat Katkar
Honored Contributor

Re: RAW device

Hi Anit,
Raw device is the raw partition on the disk. System communicate with this partition using character device which is faster than block device.
Raw devices are normally used for configuring SWAP Space and Database files on the Systems.

When you format the partition or create PV,LV and then create FileSystem on the top of it then it becomes a block device and follow the filesystem architecture.
Due to FS overhead it becomes bit slower as compared to RAW device.

For more details you may visit http://docs.hp.com

Hope that helps.
Regards,

You need to know a lot to actually know how little you know
Suraj Singh_1
Trusted Contributor

Re: RAW device

When a process sends requests to a rdsk type special file, it is talking directly to the driver. A read or a write goes directly to or from device.

When a process sends requests to a dsk type special file, it is talking to high level os routines. A read or write goes to or from the buffer cache. If needed, the os will read new data into the buffer cache. There are no alignment restrictions. You can read or write any collection of bytes anywhere on the device. The os will send aligned requests to the driver, but this is hidden from the process. I/O requests that arise from accesses to a dsk type special file enter the driver via its strategy entry point, not the read and write entry points. The driver may resequence the requests to optimize overall performance.
What we cannot speak about we must pass over in silence.
Saravanan_15
Advisor

Re: RAW device

Hi Anit,
If you are using raw device file for data transfer, ur data will be directly written to the disk device. It won't use buffer cache for data transfer, while the block device files use buffer cache for data transfer. The data transfer will be byte by byte in raw, while the block device file is block by block....
If the power fails while the data transfer is taking place, in the case of block device the data that are in buffer(the data that are modified) will be lost.. But, in case of raw device, there is no loss of modified data since it's not using buffer for writing.. That's why most of the databases are using raw device file for data manipulation...
Hope this will give you an idea about raw devices...
Regards,
Saravanan M
Nick Wickens
Respected Contributor

Re: RAW device

Our Informix databases use raw volumes because of the caching issue with LVM. This was a problem a while back when we wanted to use LVM to perform split mirror backups but were worried about data loss because of the caching.

However I have since found at that LVM volumes can be mounted with caching turned off (one of the -o options I believe).
Hats ? We don't need no stinkin' hats !!
Saravanan_15
Advisor

Re: RAW device

In OS (hp-ux) perspective,
All low level operations on disk devices has to be done using the raw device files. for example, we've to use raw devices for creating PV and filesystems. For Ex:

To Initialize PV
#pvcreate /dev/rdsk/c0t2d0

To create a filesystem on lvol1 of vg02
#newfs -F vxfs /dev/vg02/rlovl1

Regards,
Saravanan M