From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,dcfbec7fa1ce4b94 X-Google-Attributes: gid1164f8,public From: ron@topaz.sensor.com (Ron Natalie) Subject: Re: raw disk device Date: 1996/04/01 Message-ID: <4jpgge$hpb@topaz.sensor.com>#1/1 X-Deja-AN: 145292564 references: <4jn11n$bvr@vixen.cso.uiuc.edu> organization: Sensor Systems newsgroups: comp.sys.dec Steve Peltz (peltz@cerl.uiuc.edu) wrote: : This may be a stupid question, but we haven't figured out the answer yet. : We're trying to use raw disk partitions, and are finding that writing to : the block device (e.g. re9e) is MUCH slower than writing to the character : device (rre9e). Now, I could understand that if they were unaligned access, : but if that's the answer, I've been unable to find the right alignment. : Specifically, I've used 320*7*64 bytes (8*35 512-byte sectors), I'm simply : opening the raw device r/w, and writing without doing any seeks. The 8*512 : factor in there should handle any power of 2 block sizing up to 4K. First off, you are confusing the terminonlogy. UNIX refers to the character device as the RAW device. The block device as the cooked device. Note that while 'block' is descriptive of the buffered block devices, the character designator really just means 'not block' (the original 'non-block' devices were things like terminal interfaces). The RAW device transfers directly from your user memory to the device controller. It will always give you the fastest performance if you can deal with the constraints involved (alignment/transfer size, etc). The COOKED device is buffered through the kernel buffer cache and always involves at least one extra copy and perhaps will break your I/O request up (you do not have control over it). What makes you think you want to use the block device?