免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1919 | 回复: 0
打印 上一主题 下一主题

/dev/dsk /dev/rdsk 区别 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-09-22 01:12 |只看该作者 |倒序浏览
从网上摘了两段话:
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
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP