Tuesday, April 05, 2011

Using GRUB4DOS from Windows 7

A. GRUB4DOS
Copy grldr.mbr, grldr and menu.lst to C:\.

B. BCDEdit
1. Backup the current config:
bcdedit.exe /export c:\filename

2. Create new entry
bcdedit.exe /create /d "GRUB4DOS" /application bootsector

This returns a guid of 32-character string like
{5ed99144-5f57-11e0-818a-78843ccde686}
.
3. Set entry option value: device
bcdedit.exe /set {5ed99144-5f57-11e0-818a-78843ccde686} device boot

However, when booting, it may get the following error:
File: \grldr.mbr
Status: 0xc000000f
Info: The selected entry could not be loaded because the application is missing or corrupt.

This is because becouse Windows 7 creates a hidden extra partition for the BCD. Then, this command should be issued:
bcdedit /set {5ed99144-5f57-11e0-818a-78843ccde686} device partition=C:

4. Set entry option value: path
bcdedit.exe /set {5ed99144-5f57-11e0-818a-78843ccde686} path \grldr.mbr

5. Set entry display order
bcdedit.exe /displayorder {5ed99144-5f57-11e0-818a-78843ccde686} /addlast

6. Set timeout (for example, 2 sec)
bcdedit /timeout 2

No comments: