2024年6月13日发(作者:)

dd命令功能很强大的,对于一些比较底层的问题,使用dd命令往往可以得到出人意料的效

果。用的比较多的还是用dd来备份裸设备。但是不推荐,如果需要备份oracle裸设备,可

以使用rman备份,或使用第三方软件备份,使用dd的话,管理起来不太方便。

建议在有需要的时候使用dd对物理磁盘操作,如果是文件系统的话还是使用tarbackup

cpio等其他命令更加方便。

另外,使用dd对磁盘操作时,最好使用块设备文件。

Description

TheddcommandreadstheInFileparameterorstandardinput,doesthe

specifiedconversions,thencopiestheconverteddatatotheOutFile

utandoutputblocksizecanbe

specifiedtotakeadvantageofrawphysicalI/:ThetermBlock

referstothequantityofdatareadorwrittenbytheddcommandinone

operationandisnotnecessarilythesamesizeasadiskblock.

if=file输入文件名标准输入确省

of=file输出文件名,标准输出确省

ibs=n输入块大小,n字节(默认512)

obs=n输出块大小,n字节(默认512)

bs=n同时设置输入输出块大小

cbs=n转换缓冲区大小

files=n在中断之前拷贝和转换n个输入文件

skip=n拷贝之前越过n个输入块

oseek=n拷贝之前从输出文件开始查找n个块

iseek拷贝之前从输入文件开始查找n个块

seek=n等同于oseek

cono=ascic将EBCDIC码转换为ASCII

ebcdicASCII->;EBCDIC

ibmASCII转换为EBCDIC码时轻微不同的映象

blolk将新栈中断的ASCII码记录转换为固定长度

unblock将固定长度的ASCII码记录转换为新行中断记录

lcase变换字将至低等情况

ucase

swab

noerrir

sync

变换字将至高等情况

交换每对字节

出错时不停止处理

将每个块填充到ibs

输入设备:infile参数指定或标准输入

实施指定的转换,然后复制转换数据到outfile参数指定或标准输出。

输入块和输出块大小可以自己指定,但必须是磁盘物理块大小的倍数。

1Usually,r,

whentheoutputfileisnotonadirect-accessdeviceandyouuse

theseekflag,youalsoneedreadaccesstothefile.

2Theddcommandinsertsnew-linecharactersonlywhenconverting

withtheconv=asciiorconv=unblockflagsset;itpadsonlywhen

convertingwiththeconv=ebcdic,conv=ibm,orconv=blockflags

set.

3Usethebackup,tar,orcpiocommandinsteadoftheddcommand

ommandsare

einformationonusing

tapedevices,seethermtspecialfile.

4Theblocksizevaluesspecifiedwiththebs,ibsandobsflags

mustalwaysbeamultipleofthephysicalblocksizeforthemedia