[Sunhelp] Tape Drive -- Block or Raw Device?
He Gang-W1268C
Gang_He-W1268C at email.mot.com
Tue Aug 10 09:35:10 CDT 1999
It confused me also.
In solaris, each disk slice has two access paths. one is raw device and the
other block device.
when you use the disk as a file system with command like cp, ls, you use its
block device /dev/dsk,
when you use them as streamed data device with command like newfs or fsck,
it is using raw device /dev/rdsk
Can I say a disk like c0t3d0s1 is blockdevice? or raw device?
Gang
-----Original Message-----
From: Doug McLaren [mailto:dougmc at frenzy.com]
Sent: Monday, August 09, 1999 3:30 PM
To: sunhelp at ohno.mrbill.net
Subject: Re: [Sunhelp] Tape Drive -- Block or Raw Device?
On Mon, Aug 09, 1999 at 11:22:50AM -0500, He Gang-W1268C wrote:
| I would say it's block device.
I would say it's not. It's a character device.
% ls -la /dev/rmt/0mn
lrwxrwxrwx 1 root root 51 Sep 29 1997 /dev/rmt/0mn ->
../../devices/sbus at 3,0/SUNW,fas at 3,8800000/st at 4,0:mn
% ls -la /devices/sbus at 3,0/SUNW,fas at 3,8800000/st at 4,0:mn
crw-rw-rw- 1 root sys 33, 140 Sep 29 1997
/devices/sbus at 3,0/SUNW,fas at 3,8800000/st at 4,0:mn
That `c' means character device. For comparison, a block device would
look like this -
% ls -la /devices/sbus at 3,0/SUNW,fas at 3,8800000/sd at 0,0:a
brw-r----- 1 root sys 32, 0 Sep 26 1997
/devices/sbus at 3,0/SUNW,fas at 3,8800000/sd at 0,0:a
The distinction is that with a block device you can seek around and
access any block. It's random access. Think of a hard disk or a
cdrom.
A character device doesn't offer random access. You access it as a
stream of data. With a tape drive you do have a little more
flexibility, as you *can* seek around the tape, but it's not
transparant - instead of using the seek() system calls, you have to
send the tape drive commands to do what you want it to do.
There are device drivers out there that can make a block device out of
a tape drive, but they're typically r e a l l y slow and are rarely
used.
Other character devices would be a virtual console, a serial port, a
keyboard/mouse, a printer, etc.
The `blocking factor' that you're referring to is merely the number of
bytes written or read at a time. It doesn't mean it's a block device.
---
Doug McLaren, dougmc at frenzy.com
_______________________________________________
SunHELP maillist - SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp
More information about the SunHELP
mailing list