November 22, 2024, 11:01:33 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Why Character Device  (Read 7081 times)

Offline rajesh.bahl

  • Linux Learner
  • ***
  • Posts: 86
Why Character Device
« on: May 13, 2007, 05:18:55 PM »

Dear All,

Hi !

I have one confusion regarding the classification of tape drives in Linux/Unix.
Although we always work with "Block size" while doing backup or restoring data back, still tape device is considered as "character device".  As per concept/definition a device that reads/writes data in units of blocks is a block device.Hence shouldn't tape be a block device rather than character device?

KIndly help in clearing the concept !




Regards
rajesh.bahl

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Re: Why Character Device
« Reply #1 on: May 14, 2007, 04:44:32 PM »
Tape is character device because you can only do sequential access on tape on the other hand block devices are those which can do random access.

But now this again give rise to a question that if Tape Drive is a Character Device then why we mostly use block device to operate on tapes ?
Actually Tape is always a character device but to  make things easy, data is passed through system cache and thus allow to use it as block device. !

Offline rajesh.bahl

  • Linux Learner
  • ***
  • Posts: 86
Re: Why Character Device
« Reply #2 on: May 14, 2007, 06:40:02 PM »

Sequential access is okay -understandable but even if system cache is used to access this device that should not be the basis of its classification as character device.

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Re: Why Character Device
« Reply #3 on: May 14, 2007, 07:31:02 PM »
I think for the ease of use.. such storage devices are treated as block devices & hence Tape too!