Jump to content











Photo
- - - - -

Convert boot.ini path to Grub4DOS


  • Please log in to reply
14 replies to this topic

#1 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 21 November 2007 - 03:41 AM

Hi,

I am using Grub4Dos with a USB key to load Bart.

From time to time I would also like to be able to load the OS on the target system.

I really like Grub4Dos but to date I have not really got to grips with how to identify and pass control to OS partitions other than Bart.

If I have a boot.ini file with the following path
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS

What would the equivalent Grub4Dos path be?

Also is the USB key likely to alter the path?
(in which case I would need to modify the boot.ini while the USB key was being used)

Thanks

VW

#2 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 21 November 2007 - 04:35 AM

I have been trying a few things

find /boot.ini
This command finds the boot.ini on the USB key but then Grub hangs and the PC does not even respond to Ctrl-Alt-Del, and requires a reset.

What might cause this to occur and more importantly are there some options I can try to prevent the lock up?

VW

#3 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 21 November 2007 - 04:54 AM

@VeeDub

grub4dos syntax for multi(0)disk(0)rdisk(0)partition(2)\WINDOWS is:
title Boot Windows on partition 2 

find --set-root (hd0,1)/ntldr

chainloader (hd0,1)/ntldr


#4 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 21 November 2007 - 06:43 AM

@VeeDub

grub4dos syntax for multi(0)disk(0)rdisk(0)partition(2)\WINDOWS is:

title Boot Windows on partition 2 

find --set-root (hd0,1)/ntldr

chainloader (hd0,1)/ntldr


Well, no. :cheers:

Using the "find" with a hardcoded path is a bit like "cheating". :cheers:

This is the letteral translation
title Boot Windows on partition 2 

root (hd0,1)

chainloader (hd0,1)/ntldr

but once you have set root, it is implied, this will work as well:
title Boot Windows on partition 2 

root (hd0,1)

chainloader /ntldr

With multi sintax:
multi is always 0
disk is always 0
rdisk is the disk number (beginning with 0, so directly translated into grub4dos syntax)
partition is the partition number (beginning from 1, UNLIKE grub4dos that starts from 0)

But you need the boot.ini anyway.

jaclaz

#5 ktp

ktp

    Silver Member

  • Advanced user
  • 773 posts

Posted 21 November 2007 - 08:25 AM

@jaclaz

Wow, excellent. I used your code to change many entries of my current menu.lst.
It is better and clearer as is.

By the way (and not related), did you have the time to look at my question in :
http://www.boot-land...?...30&start=30

#6 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 21 November 2007 - 10:13 AM

@jaclaz

When I enter
root (hd0,1)

I get response
Error 27: No such partition

I suspect that the USB key is changing the order of the disks

So I tried
root (hd1,1)

And Grub just hung, which is also what happened when I tried the find command.

Are there some commands I can use to identify what partitions are available?

Thanks

VW

#7 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 21 November 2007 - 11:48 PM

This command finds the boot.ini on the USB key but then Grub hangs and the PC does not even respond to Ctrl-Alt-Del, and requires a reset.


which grub4dos version are you working at?

Try once more with the latest build at http://grub4dos.jot.com/

root (hd0,1)

Error 27: No such partition

why not start from (hd0,0)? e.g.

root (hd0,0)

root (hd0,1)

root (hd0,2)

root (hd0,3)

root (hd0,4)

root (hd0,5)

root (hd0,6)

root (hd0,7)

root (hd0,8)

root (hd0,9)

root (hd0,10)

root (hd0,11)


#8 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 21 November 2007 - 11:56 PM

find --set-root (hd0,1)/ntldr


This usage for the FIND command is wrong. The "(hd0,1)" should be stripped out. And the wrong usage will no longer be supported in the newer versions(it will result in an error message).

#9 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 22 November 2007 - 12:31 AM

@tinybit

I am presently using version 0.4.3 2007-05-26

I will try the latest version with your suggestions and post outcome

Thanks

VW

#10 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 22 November 2007 - 12:53 AM

@tinybit

I have installed version 0.4.3-2007-11-18 on the USB key

When I issue the command
find --set-root /ntldr

It returns
(hd0,0)

Filesystem type is fat, partition type 0xc
and returns

This would be the USB key.

It does not see the HDD which presumably is hd1.

I try
root (hd1,1)
as this is where I think the NT partition should be

Response
Filesystem type is ntfs partition type 0x7

Sounds promising I think

Two questions

1. Can I get a dir of this partition to see if I am in the right place
2. What command should I issue to try and boot

Thanks

VW

#11 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 22 November 2007 - 03:43 AM

According to your description, there is no problem on grub4dos at all.

You may read more about grub4dos at http://grub4dos.sourceforge.net/wiki

Thanks for your trying grub4dos.

#12 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 22 November 2007 - 05:12 AM

According to your description, there is no problem on grub4dos at all.

I am sure you're right about that, the problem is the user for certain

You may read more about grub4dos at http://grub4dos.sourceforge.net/wiki

A useful link ... thank you.

I have tried the following
find /ntldr

Response
(hd0,0)

(hd1,1)

I enter
root (hd1,1)

Response
Filesystem type is ntfs, partition type 0x7

I enter
chainloader (hd1,1)/ntldr

Response
Will boot NTLDR from drive=0x81, partition=0x1(hidden sectors=0xfb04)

I enter
boot

And it returns to my Grub4Dos menu :cheers:

#13 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 22 November 2007 - 08:49 AM

chainloader (hd1,1)/ntldr

Note that we ONLY chainload NTLDR itself, not WINDOWS kernel. If NTLDR is configured (in its BOOT.INI) to ONLY load our GRLDR, then this will result in a loop back to GRUB again.

-----------------------

root (hd1,1)

and

boot

This is another possible wong usage. The supposed problem is not about grub4dos itself, but about the boot capability of DOS/Windows. I don't know whether or not DOS/Windows can be booted off the second drive. If it can, all of us could learn something new from it, I think.

#14 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 22 November 2007 - 10:43 AM

@tinybit

Your observations about booting from the 2nd drive got me thinking about using the map statement.

Using the following code I was able to boot NT on the second drive

map (hd1) (hd0)

map (hd0) (hd1)

root (hd1,1)

chainloader /ntldr

Thanks very much for your help :cheers:

VW

#15 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 22 November 2007 - 02:29 PM

@tinybit

Your observations about booting from the 2nd drive got me thinking about using the map statement.

Using the following code I was able to boot NT on the second drive

map (hd1) (hd0)

map (hd0) (hd1)

root (hd1,1)

chainloader /ntldr

Thanks very much for your help :cheers:

VW


Hmmm, why do I have this "dejavu" feeling? :cheers:

http://www.boot-land...?showtopic=2568

http://www.boot-land...?...c=2568&st=7

:cheers:

jaclaz




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users