what is block device and character device?



what is block device and character device?..

Answer / guest

$ ls -altr /dev/
brw-rw---- 1 root disk 8, 6 2010-07-26 14:20
sda6 --> block device
crw-rw---- 1 root root 10, 59 2010-07-26 14:21 device-
mapper --> character device
Answer :

Character devices deal with IO on a character by character
basis. The most obvious example is a keyboard, where every
key generates a character on the device. The mouse is
another. Every motion or button click sends a character to
the /dev/input/mouse0 device. To test it out do
$cat /dev/input/mouse0 , then move your mouse (see what
happens)

Block devices read data in larger chunks or blocks. Data
storage devices, such as IDE hard drives (/dev/hd), SCSI
hard drives (/dev/sd), and CD-ROMs (/dev/cdrom or /dev/sr0)
are block devices. IO interactions with block devices
transact with chunks of data (blocks), which allows large
quantities of data to be moved back and forth more
efficiently(unlike character device). eg: $df -h

Generically, block devices can be mounted and are cached,
and char devices are for communication devices, aren’t
cached nor block aligned, and can’t be mounted.

Specifically, /dev/scd* (block) are for cdroms, providing
the block access and commands for ejecting, closing,
playing, etc.

The corresponding character device for the cdrom is /dev/sg1

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Linux General Interview Questions

What is the main advantage of creating links to a file instead of copies of the file?

2 Answers  


What is the latest linux kernel?

0 Answers  


How to find out shared file&dir of ftp?

0 Answers  


Tell us the difference between telnet and ssh?

0 Answers  


What is the full name of linux?

0 Answers  


Linux initially was developed for intel x86 architecture but has been ported to another hardware platform than any other operating system. Do you agree?

0 Answers  


How to unzip a file in Linux?

0 Answers  


How do I send email with linux?

0 Answers   Arigo Infotech,


What is a typical size for a swap partition under a linux system?

0 Answers  


What is kali linux used for?

0 Answers  


Why linux is safe?

0 Answers  


What is the basic difference between unix and linux operating system?

0 Answers  


Categories