LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 937|回复: 1

求教:dd 中的 notrunc的用途

[复制链接]
发表于 2007-3-14 12:10:11 | 显示全部楼层 |阅读模式
说明上说是do not truncate the output file,
可是我不觉得这个选项倒底会有什么用?
这是网上的一个文章
Cloning an entire hard disk:

dd if=/dev/sda of=/dev/sdb conv=notrunc,noerror

in this example, sda is the source. sdb is the target. Do not reverse the intended source and target. Surprisingly many people do. notrunc means to not truncate. noerror means to keep going if there is an error. Normally dd stops at any error. if you have a question about a hard drive on whether or not it works, you can try to use it as the source drive for the dd command. You should get an error if it is not working. target drives need to be really messed up to give an error in dd.
不明白如果不用notrunc可能会有什么样的问题。
D
 楼主| 发表于 2007-3-14 15:21:06 | 显示全部楼层
notrunc = no O_TRUNC
O_TRUNC意思是如果此文件存在,且为只读或只写成功打开,就将其长度截短为0
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表