Re: raw database
Posted in 1998
On 27 Dec 1998, Immanuel Litzroth wrote: Hi ! > Hi, > A question about using the raw database device under linux. I am using > the new IDS release for Linux (Thank You, Informix) and have a little > trouble in grasping the concept of "raw disk". Can I just use the > device corresponding to a harddisk partition to get the db to use > this? It seems that Informix does not support them officially. This devices use filesystem cache to speed I/O, so application should use fsync(2) to guarantee writing data to disk. It is possible that Informix do not this, since traditional "raw" devices do not use cache. Otherwise Linux devices are OK. Moreover, using raw devices removes filesystem cache pollution with database data, speeding up other applications. Linux devices have not this advantage. > What is > "the raw disk interface that character-special files provide" ?? This means that application could issue fd=open("/dev/hda1",O_RDWR) and then do read/write/lseek on this descriptor. Linux "disk" devices support these operations. > Does this require a special device driver for a partition on your > drive? If it does require a special device driver, is there a standard > interface to such devices? Classic Unix device driver interface separates block devices and character devices. They have different set of operations. Of course the same device driver could provide both set of operations, but it will have two different device files (for block and for character operations). In some Unix versions read/write/lseek were added to block device interface making these devices hybrid (like in Linux). > Why are these disk interfaces called character-special, If they are > still block devices? In classic Unix they are different devices - block devices do not support read/write/lseek, they provide strategy/interrupt interface used by kernel. Character devices for accessing disk partitions do not use disk cache. Sorry for bad English Timofey Kutergin