Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between block and character device ??

Status
Not open for further replies.

letis

Technical User
Sep 24, 2003
95
FR
Hello,

could someone explain me what is the difference between a block device and a caracter device ??

I mean, if a caracter device is supposedly accessed by reading or writing one caracter at a time, why is the following workin g :

dd if=/dev/rhdisk0 of=/tmp/test bs=512 count=10

thanks in advance for your lights,


 

With that command you're reading ten 512 bytes blocks from a block device. Where's the confusion?

Cheers
 
A character device is one from which you can read a sequence of characters--for example, the sequence of keys typed at a keyboard or the sequence of bytes sent over a serial line.

A block device is one that stores data and offers access to all parts of it equally; floppy and hard disks are block devices.

Block devices are sometimes called random access devices, just as character devices are sometimes called sequentially accessed devices.

With the latter, you can get data from any random part of a hard disk, but you have to retrieve the data from a serial line in the order it was sent.





Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top