|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
『楼 主』:
ghost 究竟是如何处理引导扇区的???
使用 LLM 解释/回答一下
一般我们先装 DOS / Windows98 ,后装 Windows2000/XP 可以“自然”形成多系统引导菜单,可如果是先装的 Windows2000/XP ,后装 DOS / Windows98 要形成多系统菜单怎么办?也好办,可以事先把 Windows2000/XP 的分区引导扇区保存下来,然后 sys 命令生成 DOS 的引导扇区和传送 DOS 系统,再把 DOS 的引导扇区保存下来,然后再恢复 Windows2000/XP 的分区引导扇区内容就可以了(几个细节我忽略不写了)。
可如果有 ghost 参与这一过程会遇到一个怪问题。比如,我以正常顺序先安装 Win98 (in C:),ghost 备份 Win98,安装 Win2000/XP (in D:),形成引导启动菜单,备份 C: 的 Win2000/XP 的引导扇区内容和 ntldr , ntdetect.com , boot.ini 等几个启动必须的文件。现在,Win98 坏了,我用 ghost 恢复备份的 Win98 到 C: ,自然,NTLDR 的启动菜单没了,引导扇区也变为 Win98/DOS 的内容了,(恢复后 Win98 可以正常启动);我用前面备份的 Win2000/XP 的引导扇区内容恢复到 C: 的引导扇区上,把备份的 ntldr , ntdetect.com , boot.ini 等几个文件复制到 C: 的根目录下,重新启动,结果屏幕一片漆黑,只有一个光标在左上角闪烁。反复试了几次都是如此,其实 ntldr 等这几个文件不复制过去都可以,因为到了分区引导扇区这一步就出问题了。
我知道 ghost 在处理引导扇区的时候会对其中的某些值做改动,我想,会不会是由于这引起的呢?我比较了下 Win98 刚装完时和 ghost 恢复后 C: PBR 的内容,发觉有三处值有所改动。于是,我就以 ghost 后的 PBR (我想主要是其中的 BPB)为基础,在 Win2000/XP 的故障恢复控制台下重新恢复了 Win2000/XP 的 PBR ,再备份了下这新的 PBR ,考虑到 FAT32 的 PBR 要占用3个扇区,于是这新的 PBR 也就备份了3个扇区,原来只备份了一个扇区。心想,这下应该可以了吧。于是再次用 ghost 恢复 C: 的 Win98,再恢复新保存的 PBR ,可重新启动后还是不行!依然黑屏。
于是我就百思不得其解了。究竟哪个地方出了问题?!
ghost 在处理引导扇区的时候会莫名其妙的改动其中的几个字节,究竟是在备份时篡改的还是恢复时篡改的,不清楚。肯定要改动哪几处?不清楚。但有一点我是肯定的,就是 ghost 恢复后,BPB 中的该分区所占扇区数这一参数会比原来的少几个扇区,但是这应该不会影响该分区的启动。
现在,每次用 ghost 恢复 Win98 后都要用 Win2000/XP 自己的方式来恢复它们的 PBR ,其实也不用进入故障恢复控制台,安装到可以让你选是否要进入故障恢复控制台的时候已经把 C: 的 PBR 重写了。
我就奇怪了,为什么原来备份的 PBR 就不能用了呢?!
Generally, we usually install DOS/Windows 98 first and then Windows 2000/XP, which can "naturally" form a multi-system boot menu. But if we install Windows 2000/XP first and then DOS/Windows 98, how to form the multi-system menu? It's also easy. We can save the partition boot sector of Windows 2000/XP in advance, then use the sys command to generate the boot sector of DOS and transfer the DOS system, then save the boot sector of DOS, and then restore the content of the partition boot sector of Windows 2000/XP. (I'll ignore some details here.)
But if there is ghost involved in this process, a strange problem will be encountered. For example, I install Win98 (in C:) normally, use ghost to back up Win98, install Windows 2000/XP (in D:), form the boot startup menu, and back up the content of the boot sector of Windows 2000/XP in C: and several necessary startup files such as ntldr, ntdetect.com, boot.ini. Now, Win98 is broken, I use ghost to restore the backed-up Win98 to C:, naturally, the boot menu of NTLDR is gone, and the boot sector also becomes the content of Win98/DOS. (After restoration, Win98 can start normally.) I use the previously backed-up content of the boot sector of Windows 2000/XP to restore it to the boot sector of C:, copy the backed-up files such as ntldr, ntdetect.com, boot.ini to the root directory of C:, and restart. As a result, the screen is completely black, and there is only a cursor flashing in the upper left corner. I tried several times and it's the same. In fact, these files like ntldr don't need to be copied over, because the problem occurs at the partition boot sector step.
I know that ghost will change some values when dealing with the boot sector. I wonder if this is the cause? I compared the content of C: PBR when Win98 was just installed and after ghost restoration, and found that three values were changed. So I used the PBR after ghost (I think mainly the BPB in it) as the basis, and restored the PBR of Windows 2000/XP again under the recovery console of Windows 2000/XP, and then backed up this new PBR. Considering that the FAT32 PBR occupies 3 sectors, this new PBR was also backed up for 3 sectors, while originally only one sector was backed up. I thought, this should be okay now. So I used ghost to restore Win98 in C: again, and then restored the newly saved PBR. But after restarting, it still didn't work! Still black screen.
So I was really confused. Which place is going wrong?! Ghost will inexplicably change a few bytes when dealing with the boot sector. I don't know if it's tampered with during backup or restoration. I don't know which parts must be changed. But one thing I'm sure of is that after ghost restoration, the parameter of the number of sectors occupied by this partition in the BPB will be a few sectors less than the original, but this should not affect the startup of this partition.
Now, every time I use ghost to restore Win98, I have to use the own way of Windows 2000/XP to restore their PBR. In fact, I don't need to enter the recovery console. When installing to the point where you can choose whether to enter the recovery console, the PBR of C: has been rewritten.
I'm just curious, why can't the originally backed-up PBR be used?!
|

DOS倒下了,但永远不死
DOS NEVER DIES !
投票调查:
http://www.cn-dos.net/forum/viewthread.php?tid=46187
本人尚未解决的疑难问题:
http://www.cn-dos.net/forum/viewthread.php?tid=15135
http://www.cn-dos.net/forum/viewthread.php?tid=47663
http://www.cn-dos.net/forum/viewthread.php?tid=48747 |
|
2008-4-26 01:52 |
|
|
swarron
初级用户
 
积分 23
发帖 13
注册 2009-8-27
状态 离线
|
|
2009-8-28 22:59 |
|
|
yaya
银牌会员
    
积分 1009
发帖 353
注册 2003-9-4
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
对于FAT32系统,win98的引导扇区占用第1、第3扇区,Windows2000/XP 的引导扇区占用第1、第13扇区。因此只恢复前3扇区是不行的。
‘ghost 恢复后 C: PBR 的内容,发觉有三处值有所改动’,可否告知是哪三处?
For the FAT32 system, the boot sector of Win98 occupies the 1st and 3rd sectors, and the boot sector of Windows 2000/XP occupies the 1st and 13th sectors. Therefore, it is not enough to only restore the first 3 sectors.
"After ghost restoration, the content of the C: PBR is found that three values have been changed", can you tell which three are they?
|
|
2009-9-2 04:47 |
|
|
xiaoran13
新手上路

积分 4
发帖 2
注册 2009-9-2
状态 离线
|
|
2009-9-2 20:18 |
|
|
netbenton
银牌会员
     批处理编程迷
积分 1916
发帖 752
注册 2008-12-28 来自 广西
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
ghost并不是以扇区为单元,读取存放,恢复时又原样放回原扇区的。
而是把所有的磁盘数据读取后,重新整理,以其自定的一套方案存为*.gho文件的,其中包括了文件系统以及引导系统(如果存在的话),
在恢复到新的磁盘分区时,将会是ghost认为最紧凑的文件存贮方式。
在刚恢复好的分区上运行磁盘碎片整理,便可以证实这一点了。
Ghost does not read and store data sector by sector and restore it to the original sector. Instead, it reads all disk data, reorganizes it, and stores it as a *.gho file according to its own set of defined schemes, which includes the file system and the boot system (if it exists). When restoring to a new disk partition, it will be in the most compact file storage mode considered by Ghost. You can verify this by running disk defragmentation on the just-restored partition.
|

精简
=> 个人 网志  |
|
2009-9-3 02:31 |
|
|
JYL
初级用户
 
积分 26
发帖 12
注册 2009-9-2
状态 离线
|
『第 6 楼』:
ghost 究竟是如何处理引导扇区的???
使用 LLM 解释/回答一下
我也想搞明白ghost的工作原理,还需要向各位学习。
I also want to figure out the working principle of Ghost, and I still need to learn from you all.
|
|
2009-9-4 05:32 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Originally posted by yaya at 2009-9-2 04:47:
对于FAT32系统,win98的引导扇区占用第1、第3扇区,Windows2000/XP 的引导扇区占用第1、第13扇区。因此只恢复前3扇区是不行的。
‘ghost 恢复后 C: PBR 的内容,发觉有三处值有所改动’,可否告知是哪三处?
嗯!你说的有道理,很可能是你说的这个原因。以前我没注意到同样是采用 FAT32 的 Win9x 和 WinNTs 引导扇区的区别,我还以为只要是 FAT32 的都一样。以后有机会试试。
至于哪三处有改动我没记下来,而且我在不同的机器上试过后发现,每次改动的地方(偏移处)都不一样,而且不同处也不一样,有的只有两处,有的好像有四、五处,就像我在主贴中所说的“肯定要改动哪几处?不清楚。”总之,改动是不确定的。
Originally posted by yaya at 2009-9-2 04:47:
For the FAT32 system, the boot sector of Win98 occupies sectors 1 and 3, and the boot sector of Windows 2000/XP occupies sectors 1 and 13. Therefore, it is not enough to only restore the first 3 sectors.
'After restoring with Ghost, the content of C: PBR was found, and it was noticed that three values have been changed', can you tell me which three places they are?
Hmm! What you said makes sense. It's very likely due to the reason you mentioned. I didn't notice the difference between the boot sectors of Win9x and WinNTs that both use FAT32 before. I thought all FAT32 ones were the same. I'll try it if I get a chance in the future.
As for which three places have been changed, I didn't write them down. And after I tried on different machines, I found that the places (offsets) that were changed each time were different, and the different places were also different. Some only had two places, and some seemed to have four or five places, just as I said in the main post "Certainly need to change which ones? Not clear." In short, the changes are not fixed.
|

DOS倒下了,但永远不死
DOS NEVER DIES !
投票调查:
http://www.cn-dos.net/forum/viewthread.php?tid=46187
本人尚未解决的疑难问题:
http://www.cn-dos.net/forum/viewthread.php?tid=15135
http://www.cn-dos.net/forum/viewthread.php?tid=47663
http://www.cn-dos.net/forum/viewthread.php?tid=48747 |
|
2009-9-7 13:07 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
|
2009-9-7 13:19 |
|
|
chishingchan
银牌会员
    
积分 1282
发帖 538
注册 2002-11-2
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
就算不以扇区为单元读取存放,这只定义于文件数据方式,扇区我看是分开存放的。
Even if it is not read and stored in sector units, this is only defined in the file data method, and the sectors are seen to be stored separately.
|
|
2009-9-16 00:15 |
|
|
azziporah
初级用户
 
积分 102
发帖 47
注册 2008-11-10
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
推荐阅读Symantec Ghost Imaging Foundation
书中指出:Ghost是磁盘有效数据的打包,这个包的内部有自己的数据组织方式,还有压缩等级、校验码、密码等等。
书中还说:Ghost不是逐扇区的拷贝,而是基于文件的,但并非所有文件都会打包,一些局限于时效性的文件将会被略过,比如休眠文件、内存交换文件等等。
可惜,我也没有找到任何直接与引导扇区有关的描述。但根据书中一些段落,结合自己的思考,我猜想:
Ghost并不直接保存任何特殊扇区的数据,而是分析源磁盘上的数据的逻辑结构,将这些参数(包括MBR、VBR、GPT、动态磁盘数据库等等)以自己的格式存放在镜像文件中。在写入目标磁盘时,Ghost根据这些参数,在GDisk工具的帮助下,重建磁盘的逻辑结构,也就是MBR和各分区/卷的VBR、以及其它数据(比如动态磁盘的卷信息等)。
另有两点需要注意:一方面Ghost有两大类工作方式,
源盘->(镜像->)目标盘,
源区->(镜像->)目标区;
另一方面Ghost对容量的要求很松,只要求目标容量比实际数据大小稍大即可。
这两点说明,Ghost在重建磁盘结构时,会针对目标磁盘的状况进行参数的调整。如书中所说:默认情况下,Ghost总是尽量维持分区之间的大小比例。
所以,Ghost要调整参数,必然意味着MBR、VBR或其它重要扇区有改动。否则分区表与分区会对不上号,或VBR找不到OS bootloader等等……
未经验证的猜想,欢迎指正
Ghost Explorer可以直接查看镜像,我没用过,不妨看看此工具是否可显示分区/卷相关的信息?
Last edited by azziporah on 2010-9-6 at 10:50 ]
### Recommended Reading Symantec Ghost Imaging Foundation
The book points out: Ghost is a package of the valid data on the disk. Inside this package, there is its own data organization method, as well as compression levels, check codes, passwords, etc.
The book also says: Ghost does not copy sector by sector, but is file-based. But not all files will be packaged. Some files limited by timeliness will be skipped, such as hibernation files, memory swap files, etc.
Unfortunately, I haven't found any direct description related to the boot sector. But based on some paragraphs in the book and my own thinking, I conjecture:
Ghost does not directly save the data of any special sectors, but analyzes the logical structure of the data on the source disk, and stores these parameters (including MBR, VBR, GPT, dynamic disk database, etc.) in the image file in its own format. When writing to the target disk, Ghost reconstructs the logical structure of the disk, that is, MBR and VBR of each partition/volume, and other data (such as volume information of dynamic disks, etc.) with the help of the GDisk tool according to these parameters.
There are two other points to note: On the one hand, Ghost has two major working modes,
source disk -> (image ->) target disk,
source area -> (image ->) target area;
On the other hand, Ghost is very lenient in terms of capacity, only requiring that the target capacity be slightly larger than the actual data size.
These two points show that when Ghost reconstructs the disk structure, it will adjust the parameters according to the situation of the target disk. As the book says: By default, Ghost always tries to maintain the size ratio between partitions.
So, Ghost has to adjust the parameters, which necessarily means that there are changes in MBR, VBR or other important sectors. Otherwise, the partition table and partitions will not match, or the VBR will not find the OS bootloader, etc....
Conjectures not verified, welcome to correct
Ghost Explorer can directly view the image. I haven't used it.不妨 see if this tool can display partition/volume related information?
Last edited by azziporah on 2010-9-6 at 10:50 ]
|
|
2010-9-5 02:56 |
|
|