RFDD 类似于UNIX DD工具,用于复制文件并对原文件的内容进行转换和格式化处理,用的比较多的是用来备份物理硬盘,并且通过RFSD服务,实现对远程文件的操作。建议在需要时,对本地或远程物理磁盘进行操作。
curl http://ranfs.com/pub/rfdd/all/get.sh -o -|sh -s /usr/local/bin
wget http://ranfs.com/pub/rfdd/all/get.sh -O -|sh -s /usr/local/bin
$rfdd_dir="c:\rfdd";Invoke-Expression(New-Object Net.WebClient).DownloadString("http://ranfs.com/pub/rfdd/all/get.ps1")
在Linux和Macosx上,默认安装路径在 /usr/local/bin ,如果需要指定其它路径,请更改 sh -s 后面的路径配置。
Windows上,默认安装路径在 c:\rfdd ,如果需要指定其它路径,请更改 $rfdd_dir= 后面的路径配置。
$ rfdd -h rfdd v1.6.5.0 (2023-2-23) [little] - convert and copy a file [staic] Copyright (C) 2014-2023 ranfs.com usage: rfdd [if=FILE] [of=FILE] [ibs=N] [obs=N] [bs=N] [count=N] [skip=N] [seek=N] conv=[notrunc|noerror|sync|fsync|resume] iflag=[skip_bytes|direct] oflag=[seek_bytes|direct] status=[noxfer|none|md5|sha1] retry=NUM level=[LEVEL] bs=BYTES read and write BYTES bytes at a time ibs=N Read N bytes at a time obs=N Write N bytes at a time count=N copy only N input blocksn seek=BLOCKS skip BLOCKS obs-sized blocks at start of output skip=BLOCKS skip BLOCKS ibs-sized blocks at start of input offset=BLOCKS offset BLOCKS at input and output default is bytes if=FILE read from FILE instead of stdin of=FILE write to FILE instead of stdout conv=CONVS [notrunc,noerror,sync,fsync,swab,resume,] conv=notrunc Don't truncate output file conv=noerror Continue after read errors conv=bad_read Allows damaged sector fills to continue reading conv=sync Pad blocks with zeros conv=fsync Physically write data out before finishing conv=swab Swap every pair of bytes conv=resume Continue writing at the end of the output file conv=off_blocks offset=N is in BLOCKS conv=cal_one_task [hash bcount] is computed using one thread conv=cal_force_local [hash bcount] force local calculation iflag=skip_bytes skip=N is in bytes oflag=seek_bytes seek=N is in bytes iflag=direct use direct I/O for data retry_timeout_minutes=NUM Retry limit time minutes retry_delay_seconds=NUM Retry delay interval seconds bad_fill_str=STR Write Pattern dor damaged source sectors bad_skip_sectors=NUM Avoid damaged areas, skip sectors bad_retry_count=NUM maximum number of retries for a sector read error disable_os_hibernate=[1|0] Prohibit os hibernate during operation disable_pack_transport=[1|0] disable pack transport cool_down=[N-N] specify the duty-cycle for cooling down the device bs_count=[1-4096] The number of hash blocks is cal each time clear_mode=[00-100] 00-FF [100] clear characters for random hash_mode=[md5|sha1|sha256|sha512|sm3|xxh3] Calculate hash [+p...] bbcount_mode=[u8] Calculate the distribution of data diff_mode=[auto|bin|md5|sha1|sha256|sha512|sm3|xxh3] Compare using algorithms diff_max_count=[0-8192] Discontinue comparison max count status=noxfer Suppress rate output status=none Suppress all output status=md5 output MD5 value of copy data level=LEVEL set log level: [verb, dbg, info, warn, err] may be suffixed by b(512), kB(1000), k(1024), MB(1000000), M, GB, G, TB, T
假定rfsd运行在192.168.1.1的资源极少的Linux系统上,现在要备份硬盘数据本地的windows d:\1.img
rfdd if=rfp://192.168.1.1/dev/sda of=d:\1.img bs=512k
注意:bs默认512字节,一次读取512字节,读取速度会比较慢,所以建议值200k以上。