- 论坛徽章:
- 0
|
从网上摘了两段话:
1,
http://www.unix.com/filesystems-disks-and-memory/6224-difference-dsk-rdsk.html
When a process sends requests to a rdsk type special file, it is talking directly to the driver. A read or a write goes directly to or from device. Reads and writes must be aligned on DEV_BSIZE boundaries or the results are undefined.
When a process sends requests to a dsk type special file, it is talking to high level os routines. A read or write goes to or from the buffer cache. If needed, the os will read new data into the buffer cache. There are no alignment restrictions. You can read or write any collection of bytes anywhere on the device. The os will send aligned requests to the driver, but this is hidden from the process. I/O requests that arise from accesses to a dsk type special file enter the driver via its strategy entry point, not the read and write entry points. The driver may resequence the requests to optimize overall performance.
2,
http://www.idevelopment.info/data/Unix/Solaris/SOLARIS_UnderstandingDiskDeviceFiles.shtml
Overview
Under Solaris, one of the most involved UNIX devices to understand is the disk device file. Here are several key points that may help:
- In many cases, a disk device file (i.e. /dev/dsk/c0t2d0s7) refers to a particular partition (aka "slice") of a disk, and not the entire physical device. There are several device files which refer to the entire physical device, but are rarely used.
- For every disk device, there are usually two device files - the block device and the character ("raw") device. In general:
- block devices are generally stored under /dev/dsk and used for filesystem type access (e.g mount)
- character devices are generally stored under /dev/rdsk used for everything else (e.g. fsck, newfs, etc..)
- Discs are generally attached to a controller (or a bus) which can handle multiple devices. IDE and SCSI are both common attach methods. This tends to make disk device filename more complex than other types of devices.
/etc/vfstab
To see the difference between the block device and character device for a device, consider the following. The /etc/vfstab contains entries for a single filesystem on a Solaris server: /dev/dsk/c0t2d0s7 /dev/rdsk/c0t2d0s7 /opt ufs 3 yes - The first 2 fields in the above entry, list the same disk device as both a block device ("dsk") and character device ("rdsk"). The block device is used by mount when mounting the filesystem while the character device is used by fsck when checking the filesystem and newfs when creating the filesystem.. Both fields must be present in /etc/vfstab.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/46984/showart_387352.html |
|