有时用GHOST备份失败,可能文件出了什么问题。。。
就自己写了个程序
TOdisk 成功地备份了。。
用扇区方式备份硬盘或分区或任意扇区。。。
支持压缩和分卷,扩展分区,多任务。。。等等。。
多谢 中国DOS联盟的johnsonlam兄(香港),fastslz兄 等等热心网友, ddcopy作者李治先生和 老外Lucho的帮助和支持!
欢迎访问
http://www.cn-dos.net 和
http://johnson.tmfc.net/dos/index.html 进行DOS交流
说明如下:
硬盘/分区/扇区 =freE=(自由) 备份/恢复器 ==TOdisk ==(扇区模式)
版本:1.3 alpha
运行环境: MS-DOS / Win9xMS-DOS窗口 (如加载UDMA驱动,可能运行反常)
TOdisk version 1.3 Alpha Copyright (C) 2006-2007 by GOTOmsdos, 2007-1-13
Email:
tdaim@sina.com
语法:
<执行模式>
TOdisk 源串1 TO 目标串1 ]]]]
<查看模式>
TOdisk |-P|]]
<执行模式>
源/目标 串: (硬盘串, 分区串, DOS盘符串, 镜象文件串)
1, 硬盘 串 >> 1 or 2...n
2, 分区 串 >> 1:2 or 2:3...n:n
3, DOS盘符 串 >> C: or D:... Z:
4, 镜象文件 串 >>
镜象文件参数:
Cn - C : (compress)压缩
n : 压缩级别(1-9,6 可能是强度和速度的最佳平衡点,如没有级别,则取默认的6)
K - K : key 压缩密码,需要提示输入密码
Vn - V : (volume) 分卷
n : 每卷大小的MBs(从1到2047) 如果没有指定,默认是2047
E? - E : (every)每卷的压缩密码跟第一卷的一样
? : 每卷都要提示输入压缩密码
--A
是目标时:
(c:\image.to) <不压缩,不分卷>
(c:\image.to=Vn) <不压缩,分卷>
(c:\image.toz=Cn) <压缩,不要密码,不分卷>
(c:\image.toz=Cn=K) <压缩,要提示输入密码,不分卷>
(c:\image.toz=Cn=K=Vn) <压缩,要提示输入密码,分卷,只有第一卷(即第一个镜象文件)有密码>
(c:\image.toz=Cn=K=Vn=E) <压缩,要提示输入密码,分卷,每卷的密码跟第一卷的一样>
(c:\image.toz=Cn=K=Vn=E?) <压缩,要提示输入密码,分卷,每卷都要提示输入密码>
例子:
(g:\image.toz=c7=k=v1000=e?)
(注意:在多任务中,当镜象文件串是目标时,只能位于最后一个(所以,也只能有一个)
例子:
合法:
1:1 TO 2:3,3:4,(g:\image.toz=c=v)
1:1,2:2,3:3 TO 2:3,3:4,(g:\image.toz=c=v)
1:1 TO 2:3,(g:\image.toz=c=v)+10000,3:4
1:1,2:2,3:3 TO 2:3,(g:\image.toz=c=v)+20000,3:4
1:1,3:4,4:4 TO 2:3,(f:\image1.toz=c=v)+30000,(g:\image2.toz=c=v)
1:1,2:2,3:3 TO 2:3,(g:\image.toz=c=v),3:4 -p
1:1,3:4,4:4 TO 2:3,(f:\image1.toz=c=v),(g:\image2.toz=c=v) -p
不合法 1:
1:1 TO 2:3,(g:\image.toz=c=v),3:4
1:1,2:2,3:3 TO 2:3,(g:\image.toz=c=v),3:4
(自由模式,既不是最后一个也没指定要操作的扇区数<用'+'>)
不合法 2:
1:1,3:4,4:4 TO 2:3,(f:\image1.toz=c=v),(g:\image2.toz=c=v)
(自由模式,既超过了一个镜象文件串也没为最后一个之前的镜象文件串指定要操作的扇区数<用'+'>)
)
--B
是源时(会自动判断是否是压缩,所以,即使以to为后缀的压缩文件也能被识别为压缩文件):
(c:\image.toz) <不自动搜索分卷>
(c:\image.toz=V) <自动搜索分卷>
<镜象文件名,如不压缩建议后缀为to, 如压缩建议后缀为toz, 以免跟其他文件名混淆,不过程序并不强制这样)
在源/目标串中
- : 指定要操作的起始扇区
+ : 指定要操作的扇区数
但在镜象文件串中不被允许
例子:
1-5000
1:2+5000
D:-5000+10000
(g:\image.toz)+3000
源/目标串开关:
=q : quiet 安静(无询问)
=m : mute 沉默(无信息显示)
=i : ignore 忽略(忽略读写错误,但对镜象文件串无效)
=n : next 下一个(如果遇到致命错误,就继续下一个任务)
例子:
1:2=q=m,3:4 TO 4:1=i=n,(file=c)=q=m
如果源/目标串中有 - + 操作符,那么
用在源/目标串中的以上的参数( i, q,m, n) 必须放在 - 或 + 的后面:(当然,在 匹配模式 -d,
-p 中,本来就不能有- + 操作符,自然就不存在这个问题 )
例子:
1:2-300+400=q=m,3:4 TO 4:1=i=n,(file=c)+500=q=m
全局开关 1 (模式开关):
--A
(匹配模式)
-d|p 硬盘|分区 子模式
在匹配模式中,源串和目标串的个数必须相等。此外,在分区模式中,如果目标串是分区,要更新分区ID)
-d 硬盘模式例子:
1,2 TO 3,4 -d
等价于两次分开的操作:
1 TO 3
2 TO 4
但不等价于
1,2 TO 3,4
除非1,3大小相同, 2,4大小相同
-p 分区模式例子:
1:2,4:3,2:2 TO 2:3,(d:\back.toz=c),4:5 -p
等价于三次分开的操作:
1:2 TO 2:3 -p
4:3 TO (d:\back.toz=c)
2:2 TO 4:5 -p
(其中,由于第一和第三任务既是分区模式又是写分区<目标是分区不是镜象文件>,所以,即使在分开的操作中也要加上 -p, 表示要更新分区ID. )
--B
(自由模式)
无 -d|p 开关
在自由模式中,不要求源串和目标串的个数相等,前后任务之间的数据传输有相互接续的关系)
比如:
硬盘1 总扇区 1000
硬盘2 总扇区 2000
硬盘3 总扇区 1500
硬盘4 总扇区 3000
1,2 TO 3,4
这是自由模式,过程如下:
任务 1:
硬盘1 传递给 硬盘3 1000个扇区 (硬盘1 完成任务,退出)
任务 2:
硬盘2 传递给 硬盘3 1500-1000=500个扇区 (硬盘3 完成任务,退出)
任务 3:
硬盘2 传递给 硬盘4 2000-500=1500 个扇区 (硬盘2 完成任务,退出)
程序便退出(因为 源和目标已经有一方完成了)
程序这样处理是考虑到 灵活性: 可能 使用者 可能并不确切的知道各个分区,硬盘的精确大小等等东西,但是又想完成前面的已经满足
条件的数据...
在自由模式中,不要求源串和目标串的个数相等,因为前后任务之间的数据传输有相互接续的关系
例如:
1 TO 2:3,3:4,4:5,(g:\file.to)
全局开关 2 :
(下列位于命令行参数的后端,对全部任务有效):
-q|quiet : 安静(无询问)
-m|mute : 沉默(无信息显示)
-i|ignore : 忽略(忽略读和写错误,但对镜象文件串无效)
-ir|ignorereaderror : 忽略读错误
-iw|ignorewriteerror : 忽略写错误
-n|next : 下一个(如果遇到致命错误,就继续下一个任务)
例子:
1:2,E: TO 2:3,(back.toz=c) -q -m -n -i
总的例子:
单任务:
1 TO 2
复制硬盘1到硬盘2
1-100+1000 TO 2-200
从硬盘1第100扇区复制到硬盘2的第200扇区,总共复制1000个扇区
1:2 TO 2:3
复制硬盘1分区2到硬盘2分区3
1:2-200+1000 TO 2:3-300
从硬盘1分区2第200扇区复制到硬盘2分区3的第300扇区,总共复制1000个扇区
1:2 TO (d:\backup.toz=c=k=v1000=e?)
备份硬盘1分区2到镜象文件d:\backup.toz
c - 压缩级别6
k - 提示输入压缩密码
v1000 - 分卷,每卷大小1000 MBs
e? - 每卷都要提示输入压缩密码
多任务:
匹配模式:
1:2,(h:\image.toz=v),2:3 TO (g:\image.toz=c=v),D:,3:2 -p
自由模式:
1:2,2:3-2345,3:4 TO 3:3-1234+300,4:1+3456,(i:\image.toz=c=v1000)
<查看模式>
警告!!!
程序显示出的分区总表中的 DOS 盘符 是按照 DOS的盘符分配规律推测出的,不一定准确,尤其是场合性的挂载额外的驱动器
(如U盘,移动硬盘,虚拟盘等),仅作参考。但是表中显示的分区数字是没有问题的。
-Dn 显示硬盘n的信息
-P 显示全部硬盘全部分区的信息
noz|nozero : 不显示分区ID为0的分区
noh|nohidden : 不显示隐藏分区
nozh|nozerohidden : 不显示分区ID为0的分区和隐藏分区
fn|fatntfs : 显示FAT和NTFS分区
f|fat : 显示FAT分区
l|linux : 显示LINUX分区
n:n - 1:2 or 2:3 ...
A: - C: or D: ... Z:
例子:
-d : 显示全部硬盘
-d2 : 显示硬盘2
-p : 显示全部硬盘全部分区
-pfn : 显示FAT和NTFS分区
-p2:3 : 显示硬盘2分区3
-pc: : 显示 C:
*********
补充说明
*********
本程序采用的是扇区方式:
企业方式或者是极其重要的数据,应该采用扇区方式.
×××××××××××××××××××××
特别建议:
1
本程序很适合备份塞满文件的分区。
2
由于是扇区方式,所以可以备份任何文件系统的 分区(包括LINUX等等。。。)
不过,如果要备份到镜象文件,镜象文件所在分区只能是FAT/FAT32.
××××××××××××××××××××××××××××××
骨干开关:
一 匹配模式(包括 硬盘模式(-d) 和分区模式 (-p))
这种模式最常用,尤其是 分区模式.
这种模式由于处理的是 格式数据(硬盘和分区),所以,要匹配,至少是原数据块要小于目标数据块(在这种情况下,如果是分区模式,除了
把源分区的分区ID,和80/00是否活跃标志共两处,两个字节更新到目标分区外,目前不支持更新分区的大小,这涉及到搬移其后的所有分
区!,而且,对于一般用户,用的较少,一般都是哪里来哪里去的,起到一个备份恢复作用..)
由于是格式匹配模式,所以不允许使用 - 和 + 操作符.
匹配模式 的 源串和目标串的个数必须相等,否则警告退出
匹配模式支持镜象文件串.
除了分区模式要用源分区的分区ID和80/00更新目标分区的分区表外,
多任务的匹配模式 等价于自由模式的单任务的无 - + 的个数相同的一对一的串合。
二 自由模式(没有 -d 和 -p 参数)
这是精确到扇区的方式,可以任意指定要处理的起始扇区(前缀 是 - )和扇区操作数(前缀是 + , 小联想:
GRUB 也是用 + 表示要加载的数据块(扇区)的个数).
如:
1-100+200 表示 从硬盘1 的开始扇区100处执行 执行扇区数为200
镜象文件串也支持 + 操作符,但不支持 - 操作符.
技术上,是可以支持的,但是,要在文件的海量之处都作上记号,但这将极大的降低文件读取的速度
如:
(e:\back=c=v100)+1000 表示总共执行文件含有的总扇区的1000个扇区
如下非法:
(e:\back=c=v100)-1000 试图从文件含有扇区的第1000个扇区处执行,但非法.
这种模式对 RAW数据的恢复非常有用.也就是用尽了全部文件式数据恢复工具不能找到数据的情况下,就要借助于扇区模式了..
源/目标串
硬盘串:
1
执行为:
硬盘1 开始扇区0 处理扇区为整个硬盘的总扇区
分区串:
1:1
执行为:
硬盘1 分区1的开始扇区 处理扇区为分区1的总扇区
DOS盘符串:
C:
程序在分区表中找出其对应的分区,然后等同于分区串
镜象文件串
要用括号括起来()
完全的参数如下:
(d:\image=c=k=v1000=e?) 用 = 号 连接
第一为文件名(8.3格式)
Cn C(COMPRESS) 压缩, 9 为压缩级别,(1-9,6 可能是强度和速度的最佳平衡点,如没有级别,则取默认的6)
K (KEY),表示压缩文件有密码. 默认没有密码,有K,表示要有密码,那么当程序创建压缩镜象时,会要求用户输入密码,以便下次用文件
恢复到硬盘前,也要用户输入密码,这是安全需要.
(但是,仅有K,只会对第一个压缩文件要求密码,如果有分卷,不会后面的分卷要求密码)
Vn V(Volume)表示有分卷功能, 在把硬盘数据存为分卷文件时,用户可以指定每个分卷的大小(以MB为单位 ),n 表示 MB,默认是2047
V1000 表示 以每 1000MB为一卷
(补充: 当文件参数在左边时,也就是源位置时, 如没有V, 程序将只处理一个文件,不擅自寻找是否有分卷(因为这样有可能自做主张
了. 如果 有 V, 将自动寻找其分卷,但只要给出 这个 V 即可,无需 n)
E? E (Eevry)表示对每个压缩的分卷要求密码,如果没有 ? , 程序会把第一文件(母卷)的密码都自动写入后面的分卷中.如果有 ? 表
示 对每个压缩的分卷文件要求密码,并且 停下来,等待用户输入.
***********************************************
关于本程序采用的压缩库 zlib 和艰辛的寻找过程
***********************************************
1
试了,简单古老版的 LZ, LZW,HUFFMAN,LZHUF,LZSS,LZHARC, LZ77,LZARI,LZRW1等等,都不理想,太老,效率太低,只能用来教学。
2
看了 ARJ/UNARJ,有很多我不要的功能。。
3
曾定在 GZIP(BZIP2,基本差不多),很不错,也觉得有点适合我,压缩比和速度都很好,还有1-9的压缩比选项。。钻研了几天,
发现没有内存压缩,只有文件压缩,。。。
4
看到一个提示: zlib 支持内存压缩!
确定它了!
(ZLIB和GZIP,PNG都采用相同的引擎:基于LZ77和HUFFMAN的结合,当然和前面提到的古老原始的版本是不可同日而语的)
在此过程中,与DDCOPY作者李治联系了。取得了DDCOPY源么,对我有启发。。
不过,试了DDCOPY的压缩,不太理想,豪时长,压缩比低。因为他采用的压缩/解压的类较简单,就两个文件(用简单的LZSS,
胡颖卓编写的类,后来我也在网上看到了)
采用的压缩引擎是先进的最新版的 zlib-1.2.3 库(与GZIP,PNG图象用的同一个引擎),
压缩比和压缩速度很快,解压速度更快的离谱!
在WIN32 控制台程序中,压缩50MB,大约要20秒,压为了25MB。
解压只要大约3秒! 我*!
还有 压缩比的1-9选项(类似GHOST)。。。
ZLIB 压缩比相当高 采用 优化高效的 LZ77 和 HUFFMAN 结合,DEFLATE方式
而且速度与同类的压缩库相比要快的多! (如果比较压缩库,应该是与GHOST速度和压缩比差不多的.. )
*****************************
本程序的局限性和待增加的功能
*****************************
由于是DOS程序, 文件参数只支持FAT系列的盘符
计划加入处理指定的镜象中的第几硬盘和第几分区
***************
几个有用的开关
***************
1 i|ignore (还有 ir|ignorereaderror iw|ignorewriteerror)
忽略磁盘的 读写错误, 这样的话,就不会因为较少的介质问题而终止整个程序。
2
q | quiet
不要提示,直接执行(但对诸如文件打不开等,仍然要跟你要文件名的。。等等)
3 n | next
当执行某个任务发现致命的错误时,不退出整个程序,继续执行下一个任务(但仍然根据前一个已完成的数据量对下一个任务的数据量作
更新)
4 m | mute
不显示信息
这几个开关的使用地点:
单个字母既可用于源/目标串中〈仅对其源/目标串的任务起作用〉,也可用于全局〈对全局起作用〉;而两个或两个以上的字符只能用于全局):
其中,i
a
用在硬盘/分区/DOS盘符串:(用 =连接)
如:
1=i TO 2 (忽略读硬盘1的错误,但不忽略硬盘2的写错误)
1:1 TO 2:3=i (忽略写硬盘2分区3的 写错误,但不忽略读硬盘1分区1的读错误)
e:=i TO 2:3=i (都忽略)
但是忽略开关(-i)不能用在镜象文件串中(因为文件不是设备。如果在读写文件的过程中DOS给出了错误,是不能忽略过的,程序会提示
你,重新输入文件名)
b
用在后面的独立之处(对全部任务起作用),等价于 -ir 和 -iw
如:
1:2,E: TO 2:3,(BACK.TOZ=C) -i(也可-ir -iw) (忽略全部任务的读错误和写错误)
q | quiet (没有采用 y ,以免 跟 n 混同,以避免使用者误以为 y 表示不给提示,n 表示给提示。)
Last edited by GOTOmsdos on 2007-4-19 at 12:45 PM ]
Sometimes, GHOST backup fails, possibly due to issues with files...
I wrote a program myself,
TOdisk, which successfully backed up.
It backs up hard disks, partitions, or any sectors in sector mode...
Supports compression, volume splitting, extended partitions, multi-tasking, etc...
Thanks to Brother johnsonlam (Hong Kong) and Brother fastslz of the China DOS Union, and the help and support of Mr. Lizhi, the author of ddcopy, and foreigner Lucho!
Welcome to visit
http://www.cn-dos.net and
http://johnson.tmfc.net/dos/index.html for DOS communication
Explanation as follows:
Hard disk/partition/sector =freE=(Free) Backup/Restore ==TOdisk ==(Sector Mode)
Version: 1.3 alpha
Operating environment: MS-DOS / Win9x MS-DOS window (If UDMA driver is loaded, it may run abnormally)
TOdisk version 1.3 Alpha Copyright (C) 2006-2007 by GOTOmsdos, 2007-1-13
Email:
tdaim@sina.com
Syntax:
<Execution Mode>
TOdisk Source string 1 TO Target string 1 ]]]]
<View Mode>
TOdisk |-P|]]
<Execution Mode>
Source/target string: (Hard disk string, partition string, DOS drive letter string, image file string)
1, Hard disk string >> 1 or 2...n
2, Partition string >> 1:2 or 2:3...n:n
3, DOS drive letter string >> C: or D:... Z:
4, Image file string >>
Image file parameters:
Cn - C : (compress) Compress
n : Compression level (1-9, 6 may be the best balance between strength and speed; if no level is specified, default is 6)
K - K : key Compression password, need to enter password
Vn - V : (volume) Volume splitting
n : Size of each volume in MBs (from 1 to 2047). If not specified, default is 2047
E? - E : (every) Compression password for each volume is the same as the first volume
? : Prompt for compression password for each volume
--A
When target:
(c:\image.to) <No compression, no volume splitting>
(c:\image.to=Vn) <No compression, volume splitting>
(c:\image.toz=Cn) <Compress, no password, no volume splitting>
(c:\image.toz=Cn=K) <Compress, prompt for password, no volume splitting>
(c:\image.toz=Cn=K=Vn) <Compress, prompt for password, volume splitting, only the first image file has password>
(c:\image.toz=Cn=K=Vn=E) <Compress, prompt for password, volume splitting, password for each volume is the same as the first volume>
(c:\image.toz=Cn=K=Vn=E?) <Compress, prompt for password, volume splitting, prompt for password for each volume>
Example:
(g:\image.toz=c7=k=v1000=e?)
(Note: In multi-tasking, when the image file string is the target, it can only be the last one (so there can only be one))
Example:
Legal:
1:1 TO 2:3,3:4,(g:\image.toz=c=v)
1:1,2:2,3:3 TO 2:3,3:4,(g:\image.toz=c=v)
1:1 TO 2:3,(g:\image.toz=c=v)+10000,3:4
1:1,2:2,3:3 TO 2:3,(g:\image.toz=c=v)+20000,3:4
1:1,3:4,4:4 TO 2:3,(f:\image1.toz=c=v)+30000,(g:\image2.toz=c=v)
1:1,2:2,3:3 TO 2:3,(g:\image.toz=c=v),3:4 -p
1:1,3:4,4:4 TO 2:3,(f:\image1.toz=c=v),(g:\image2.toz=c=v) -p
Illegal 1:
1:1 TO 2:3,(g:\image.toz=c=v),3:4
1:1,2:2,3:3 TO 2:3,(g:\image.toz=c=v),3:4
(Free mode, neither the last one nor specifying the number of sectors to operate <using '+'>)
Illegal 2:
1:1,3:4,4:4 TO 2:3,(f:\image1.toz=c=v),(g:\image2.toz=c=v)
(Free mode, exceeding one image file string and not specifying the number of sectors to operate for the image file string before the last one <using '+'>)
--B
When source (automatically determines whether it is compressed, so even compressed files with to suffix can be recognized as compressed files):
(c:\image.toz) <Do not automatically search for volumes>
(c:\image.toz=V) <Automatically search for volumes>
<Image file name, if not compressed, it is recommended to use to as the suffix; if compressed, it is recommended to use toz as the suffix to avoid confusion with other file names, but the program does not enforce this>
In source/target string
- : Specify the starting sector to operate
+ : Specify the number of sectors to operate
But not allowed in image file string
Example:
1-5000
1:2+5000
D:-5000+10000
(g:\image.toz)+3000
Source/target string switches:
=q : quiet Quiet (no questions)
=m : mute Silent (no information display)
=i : ignore Ignore (ignore read and write errors, but invalid for image file string)
=n : next Next (if a fatal error is encountered, continue to the next task)
Example:
1:2=q=m,3:4 TO 4:1=i=n,(file=c)=q=m
If there are - + operators in the source/target string, then
The above parameters (i, q, m, n) in the source/target string must be placed after - or +: (Of course, in the matching mode -d, -p, there should not be - + operators, so there is naturally no such problem )
Example:
1:2-300+400=q=m,3:4 TO 4:1=i=n,(file=c)+500=q=m
Global switch 1 (mode switch):
--A
(Matching mode)
-d|p Hard disk|partition Sub-mode
In the matching mode, the number of source strings and target strings must be equal. In addition, in the partition mode, if the target string is a partition, the partition ID will be updated)
-d Hard disk mode example:
1,2 TO 3,4 -d
Equivalent to two separate operations:
1 TO 3
2 TO 4
But not equivalent to
1,2 TO 3,4
Unless 1,3 have the same size, 2,4 have the same size
-p Partition mode example:
1:2,4:3,2:2 TO 2:3,(d:\back.toz=c),4:5 -p
Equivalent to three separate operations:
1:2 TO 2:3 -p
4:3 TO (d:\back.toz=c)
2:2 TO 4:5 -p
(Among them, since the first and third tasks are both partition mode and write partition <the target is a partition, not an image file>, so even in separate operations, -p must be added to indicate that the partition ID needs to be updated. )
--B
(Free mode)
No -d|p switch
In the free mode, the number of source strings and target strings is not required to be equal, and the data transmission between previous and subsequent tasks has a successive relationship)
For example:
Hard disk 1 has 1000 total sectors
Hard disk 2 has 2000 total sectors
Hard disk 3 has 1500 total sectors
Hard disk 4 has 3000 total sectors
1,2 TO 3,4
This is free mode, the process is as follows:
Task 1:
Hard disk 1 transfers to hard disk 3 1000 sectors (hard disk 1 completes the task and exits)
Task 2:
Hard disk 2 transfers to hard disk 3 1500-1000=500 sectors (hard disk 3 completes the task and exits)
Task 3:
Hard disk 2 transfers to hard disk 4 2000-500=1500 sectors (hard disk 2 completes the task and exits)
The program exits (because one of the source and target has completed)
The program handles this in consideration of flexibility: the user may not exactly know the precise sizes of various partitions and hard disks, but still wants to complete the data that has met the conditions earlier...
In the free mode, the number of source strings and target strings is not required to be equal because the data transmission between previous and subsequent tasks has a successive relationship
For example:
1 TO 2:3,3:4,4:5,(g:\file.to)
Global switch 2 :
(Located at the back end of the command line parameters, effective for all tasks):
-q|quiet : Quiet (no questions)
-m|mute : Silent (no information display)
-i|ignore : Ignore (ignore read and write errors, but invalid for image file string)
-ir|ignorereaderror : Ignore read errors
-iw|ignorewriteerror : Ignore write errors
-n|next : Next (if a fatal error is encountered, continue to the next task)
Example:
1:2,E: TO 2:3,(back.toz=c) -q -m -n -i
Overall example:
Single task:
1 TO 2
Copy hard disk 1 to hard disk 2
1-100+1000 TO 2-200
Copy from sector 100 of hard disk 1 to sector 200 of hard disk 2, copying 1000 sectors in total
1:2 TO 2:3
Copy partition 2 of hard disk 1 to partition 3 of hard disk 2
1:2-200+1000 TO 2:3-300
Copy from sector 200 of partition 2 of hard disk 1 to sector 300 of partition 3 of hard disk 2, copying 1000 sectors in total
1:2 TO (d:\backup.toz=c=k=v1000=e?)
Backup partition 2 of hard disk 1 to image file d:\backup.toz
c - Compression level 6
k - Prompt for compression password
v1000 - Volume splitting, each volume size 1000 MBs
e? - Prompt for compression password for each volume
Multi-task:
Matching mode:
1:2,(h:\image.toz=v),2:3 TO (g:\image.toz=c=v),D:,3:2 -p
Free mode:
1:2,2:3-2345,3:4 TO 3:3-1234+300,4:1+3456,(i:\image.toz=c=v1000)
<View Mode>
Warning!!!
The DOS drive letters displayed in the program's partition summary table are inferred according to the DOS drive letter allocation rules and may not be accurate, especially when additionally mounting drives such as USB drives, mobile hard disks, virtual disks, etc., and are for reference only. However, the partition numbers displayed in the table are correct.
-Dn Display information of hard disk n
-P Display information of all partitions of all hard disks
noz|nozero : Do not display partitions with partition ID 0
noh|nohidden : Do not display hidden partitions
nozh|nozerohidden : Do not display partitions with partition ID 0 and hidden partitions
fn|fatntfs : Display FAT and NTFS partitions
f|fat : Display FAT partitions
l|linux : Display LINUX partitions
n:n - 1:2 or 2:3 ...
A: - C: or D: ... Z:
Example:
-d : Display all hard disks
-d2 : Display hard disk 2
-p : Display all partitions of all hard disks
-pfn : Display FAT and NTFS partitions
-p2:3 : Display partition 3 of hard disk 2
-pc: : Display C:
*********
Supplementary Instructions
*********
This program uses sector mode:
For enterprise-level or extremely important data, sector mode should be used.
×××××××××××××××××××××
Special Suggestions:
1
This program is very suitable for backing up full partitions.
2
Because it is sector mode, it can back up partitions of any file system (including LINUX, etc.).
However, if you want to back up to an image file, the partition where the image file is located can only be FAT/FAT32.
××××××××××××××××××××××××××××××
Backbone switches:
One Matching mode (including hard disk mode (-d) and partition mode (-p))
This mode is the most commonly used, especially partition mode.
Because this mode processes format data (hard disks and partitions), to match, at least the original data block should be smaller than the target data block (in this case, if it is partition mode, in addition to updating the partition ID of the source partition and the 80/00 active flag, a total of two bytes to the target partition, currently does not support updating the size of the partition, which involves moving all subsequent partitions!, and for general users, it is used less, generally it is where it comes from and where it goes back to, playing a backup and restore role..)
Because it is a format matching mode, the - and + operators are not allowed.
In the matching mode, the number of source strings and target strings must be equal, otherwise a warning will exit
The matching mode supports image file strings.
In addition to the partition mode using the partition ID of the source partition and 80/00 to update the partition table of the target partition,
The multi-task matching mode is equivalent to the one-to-one string combination of the free mode single task without - + with the same number of strings.
Two Free mode (without -d and -p parameters)
This is a sector-precise method, which can arbitrarily specify the starting sector to be processed (prefix is -) and the number of sector operations (prefix is +, small association:
GRUB also uses + to indicate the number of data blocks (sectors) to be loaded).
For example:
1-100+200 means execute 200 sectors starting from sector 100 of hard disk 1
The image file string also supports the + operator, but not the - operator.
Technically, it can be supported, but it will mark a lot of places in the file, which will greatly reduce the speed of file reading
For example:
(e:\back=c=v100)+1000 means execute 1000 sectors in total contained in the file
The following is illegal:
(e:\back=c=v100)-1000 attempts to execute from sector 1000 of the file, but it is illegal.
This mode is very useful for RAW data recovery. That is, when all file-based data recovery tools have been used up and cannot find data, sector mode must be used..
Source/target string
Hard disk string:
1
Executed as:
Hard disk 1 starts at sector 0 and processes the total sectors of the entire hard disk
Partition string:
1:1
Executed as:
Hard disk 1 partition 1 starts at sector and processes the total sectors of partition 1
DOS drive letter string:
C:
The program finds the corresponding partition in the partition table and is equivalent to the partition string
Image file string
Must be enclosed in parentheses ()
Complete parameters are as follows:
(d:\image=c=k=v1000=e?) Connected with = sign
First is the file name (8.3 format)
Cn C(COMPRESS) Compress, 9 is the compression level, (1-9, 6 may be the best balance between strength and speed; if no level is specified, default is 6)
K (KEY), indicates that the compressed file has a password. By default, there is no password. Having K means there is a password, so when the program creates a compressed image, it will ask the user to enter a password, so that when restoring the file to the hard disk next time, the user will also be asked to enter a password, which is for security needs.
(However, only having K will require a password for the first compressed file. If there are volumes, the subsequent volumes will not require a password)
Vn V(Volume) means having volume splitting function. When saving hard disk data as volume files, the user can specify the size of each volume (in MB), n means MB, default is 2047
V1000 means 1000MB per volume
(Additional: When the file parameter is on the left, that is, in the source position, if there is no V, the program will only process one file and will not automatically search for volumes (because this may be self-righteous. If there is V, it will automatically search for its volumes, but just give this V, no need for n)
E? E (Eevry) means requiring a password for each compressed volume. If there is no ?, the program will automatically write the password of the first file (mother volume) into the subsequent volumes. If there is ? it means requiring a password for each compressed volume file and stopping to wait for the user to enter.
***********************************************
About the compression library zlib used in this program and the arduous search process
***********************************************
1
Tried simple and old versions of LZ, LZW, HUFFMAN, LZHUF, LZSS, LZHARC, LZ77, LZARI, LZRW1, etc., and they are not ideal, too old, and too inefficient, only suitable for teaching.
2
Looked at ARJ/UNARJ, has many functions I don't want.
3
Once set on GZIP (BZIP2, basically the same), it is very good, and I also think it is a bit suitable for me, with good compression ratio and speed, and compression ratio options from 1-9. I studied for a few days and found that there is no memory compression, only file compression...
4
Saw a hint: zlib supports memory compression!
Decided on it!
(ZLIB and GZIP, PNG all use the same engine: a combination of LZ77 and HUFFMAN, of course, incomparable with the ancient original version mentioned earlier)
During this process, I contacted Mr. Lizhi, the author of DDCopy. I got the source code of DDCopy, which inspired me..
However, I tried the compression of DDCopy, which is not ideal, takes a long time, and has a low compression ratio. Because the compression/decompression class it uses is relatively simple, there are only two files (using simple LZSS, the class written by Hu Yingzhuo, and later I also saw it online)
The compression engine used is the advanced latest version of the zlib-1.2.3 library (the same engine used by GZIP, PNG images)
The compression ratio and compression speed are very fast, and the decompression speed is extremely fast!
In a WIN32 console program, compressing 50MB takes about 20 seconds and compresses to 25MB.
Decompression takes only about 3 seconds! I*!
There are also compression ratio options from 1-9 (similar to GHOST)...
ZLIB compression ratio is quite high, using optimized and efficient LZ77 and HUFFMAN combination, DEFLATE method
And the speed is much faster than similar compression libraries! (If comparing compression libraries, it should be similar to GHOST in speed and compression ratio.. )
*****************************
Limitations and functions to be added of this program
*****************************
Since it is a DOS program, file parameters only support FAT series drive letters
Plan to add processing of the nth hard disk and nth partition in the specified image
***************
Several useful switches
***************
1 i|ignore (还有 ir|ignorereaderror iw|ignorewriteerror)
Ignore disk read and write errors, so that the program will not terminate due to fewer media problems.
2
q | quiet
Do not prompt, execute directly (but for things like file not opening, it will still ask for the file name.. etc.)
3 n | next
When a fatal error is found during the execution of a certain task, do not exit the entire program, continue to execute the next task (but still update the data volume of the next task according to the amount of data that has been completed in the previous one)
4 m | mute
Do not display information
The use locations of these switches:
Single letter can be used in the source/target string <only for the task of its source/target string>, and can also be used globally <effective for the global>; while two or more characters can only be used globally):
Among them, i
a
Used in hard disk/partition/DOS drive letter string: (connected with =)
For example:
1=i TO 2 (Ignore read errors of hard disk 1, but not write errors of hard disk 2)
1:1 TO 2:3=i (Ignore write errors of partition 3 of hard disk 2, but not read errors of partition 1 of hard disk 1)
e:=i TO 2:3=i (Ignore both)
But the ignore switch (-i) cannot be used in the image file string (because the file is not a device. If an error is given by DOS during reading and writing the file, it cannot be ignored, and the program will prompt you to re-enter the file name)
b
Used in the independent place behind (effective for all tasks), equivalent to -ir and -iw
For example:
1:2,E: TO 2:3,(BACK.TOZ=C) -i(也可-ir -iw) (Ignore read errors and write errors of all tasks)
q | quiet (Not using y to avoid confusion with n, to avoid users mistakenly thinking that y means no prompt and n means prompt.)
Last edited by GOTOmsdos on 2007-4-19 at 12:45 PM ]