Page 2 of 2

Re: [Solved] Install Grub4dos to PBR from Linux

Posted: 22. Nov 2016, 18:13
by mobius
westms wrote:
gapan wrote:Isn't grub.exe a DOS/Windows executable? How would it ever work on linux?
Correct.
. . .
If one look at the beginning of the file grub.exe, one can see that it starts with the ASCII text 'MZ'. This corresponds to the magic number '4D 5A' (base 16) for executable files on DOS and Windows 9x.

There is a file grub.pif in the package, which is an information file for a Windows program grub.exe. This supports the assumption that it is a file in EXE format. If it is an EXE file, the application example in the slackbuild file and also examples in the online documentation are incorrect.
The package contains several files which, according to the documentation, should be executable on both DOS/Windows and on Linux :? ! Unfortunately, I could not get them to execute on Linux, except for bootlace64.com.
EXE format files for DOS and Windows 9x are 16-bit applications, which do not run directly on 64-bit hardware, to my knowledge.
And perhaps this may be why :roll: ! The package contains both bootlace.com and bootlace64.com, and the latter does work :shock: . Perhaps a 64-bit version of grub.exe would work, if one were available; but sadly there doesn't seem to be one.
I did not realize in the description by the questioner why grub4dos is needed as bootloader on the mentioned partition. If there is an operating system installed at all, Lilo can boot it as well.
Grub4dos is basically just an extension of Classic Grub; but those extensions make it a very valuable tool for executing all kinds of bootable images (HD, CD, floppy, etc.). So one can have, for example, a USB stick containing images of Live CD's (SalixLive, perhaps ;) , Clonezilla, GParted, etc.), floppy images (Memtest86+, etc.), and so forth; and boot any one with Grub4dos. There is an entire forum devoted to it at reboot.pro. So, I have just such a partition on the HDD, with no O/S installed, from which I can run any of those images. The partition has sufficient free space so that I can run Clonezilla from the partition, clone the Linux partitions on the HDD, and save the created images back to the partition. Optionally, the saved images can be backed up to NAS.

Re: [Solved] Install Grub4dos to PBR from Linux

Posted: 22. Nov 2016, 21:22
by gapan
mobius wrote:Perhaps a 64-bit version of grub.exe would work, if one were available; but sadly there doesn't seem to be one.
mobius wrote:Grub4dos is basically just an extension of Classic Grub
And that's your problem right there. The legacy grub that this is based on never had and never will have a 64bit version. Grub2 does. Which you can use to exactly what you want by the way. It's just different.

Re: [Solved] Install Grub4dos to PBR from Linux

Posted: 22. Nov 2016, 22:54
by westms
mobius wrote:Grub4dos is basically just an extension of Classic Grub; but those extensions make it a very valuable tool for executing all kinds of bootable images (HD, CD, floppy, etc.). So one can have, for example, a USB stick containing images of Live CD's (SalixLive, perhaps ;) , Clonezilla, GParted, etc.), floppy images (Memtest86+, etc.), and so forth; and boot any one with Grub4dos. There is an entire forum devoted to it at reboot.pro. So, I have just such a partition on the HDD, with no O/S installed, from which I can run any of those images. The partition has sufficient free space so that I can run Clonezilla from the partition, clone the Linux partitions on the HDD, and save the created images back to the partition. Optionally, the saved images can be backed up to NAS.
Thank you for the hints.

The Grub4dos version 0.4.5b_2011_02_20, as listed in SlackBuilds, does not contain software for 64-bit hardware. The package is from 2011. The file grub4dos.SlackBuild is from November 2013. The software itself is from the years 2007/9.

In a tutorial is to read that "grub.exe is a hybrid executable that can be launched from linux console and DOS prompt".
I could read elsewhere: "grub.exe is also a Linux executable and can be loaded from kexec and lilo".

Both should only work on 16- and 32-bit hardware, as I understand it.

Re: [Solved] Install Grub4dos to PBR from Linux

Posted: 23. Nov 2016, 23:31
by mobius
gapan wrote:
mobius wrote:Perhaps a 64-bit version of grub.exe would work, if one were available; but sadly there doesn't seem to be one.
mobius wrote:Grub4dos is basically just an extension of Classic Grub
And that's your problem right there. The legacy grub that this is based on never had and never will have a 64bit version. Grub2 does. Which you can use to exactly what you want by the way. It's just different.
Actually, Grub4dos works just fine on all my 64-bit computers. From either USB stick, or from a HDD partition, I can run any CD image (SalixLive, Clonezilla, etc.), any floppy image (memtest86+) etc. The only difficulty, now solved, was how to install it from Linux.

From a user's point of view, Grub4dos is indeed an extension of Grub Classic. Whether it is, from a programming perspective, a fork or a complete re-write, one would have to ask the developer.

Re: [Solved] Install Grub4dos to PBR from Linux

Posted: 23. Nov 2016, 23:46
by mobius
westms wrote:Thank you for the hints.

The Grub4dos version 0.4.5b_2011_02_20, as listed in SlackBuilds, does not contain software for 64-bit hardware. The package is from 2011. The file grub4dos.SlackBuild is from November 2013. The software itself is from the years 2007/9.

In a tutorial is to read that "grub.exe is a hybrid executable that can be launched from linux console and DOS prompt".
I could read elsewhere: "grub.exe is also a Linux executable and can be loaded from kexec and lilo".

Both should only work on 16- and 32-bit hardware, as I understand it.
Yes, I believe those versions should work on either 16-bit or 32-bit, but not 64-bit.

But that is a very old version, as you noted. The latest version (currently 0.4.6a from 2016-11-09) may be downloaded from the developer's page. That link is quite safe; I have downloaded from there.

If one is more comfortable with a better known link, he may download from RMPrepUSB.com. This site is well respected on the reboot.pro Grub4dos forum. He has a (Windows) program which can, among other things, prepare a USB stick, and, install Grub4dos to either MBR or PBR of USB or HDD. He also has an amazing number of tutorials.

Hope that is helpful to anyone interested.