raw device property

Artem Kachitchkine Artem.Kachitchkin at Sun.COM
Tue Mar 28 12:25:29 PST 2006

In Solaris and some other unixes for each block device there is a 
corresponding character device, which we call a raw device, e.g:

$ ls -lL /dev/{dsk,rdsk}/c0d0p0
brw-r-----   1 root     sys      102, 16 Mar 28 12:15 /dev/dsk/c0d0p0
crw-r-----   1 root     sys      102, 16 Mar 28 12:15 /dev/rdsk/c0d0p0

Data from/to a raw device doesn't go through buffer cache. Also, many 
ioctls, such as getting CDROM TOC and CD-DA data, are only allowed on a 
raw device.

Initially I thought the apps would just convert /dev/dsk/* to 
/dev/rdsk/*, but besides being pain in the butt, it's also not generic 
enough. What if block->raw name conversion is more difficult or expensive?

I propose to add an optional property "block.raw_device" to point to the 
raw device corresponding to the "block.device" block device. Apps like 
nautilus CD burner then check if "block.raw_device" exists, and if not, 
fall back to "block.device".

If there are no protests and the property name is adequate, I will upate 
the spec.


More information about the hal mailing list