Grub4dos Guide - Loading/Installing Grub4dos From Windows


Load via ntldr (Windows NT/2K/XP) - 1

Copy C:\Grub4dos\grldr to the root directory of an existing windows install and add the following line to the [operating systems] section of the configuration file boot.ini -

C:\grldr="Grub4Dos"

NOTE 1 - the path "C:\grldr" should be used even if the Windows OS has a different drive letter.
NOTE 2 – boot.ini is a hidden system file. It is not displayed by default, in order to edit it you will need to open Explorer and select the Tools menu then select Folder Options… and open the View tab.

The edited boot.ini file will look something like this -

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
C:\grldr="Grub4Dos"

Now reboot windows – a boot menu should be displayed with a new option for Grub4dos (see figure 1).

figure 1.

Alternatively, adapt this method to boot C:\Grub4dos\grldr.mbr. Copy C:\Grub4dos\grldr.mbr to the root of your Windows partition and add C:\grldr.mbr="Grub4dos" entry in boot.ini. grldr will still need to be copied to the root of a supported drive.

A reminder from README_GRUB4DOS.txt if loading grldr via ntldr - "...ntldr only loads the startup code of grldr (i.e., the leading 16 sectors of grldr), not the whole grldr file". The embedding settings in the startup code consequently scans for grldr in all supported (hd) type devices. If grldr is present on more than one partition then another instance of grldr could be loaded. If for example grldr is present on (hd0,0) and (hd0,3) and Windows is booted from (hd0,3), ntldr will load the first 16 sectors of (hd0,3)/grldr. All other partitions would then be scanned for grldr and in this example (hd0,0)/grldr would be loaded.

Load via ntldr (Windows NT/2K/XP) - 2

If Windows is not installed, ntldr can still be used to load Grub4dos - the boot device will however need to have a Windows NT/2000/XP partition boot sector (boot sector must ‘call’ NT Loader ntldr). There are several utilities for installing the boot sector including -

You will also need to copy ntldr, ntdetect.com and boot.ini (from a windows install) and C:\Grub4dos\grldr to the boot device. Edit boot.ini and add the following entry –

[boot loader]
timeout=10
default= C:\grldr
[operating systems]
C:\grldr="Grub4Dos"

Load via bootmgr (Windows Vista/2008/7)

The Windows Vista/2008/7 boot loader bootmgr can not directly load grldr, it can however be used to load grldr.mbr.

The Windows Vista/2008/7 boot configuration file BCD (Boot Configuration Data) is a database similar in format to a registry hive and cannot be directly edited with a text editor. To add an entry for Grub4dos use the command line tool bcdedit.exe. To install grub4dos copy the file C:\Grub4dos\grldr.mbr to the Windows boot partition (usually the active partition on the first hard disk - the drive will contain the BCD store and bootmgr). To manually create an entry in the BCD store -

BCDEDIT.EXE /store %STORE% /create /d "Start GRUB4DOS" /application bootsector
{2a4b5efd-0969-11dd-9a85-000000000000}
BCDEDIT.EXE /store %STORE% /set %guid% device boot

BCDEDIT.EXE /store %STORE% /set %guid% path \grldr.mbr

BCDEDIT.EXE /store %STORE% /displayorder %guid% /addlast

Installing Grub4dos Code to The MBR

To install grub4dos to MBR via Windows XP/2000 - download grubinst/grubutil package (see here). grubinst.exe is a command line tool however a Graphic User Interface (GUI) is included in the download. Check the disk number allocated to the device you intend to install the grub4dos MBR to - use Windows Disk Management console (type C:\Windows\System32\diskmgmt.msc [ENTER] at a command prompt or in a RUN box). Installing to the wrong disk could result in Windows not booting so be careful. To install to MBR of disk:0 use command C:\Grub4dos\grubinst.exe (hd0); to install to MBR of disk:1 use command C:\Grub4dos\grubinst.exe (hd1); etc. See here for a list of grubinst.exe commands.

After installing the Grub4dos code to the MBR copy C:\Grub4dos\grldr to the root of a (supported) local drive/partition.

Installing Grub4dos Code to The Partition Boot Sector (grubinst)

Using the Grubinst package, it is possible to install Grub4dos code to the partition boot sector. Use command syntax grubinst.exe -p=n [device] or grubinst.exe --install-partition=n [device] (where n = partition number, starting from 0 for first partition. e.g. grubinst.exe -p=0 (hd0). Alternatively, use command grubinst.exe (hd0,0). grldr must be copied to the partition on which the bootsector was installed, and the partition must be active.

Installing Grub4dos Code to The Partition Boot Sector (bootlace)

It is not possible to use bootlace.com to directly access a device from a Windows NT based system. Using a third party tool it is however possible to use bootlace.com to install Grub4dos code to the partition boot sector. The following instructions have been copied from README_GRUB4DOS.txt -

To follow these instructions you will need a program capable of extracting and writing sectors from/to a drive - dsfo.exe and dsfi.exe (part of the dsfok) can be used for these tasks.

To install Grub4dos code to (hd0,1) which is an NTFS formatted partition and is mounted as drive d: in Windows -

Alternative Method - 1

If the active partition contains a Windows NT/2000/XP/2003 bootsector (boot sector loads "NTLDR") an alternative method of installing Grub4dos to the partition boot sector is possible. Hex edit the bootsector and replace the text string NTLDR with GRLDR. A batch file for replacing the text string is available here.

grldr must be copied to the partition on which the edited bootsector is installed, and the partition must be active.

WARNING - this method will only work on a FAT32 or NTFS formatted partition. Following information is quoted from here (by Grub4dos author tinybit) -

"Because the MS NTLDR boot sector of an FAT12/16 partition only loads one sector, i.e., the first sector of the NTLDR file. If this NTLDR was our GRLDR, then this will fail to boot. On the other hand, the MS NTLDR boot sector of an FAT32/NTFS partition will load the whole NTLDR file into memory, and thus our GRLDR(renamed to NTLDR) can boot OK."

Alternative Method - 2

The following method (by 911cd forum member spacesurfer - see here for the original post) has had mixed success, but works for some people. As in "Alternative Method - 2" the active partition must contain a Windows NT/2000/XP/2003 bootsector (boot sector loads "NTLDR" - refer to Load via ntldr (Windows NT/2K/XP) - 2 for instructions on installing the bootsector if required). Simply copy grldr to the partition and rename it to ntldr. The renamed grldr will now be loaded during the boot process. The partition type must be FAT32 or NTFS - refer to warning in "Alternative Method - 1" for full explanation.