免费注册 查看新帖 |

Chinaunix

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

rmt的一个问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-07-21 11:25 |只看该作者 |倒序浏览
磁带机是UNIX上的字符设备(Character Device),但在对磁带机进行读写时又要以块的方式读取数据,为什么?\r\n如:dd命令备份裸设备 dd if=<lv> of=/dev/rmt0 ibs=512 obs=<bs> conv=sync

论坛徽章:
0
2 [报告]
发表于 2005-07-21 13:54 |只看该作者
The distinction is that with a block device you can seek around and\r\naccess any block.  It\'s random access.  Think of a hard disk or a\r\ncdrom.\r\n\r\nA character device doesn\'t offer random access.  You access it as a\r\nstream of data.  With a tape drive you do have a little more\r\nflexibility, as you *can* seek around the tape, but it\'s not\r\ntransparant - instead of using the seek() system calls, you have to\r\nsend the tape drive commands to do what you want it to do.\r\n\r\nThere are device drivers out there that can make a block device out of\r\na tape drive, but they\'re typically r e a l l y slow and are rarely\r\nused.\r\n\r\nOther character devices would be a virtual console, a serial port, a\r\nkeyboard/mouse, a printer, etc.\r\n\r\nThe `blocking factor\' that you\'re referring to is merely the number of\r\nbytes written or read at a time.  It doesn\'t mean it\'s a block device.\r\n\r\n\r\n\r\n--->http://publibn.boulder.ibm.com/d ... es/aixfiles/rmt.htm\r\n\r\nMagnetic tapes are used primarily for backup, file archives, and other off-line storage. Tapes are accessed through the /dev/rmt0, ... , /dev/rmt255 special files. The r in the special file name indicates raw access through the character special file interface. A tape device does not lend itself well to the category of a block device. Thus, only character interface special files are provided
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP