chenall / grub4dos

外部命令和工具源码:https://github.com/chenall/grubutils 下载:
http://grub4dos.chenall.net
GNU General Public License v2.0
647 stars 136 forks source link

problem with the MBR/PBR from latest 0.4.6a versions #37

Closed DavidBrenner3 closed 9 years ago

DavidBrenner3 commented 9 years ago

It seems that the MBR/PBR from the latest 0.4.6a versions is buggy.

First, bootlace.com still doesn't work when trying to install the PBR on any partition / any drive / any Linux distro I tried:

error bootlace pbr

THe Grub4Dos MBR is not searching the grldr on the next partitions when it reaches an Ext2/exFAT partition without grldr:

grub4dos mbr ext2 part ntfs part grub4dos mbr exfat part ntfs part

Even if grldr is copied on the exFAT partition, it doesn't load it (exactly the same message as previous).

When using normal MBR + Grub4Dos PBR, it doesn't boot at all on exFAT/EXT2 partitions.

normal mbr grub4dos pbr exfat or fat16 or ext2 part ntfs part

It doesn't matter if grldr is there or not.

The tests were made on real computer, QEMU and VirtualBox. Also, in the same testing conditions, the MBR/PBR from 0.4.5c version and from the 0.4.6a from BOOTICE are booting ok (except on exFAT of course).

Could you please fix it? Thank you.

Regards, David

DavidBrenner3 commented 9 years ago

Found another problem:

I installed Grub4Dos MBR 0.4.6a without backing the previous MBR. On drive there are MS partition(s) with grldr in root. If I set Timeout to a nonzero value and I click on Space to boot the previous MBR, it says "Invalid previous MBR, any other key to start Grub...". So far it's good. But look what happens next:

timeout

yaya2007 commented 9 years ago

在 Linux 下安装引导代码到 PBR : bootlace.com --floppy /dev/sdb1

DavidBrenner3 commented 9 years ago

Thank you.

The problem with normal MBR + Grub4Dos PBR on FAT16 is solved. But not on exFAT and EXT2/3/4. Still no booting... More, the exFAT partition is no longer accessible after installing the latest G4D 0.4.6a PBR. The only ways to make it accessible again are:

yaya2007 commented 9 years ago

"But look what happens next:" 请测试:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=327458&pid=3047309&page=85&extra=#pid3047309

yaya2007 commented 9 years ago

on exFAT and EXT2/3/4: use the Grub4Dos 0.4.6a PBR from BOOTICE ok? use the Grub4Dos 0.4.6a PBR from bootlace.com Failure?

DavidBrenner3 commented 9 years ago

http://bbs.wuyou.net/forum.php?mod=viewthread&tid=327458&pid=3047309&page=85&extra=#pid3047309

It doesn't let me download, it asks for my forum account (which I don't have) but I don't know chinese language to make an account :( Could you please post it on an external file sharing site?

exFAT/EXT2/3/4 Bootice = the partition is accessible after installing the PBR, but I haven't succeeded to boot. exFAT/Ext2/3/4 bootlace.com = exFAT is no longer accessible and both unable to boot.

Something else: could you please tell me where in the MBR/PBR are located the values for "Load segment" (grldr)? I need this for implementing in grubinst and grubinst_gui... For example in 0.4.5c they were located like this: 0x400+0x1EA 0x600+0x1EA 0x800+0x1EE 0xA00+0x1EA

yaya2007 commented 9 years ago

Bootice v1.3.3.1 有 bug,请使用 v1.3.3 bootlace.com 安装 exfat 我再看一看。

"Load segment" (grldr)? 0x400+0x1EA 是指 grldr 位于内存 0x400 段,偏移 0x1ea ? 我没有理解问题。

从这里下载: http://bbs.wuyou.net/forum.php?mod=attachment&aid=MjA5MjI2fDUxODZiMzliNWUzZmJiYTI1MDY1ZjM2MjNlYzA4MDg3fDE0MjM2MDkxMzI%3D&request=yes&_f=.7z

DavidBrenner3 commented 9 years ago

Thank you for the link.

With grub4dos-0.4.6a-2015-02-10.7z the problem with the timeout seem to be fixed, with one detail: should be saying something like "Invalid previous MBR" and stop or restart, not booting the PBR. Or, in the first message, it should say "Press hot-key to boot the PBR of the active partition, any..." if it doesn't find the previous MBR stored in the second sector.

With 0.4.6.a PBR from Bootice 1.3.3.0 I can boot on exFAT. I can't test on EXT2/3/4 too since it doesn't seem to be implemented in BOOTICE.

The other problems don't seem to be fixed in grub4dos-0.4.6a-2015-02-10.7z...

Regarding the load segment:

grubinst_gui13

grubinst13

I'm asking about the position from grldr.mbr and the 4 positions (FAT16/FAT32/exFAT/NTFS) from grldr.pbr where this value is located.

I'm currently modifying grubinst and grubinst_gui: http://reboot.pro/topic/20238-improving-grubinst-and-grubinst-gui-in-windows-and-linux/page-6#entry190484 It's a "work in progress"...

yaya2007 commented 9 years ago
  1. 使用“bootlace.com --floppy /dev/sdb1”,可以安装并且成功启动 fat16,那么同样应当可以安装并且启动 exfat/ext2。是安装不成功?还是引导不成功?
  2. Use bootlace.com to install partition boot record Method 1: Step 1. Get the boot sectors of the partition and save to a file MYPART.TMP. For EXT2/3/4 partition, you need to get the start of the three sectors, for other types of file systems, you only need to obtain a sector. Step 2. Under DOS, Windows, these commands are executed: bootlace.com --floppy= MYPART.TMP Step 3. Put MYPART.TMP back on to the boot sector(s) of your original partition (hdX,Y).

Method 2: Executed under DOS command: bootlace.com --install-partition=I K I is the partition number (0,1,2,3,4, ...), K is the drive letter (0x80, 0x81, ...). Implementation will show the simple disk information and regional capacity, and are prompted to press "y" key to continue, press the other key to exit.

Installing GRLDR boot code to PBR under Linux: bootlace.com --floppy /dev/sda1 不能直接安装到硬盘映像(即有MBR,有PBR)

  1. 如果LBA(0)安装 grldr.mbr,那么LBA(1)应当备份原 MBR(最好使用 Windows NT 6.x MBR)。这样才能从“原先的主引导记录”开始引导。
  2. 如果要从 PBR 引导 grldr,则必须在 PBR 安装 grub4dos 的分区引导代码。
  3. grldr.pbr 分布: Offset Sector Partition type

    0           1       FAT32
    0x200   1       FAT12/16
    0x400   2       EXT2/3/4
    0x800   2       EXFAT
    0xC00   4       NTFS
DavidBrenner3 commented 9 years ago
  1. installation successful, boot unsuccessful, accessing exFat unsuccessful.
  2. Under Windows you can't use bootlace.com, Windows doesn't allow the direct drive access. And I don't have DOS anymore. But it's an ancient OS anyway.
  3. I tried with Windows NT 6.x MBR too. 4, 5. Yes, I know them, I implemented them in grubinst and grubinst_gui. Please check the link I gave you.
yaya2007 commented 9 years ago

你是否可以给我失败的MBR/PBR截图?

DavidBrenner3 commented 9 years ago

I don't speak chinese language but the Google Translator does a good job :D

I already sent you such screenshots in the first post of the thread:

The Grub4Dos MBR is not searching the grldr on the next partitions when it reaches an Ext2/exFAT partition without grldr:

692b434c-b03b-11e4-9cfd-4ec5d8bb13ee 49d8229e-b03b-11e4-91c5-192dbc30cafc

When using normal MBR + Grub4Dos PBR, it doesn't boot at all on exFAT/EXT2 partitions.

cae96460-b03b-11e4-9156-e537dea2d915

The virtual machine (QEMU and VirtualBox) or the real computer are blocked, no input/output possible.

yaya2007 commented 9 years ago

对不起,我没有讲清楚。我需要 WinHex 或 UltraEdit 或其它工具截取的 16 进制的 MBR/PBR 代码。 是“installation successful, boot unsuccessful, accessing exFat unsuccessful.”情况下的MBR/PBR。

DavidBrenner3 commented 9 years ago

https://drive.google.com/file/d/0ByKxAD_t9uvLNDF3WV9kUXBPUGc/view?usp=sharing

yaya2007 commented 9 years ago

翻墙也进不了!

DavidBrenner3 commented 9 years ago

http://www.filedropper.com/mbrandexfatpbrs http://wikisend.com/download/803500/MBR and exFAT PBRs.7z

yaya2007 commented 9 years ago

官网已更新,请测试.

DavidBrenner3 commented 9 years ago

The problem with Grub4dos MBR not been able to search grldr on the next partitions after searching on a exFAT partition seems to be solved: mbr serching after exfat Although I don't understand why is saying "Try (hd0): NTFS5: 2" 4 times or why is saying exF when timeout finishes.

The problem with Grub4dos MBR not been able to search grldr on the next partitions after searching on a EXT2/3/4 partition is still not solved: grub4dos mbr and ext2 The problem with the normal MBR + exFAT Grub4Dos PBR is a little weird: I use bootlace.com to insert the PBR, success. The partition is no longer accessible in Windows, no matter if I remount it or even if I restart Windows. But if I try to boot it, it boots ok and it becomes accessible in Windows. If I compare the PBR before and after booting I see these 2 differences: bootlace pbr before and after booting 2 bootlace pbr before and after booting 1 On the other hand, the exFAT partition with the Bootice PBR is accessible in Windows right after the PBR is written.

https://drive.google.com/file/d/0ByKxAD_t9uvLdDZleUxRQTNvX2c/view?usp=sharing http://www.filedropper.com/files_9 http://wikisend.com/download/485736/Files.7z

DavidBrenner3 commented 9 years ago

For the exFAT problem, please have a look at this:

http://ntfs.com/exfat-OEM-parameters-checksum.htm

yaya2007 commented 9 years ago

官网已经修正,请测试.

DavidBrenner3 commented 9 years ago

The problem with exFAT and the problem with the "Try (hd0)" messages are solved. Good job.

But the problems with EXT2/3/4 partitions are still unsolved. The Grub4Dos MBR still doesn't search grldr on the next partitions + you can't boot with normal MBR + Grub4Dos EXT2/3/4 PBR. I already posted MBRs/PBR's + screenshots.

Another thing: are the "--preferred-drive=" and the "--preferred-partition=" switches working fine? Because I have set them to nonzero values but I didn't see any change in the way it searches grldr ("Try (hd..." are in the same ascending order).

For example: I have 4 partitions: (hd0,0), (hd0,1), (hd0,2), (hd0,3). I use "--preferred-drive=0" and "--preferred-partition=2". It should search and display this:

Try (hd0,2): fs_type: No GRLDR Try (hd0,0): fs_type: No GRLDR Try (hd0,1): fs_type: No GRLDR Try (hd0,3): fs_type: No GRLDR

But it searches and display as usual:

Try (hd0,0): fs_type: No GRLDR Try (hd0,1): fs_type: No GRLDR Try (hd0,2): fs_type: No GRLDR Try (hd0,3): fs_type: No GRLDR

yaya2007 commented 9 years ago

"--preferred-drive=" 与"--preferred-partition=" , 0.4.6a 不再支持。 0.4.5c 的搜索顺序仍然是:(hd0,0),(hd0,1),(hd0,2),(hd0,3)。 只不过是遇到 (hd0,0),(hd0,1) 时,没有真正搜索,而是跳过了。 grldr.mbr 可以搜索各磁盘、各分区的 grldr,这是它的优点。而设置 "--preferred-drive=" 与"--preferred-partition=" 并不是通用的,是个别行为,也没有做到快速搜索。

使用 grldr.mbr 搜索 grldr 失败后,提示 “尝试引导原先的主引导记录”。 原先的主引导记录加载活动分区的 PBR。这个分区引导记录,如果是 grldr.pbr 的,则搜索 grldr;如果不是,那可能搜索 ntldr 或其它。这需要注意。 其次,如果系统是 hd0 + hd1,在 hd0 安装 grldr.mbr 。那么 “尝试引导原先的主引导记录”,只能搜索 hd0 的 1 个活动分区,hd0 的其它分区,以及 hd1 的个分区是不会搜索的。

如果使用 grldr.mbr 搜索不到 grldr,那么 “尝试引导原先的主引导记录” 一般也不会搜索到 grldr。 “尝试引导原先的主引导记录” 只是避免启动彻底失败,而让用户选择从安装 grldr.mbr 之前的状况引导,比如引导 ntldr 或其它。

如果 ext2分区 在第二磁盘,并且根目录有 grldr,使用第一磁盘的 grldr.mbr 搜索不到第二磁盘 ext2 分区的 grldr,那说明 grldr.mbr 有问题(我这里测试正常)。 如果 ext2分区 在第二磁盘,并且根目录有 grldr,使用第一磁盘保留的原先的主引导记录(即 LBA1),永远找不到第二磁盘 ext2 分区的 grldr。

DavidBrenner3 commented 9 years ago

With grldr on EXT2/3/4 yes, it works. The problem appears when the grldr IS NOT in root of the EXT2/3/4 partition, but on the next ones.

For example: with ext2 The grlrd is not on any partition (just to test its search). Using 0.4.5c MBR: 045c ext2 Using 0.4.6a MBR: 046a ext2

Changing partition to FAT16: without ext2 Using 0.4.5c MBR: 045c no ext2 Using 0.4.6a MBR: 046a no ext2

As you can see, only the 0.4.6a + EXT2/3/4 combination has problems...

yaya2007 commented 9 years ago

感谢 DavidBrenner3 细致、耐心的测试。为 drub4dos 更加完善而共同努力! 关于从硬盘没有找到 grldr,系统又没有安装软驱时(读软盘错误),显示“Missing helper",没有提示“尝试引导原先的主引导记录”的问题已经修正,上传官网。

关于从 MBR 使用 grldr.mbr 引导 ext2 分区失败的问题:我认为是 grldr.mbr 没有正确安装,或者 ext2 分区参数有误。现提供我的供测试: http://bbs.wuyou.net/forum.php?mod=attachment&aid=MjA5OTY0fGZiZTU2ZmQ3NWQzYmJhNGNkMWVkZDAwMWIwOWFlOGI0fDE0MjQ1MTI3OTY%3D&request=yes&_f=.rar

DavidBrenner3 commented 9 years ago

Found the difference between our tests: the tool used to partition the drive. I used MiniTool Partition Wizard 8/9. Soon as I recreated the ext2 partition on xin-flat.vmdk, the Grub4Dos 0.4.6a MBR refused to search grldr on the next partitions. Since the Grub4Dos 0.4.5c MBR has no problems with ext2 partitions created by MiniTool Partition Wizard 8/9, the logical assumption would be that it could be a problem in the Grub4Dos 0.4.6a MBR. But I'm also open to the possibility that MiniTool Partition Wizard 8/9 could create faulty ext2 partitions.

I'm sending you back the vmdk files with the recreated ext2 (so you can test):

https://drive.google.com/file/d/0ByKxAD_t9uvLX0plRWx3S05mMmc/view?usp=sharing http://www.filedropper.com/ext2recreated http://wikisend.com/download/382286/ext2_recreated.7z

yaya2007 commented 9 years ago

ext2 已经修正,上传官网。请测试。

DavidBrenner3 commented 9 years ago

All the problems with EXT2 (MBR and PBR) seems to be solved now.

Thank you.

Regards, David