Jump to content











Photo
- - - - -

Grub4dos: Multi-boot USB & HDD


  • Please log in to reply
20 replies to this topic

#1 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 08 July 2007 - 02:39 PM

Hi,

Am trying to master Grub4Dos commands.

The scenario is that I have a computer with 2 x HDD and I also have a USB stick.

I can boot of the USB stick fine, however there are XP installations on the HDD which I would like to be able to boot via Grub4Dos, but so far have not been able to do so.

If I enter
find --ignore-floppies /ntldr

Response is
(hd0,0)

(hd1,0)

(hd1,1)

(hd2,0)

I then try
chainloader (hd1,0)/ntldr

Response
Will boot NTLDR from drive=0x81,partition=0x0 (hidden sectors=0x3f)

I then enter
boot
and am returned to the Grub4dos menu on the USB key.

The same happens with the other hd/partition combinations although the response in the chainloader commands is different.

I imagine that I am probably missing some commands between find and chainloader.

Some suggestions would be helpful.

Thanks

VW

#2 was_jaclaz

was_jaclaz

    Finder

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

Posted 08 July 2007 - 05:46 PM

Yes, I guess you must somehow set the drive as ROOT.

Try:

root (hd1,0)
chainloader /ntldr


Another way, provided that you are willing to set a "tagfile" is the following:

find -set--root /disk1.tag
chainloader /ntldr



However, this is not the recommended way to multiboot XP, it is easier to keep NTLDR, NTDETECT.COM and BOOT.INI on one drive and add entries for the other partitions in BOOT.INI.

Check this (seemingly unrelated) thread:
http://www.boot-land...hp?showtopic=14



jaclaz

#3 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 09 July 2007 - 12:16 PM

Yes, I guess you must somehow set the drive as ROOT.

Try:
root (hd1,0)
chainloader /ntldr

@jaclaz

Thanks for your advice.

Although there were no errors, the above did not work either.

The command
root (hd1,0)
Responded with
Filesystem type is ntfs, partition type 0x17
But then boot returned to the menu.lst

This is a development box that I was playing around with restoring some partitions primarily to get practice with Grub4dos. I think perhaps I messed something up with the partition restores (with the MBR perhaps). I am not really sure.

Anyway I am not going to worry about these errors for the moment, I think I'll start from scratch and restore some new images and if I still have problems going forward then I'll post what I have done from the start.

Thanks

VW

#4 was_jaclaz

was_jaclaz

    Finder

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

Posted 09 July 2007 - 01:36 PM

Well, if the following is correct:

Filesystem type is ntfs, partition type 0x17


You were trying to boot from a HIDDEN NTFS partition! :1st:

http://www.win.tue.n...es-2.html#ss2.4

jaclaz

#5 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 10 July 2007 - 12:13 PM

@jaclaz
OK this is still not working with Grub4dos, so I need to learn some more.

The scenario has changed as I have trashed a few partitions.

I have restored Windows Server 2003 to hd1 in a primary partition. There is also an Extended partition with a Data volume on hd1.
On hd2 there is an XP install in a primary partition.

If I boot the computer without the USB key, Server 2003 boots OK.

When I insert the USB key and try and start the WS2003 still no dice.

find /ntldr
Response
(hd0,0)

(hd1,0)

(hd2,0)
(hd0,0) - I believe this is the USB key. Different USB key to yesterday, this one is configured as a removable device. Thought this might be reported as fd0
(hd1,0) - WS2003
(hd2,0) - XP

root (hd1,0)
Response
Filesystem type is ntfs, partition type 0x7

chainloader (hd1,0)/ntldr
Response
Will boot NTLDR from drive=0x81, partition=0x0(hidden sectors=0x3f)

boot
Response
Returns me to the Grub menu :1st:

VW

#6 was_jaclaz

was_jaclaz

    Finder

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

Posted 10 July 2007 - 02:14 PM

Well, as said this is NOT the recommended way to boot a NT/2K/XP/2003 system, it is possible that NTLDR needs to be on FIRST hard disk, FIRST PRIMARY ACTIVE partition, as DOS normally does.

Is there a reason why you cannot boot your hard disk installs throught the NTLDR on the USB stick and a properly configured boot.ini? :1st:

However, you could try exchanging drives at grub4dos (read BIOS) level, you'll have to experiment a bit, there are some examples in this thread, using direct mapping or --mem mapping:

http://www.msfn.org/...o...1384&st=114

jaclaz

#7 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 10 July 2007 - 10:02 PM

Well, as said this is NOT the recommended way to boot a NT/2K/XP/2003 system, it is possible that NTLDR needs to be on FIRST hard disk, FIRST PRIMARY ACTIVE partition, as DOS normally does.

Is there a reason why you cannot boot your hard disk installs throught the NTLDR on the USB stick and a properly configured boot.ini? :1st:

@jaclaz
Maybe. I am aiming to develop an unattended restore process for some testing that we do. My aim was to use Grub4dos as you helped me with some logic on the 911 forums (that was before I discovered Bootland which seems the most appropriate place for discussions on this subject) to be able to pass control to a Windows partition and then have it default back to Bart on the next restart.

I guess I had not appreciated the importance of the placement of boot.ini

I think I will play around with Grub4dos first, because if I can get that to work then I already have the knowledge to do what I want. If not I will think about how I can make this approach work with boot.ini. At least I have some options.

I had this boot process working on another machine using Grub4dos, but I am now using a different mbd and disk subsystem so maybe with this hardware configuration I am going to need to make a few changes.

However, you could try exchanging drives at grub4dos (read BIOS) level, you'll have to experiment a bit, there are some examples in this thread, using direct mapping or --mem mapping:

http://www.msfn.org/...o...1384&st=114

Thanks I will look into this first.

Will post the results.

VW

#8 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 11 July 2007 - 05:59 AM

@jaclaz

Thanks for posting that thread, I have been able to get WS2003 booting via Grub4dos :1st:

map (hd1) (hd0)

map (hd0) (hd1)

root (hd1,0)

chainloader /ntldr

boot
I can follow most of the logic, however but for the example, I would have tried
root (hd0,0)
instead of
root (hd1,0)
but the main thing is that it works.

Cheers

VW

#9 was_jaclaz

was_jaclaz

    Finder

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

Posted 11 July 2007 - 09:15 AM

GOOD! :1st:

Try this:

map (hd1) (hd0)
map (hd0) (hd1)
map --hook
root (hd0,0)
chainloader /ntldr
boot


If I am not mistaken, the sequence of commands you succeeded with exchanges hard disks just at the BIOS level (so, internally grub4dos identifies the devices with their "real names") whilst using the map --hook the exchange is valid also for grub4dos internal naming.

jaclaz

#10 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 11 July 2007 - 11:30 AM

@jaclaz
Your command sequence works, which is good as it is more logical to me.

Cheers

VW

#11 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 11 July 2007 - 12:25 PM

@jaclaz
Unfortunately the new command sequence seems to have affected the default menu options which I was using to "reset" the boot order to Bart on the next restart.

I think I may have to revert to the old sequence.

VW

#12 was_jaclaz

was_jaclaz

    Finder

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

Posted 11 July 2007 - 02:42 PM

Well, since you have the memory "hooked", you might need to issue a
map --unhook

command before the commands in the other entries in boot.ini.

If you post your entire menu.lst, it would be easier to pinpoint the (if any) problems.

jaclaz

#13 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 11 July 2007 - 10:34 PM

This menu boots the Windows OS but then the menu defaults to Windows OS on the next restart
color white/blue black/light-gray

timeout 10

default /default



title Bart-PE

find --set-root /minint/setupldr.bin

chainloader /minint/SETUPLDR.BIN



title Microsoft Windows

fallback 0

map (hd1) (hd0)

map (hd0) (hd1)

map --hook

root (hd0,0)

chainloader /ntldr

savedefault 0 --wait=10

I tried using
savedefault 1
on the basis that the disks had been swapped around, but made no difference possibly because there is no default file on the mapped disk 0 at this point?

This menu does not boot Windows at all, but does reset the default menu selection to Bart (after I have hit the reset button!)
color white/blue black/light-gray

timeout 10

default /default



title Bart-PE

find --set-root /minint/setupldr.bin

chainloader /minint/SETUPLDR.BIN



title Microsoft Windows

fallback 0

map (hd1) (hd0)

map (hd0) (hd1)

map --hook

root (hd0,0)

chainloader /ntldr

map --unhook

savedefault 0 --wait=10
And of course the original menu works correctly but the argument
root (hd1,0)
looks wrong.
color white/blue black/light-gray

timeout 10

default /default



title Bart-PE

find --set-root /minint/setupldr.bin

chainloader /minint/SETUPLDR.BIN



title Microsoft Windows

fallback 0

map (hd1) (hd0)

map (hd0) (hd1)

root (hd1,0)

chainloader /ntldr

savedefault 0 --wait=10
I am happy with the last menu though, because it does the job.

VW

#14 was_jaclaz

was_jaclaz

    Finder

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

Posted 12 July 2007 - 01:17 PM

Well, yes, I was referring to your innuendo:

Am trying to master Grub4Dos commands.


If I get it right, this menu always boots from second entry (ntldr aka entry#1) unless you manually select the first entry (setupldr.bin aka entry #0).

Since the default NEVER changes, you do not need to use the default command (and it's file) at all.

Besides, you are already "root" of the drive you boot from, so there is no need for the initial "find --set-root", unless you use entry #0 for fallback, but in any case, "static" root(hd0,0) wll be faster for booting, as there is no need to search for setupldr.bin.

Of course, just ideas, the main thing is that it is working as you wish :yahoo:.

jaclaz

#15 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 12 July 2007 - 01:35 PM

If I get it right, this menu always boots from second entry (ntldr aka entry#1) unless you manually select the first entry (setupldr.bin aka entry #0).

Actually it works a little differently.

The menu always boots Bart-PE unless after Bart-PE has started a different default file is copied across to change the boot selection to Windows before restarting the computer.

When Windows is booted the savedefault command on the Windows entry resets the selection back to Bart-PE after the next restart.

In this way I can use a script in BartPE to restore a Windows image to the partition and then pass control to that partition and then re-gain control after a subsequent restart.

VW

#16 was_jaclaz

was_jaclaz

    Finder

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

Posted 13 July 2007 - 03:45 PM

The menu always boots Bart-PE unless after Bart-PE has started a different default file is copied across to change the boot selection to Windows before restarting the computer.


I see. :yahoo:

I would have rewritten the menu.lst file directly, instead of adding the "default" file, but I guess it is just a matter of preferences.

However what I meant was that you need to unhook memory, something like this:

color white/blue black/light-gray
timeout 10
default /default

title Bart-PE after windows boot
map --unhook
find --set-root /minint/setupldr.bin
chainloader /minint/SETUPLDR.BIN

title Bart-PE first boot
find --set-root /minint/setupldr.bin
chainloader /minint/SETUPLDR.BIN

title Microsoft Windows
fallback 0
map (hd1) (hd0)
map (hd0) (hd1)
map --hook
root (hd0,0)
chainloader /ntldr
savedefault 0 --wait=10


jaclaz

#17 VeeDub

VeeDub

    Frequent Member

  • Advanced user
  • 140 posts
  •  
    Australia

Posted 14 July 2007 - 07:05 AM

I see. :yahoo:

I would have rewritten the menu.lst file directly, instead of adding the "default" file, but I guess it is just a matter of preferences.

However what I meant was that you need to unhook memory, something like this:

color white/blue black/light-gray

timeout 10

default /default



title Bart-PE after windows boot

map --unhook

find --set-root /minint/setupldr.bin

chainloader /minint/SETUPLDR.BIN



title Bart-PE first boot

find --set-root /minint/setupldr.bin

chainloader /minint/SETUPLDR.BIN



title Microsoft Windows

fallback 0

map (hd1) (hd0)

map (hd0) (hd1)

map --hook

root (hd0,0)

chainloader /ntldr

savedefault 0 --wait=10
jaclaz

@jaclaz

I tried the above.

It started Bart OK on the first boot, however the menu defaulted to BartPE after Windows.

When I copied the default file across the menu default changed to Windows on the second restart, but the restart of Windows failed. Perhaps because the first pass through executed the "wrong" selection with the unhook command.

It would seem that for this approach to work, on the first time through the default menu selection needs to be number #1 (first boot)
On the second time through - number #2 (Windows)
Third time through - number #0 (after Windows)
Fourth time through - number #1 (first boot) ... I think ?? or Windows depending on what I want to do.

This is starting to get complicated and potentially I am restricted in my boot choice.

While the other approach is not perfect in the sense that the drive selection looks wrong, it works fine and is simple to manage - and I like that.

So I think we might call a halt here if that's OK.

Thanks again for helping me to get this to work

VW

#18 was_jaclaz

was_jaclaz

    Finder

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

Posted 14 July 2007 - 08:04 AM

Yep, the main thing is succeeding in what one wants to achieve AND have fun while testing and finding solutions. :yahoo:

jaclaz

#19 yahoouk

yahoouk

    Silver Member

  • .script developer
  • 518 posts

Posted 06 August 2007 - 02:18 PM

Yep, the main thing is succeeding in what one wants to achieve AND have fun while testing and finding solutions. :yahoo:

jaclaz


EDITED on 07-08-07
I have succeeded VistaPE + LiveXP to boot from CD using NightMan's Grub for DOS script(edited), but not from USB.
And trying to add SLAX version 6.rc6 to this. (Succeeded last night).

This is is my menu.lst which cab be a referrerance for someone on this forum.

////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#color black/cyan yellow/cyan
#setvbe 1024x768x32
setvbe 800x600x32
splashimage /boot/mars.gz
#color white/blue green/blue
timeout 30
default 0

title VistaPE Boot from CD
chainloader /bootmgr

title LiveXP Boot from CD
chainloader /boot/cd.ima
chainloader --force /i386/setupldr.bin

title SlaxLinux.v.6 Boot from CD
image = /boot/vmlinuz
kernel /boot/vmlinuz ramdisk_size=4444 root=/dev/ram0 rw
initrd initrd=/boot/initrd.gz

##Assume 2 internal HDDs (hd0,hd1), so USB HDD will be (hd2). Boot from USB.
title Boot LiveXP from USB HDD
map (hd2) (hd0)
map (hd0) (hd2)
chainloader (hd0)+1

## Boot whatever is in CD/DVD drive, even if BIOS doesn't support
## booting from CD/DVD drive.SMB disk image sbootmgr.dsk is needed.
title Boot CD using smart Boot Manager
find --set-root /sbootmgr.dsk
map --mem /sbootmgr.dsk (fd0)
chainloader (fd0)+1
rootnoverify (fd0)

title Find and Load bootmgr of Vista from HDD
find --set-root /bootmgr
chainloader /bootmgr

title Find and Load NTLDR of Windows NT/2K/XP from HDD
find --set-root /ntldr
chainloader /ntldr

title Find and Load CMLDR of Windows NT/2K/XP from HDD
find --set-root /cmldr
chainloader /cmldr

title find and load IO.SYS of Windows 9x/Me from HDD
find --set-root /io.sys
chainloader /io.sys

title find and boot Linux from HDD
find --set-root /sbin/init
savedefault --wait=2
configfile /boot/grub/menu.lst

title MemTest86+
kernel /boot/memtest.bin

title Floppy (fd0)
chainloader (fd0)+1
rootnoverify (fd0)

title CommandLine
commandline

title Reboot
reboot

title Halt
halt

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Welcome any comments, pls.

Regards,

yahooUK

#20 yahoouk

yahoouk

    Silver Member

  • .script developer
  • 518 posts

Posted 11 August 2007 - 06:50 PM

Hi, :w00t:

I have successfully booted followings using GrubDOS. :w00t:
One Multi OSs cd included LiveXP, VistaPE, Slax 6.
One Multi OSs USB (Kingston512mb), LiveXP, VistaPE, Slax 6.
Reference URL: http://www.911cd.net...showtopic=18846

Thanks to Grub for DOS & Bart + 911cd forums members. :loleverybody:
Thanks to boot-land members as always. :w00t:

yahooUK :w00t:

#21 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 14 August 2007 - 10:49 AM

color white/blue black/light-gray

timeout 10

default /default



title Bart-PE

find --set-root /minint/setupldr.bin

chainloader /minint/SETUPLDR.BIN



title Microsoft Windows

fallback 0

map (hd1) (hd0)

map (hd0) (hd1)

root (hd1,0)

chainloader /ntldr

savedefault 0 --wait=10

The above code is ok. It is normal. The "root (hd1,0)" is no-problem. But in the last "savedefault 0 --wait=10" command, the "--wait=10" will not work. "savedefault 0 --wait=10" is just equivalent to "savedefault 0". Maybe you want to write it like this: "savedefault --wait=10 0". You can also try to add an additional "rootnoverify (hd0)" command in the end.

On the other hand you can also try this way(a logically "good" way):

color white/blue black/light-gray

timeout 10

default /default



title Bart-PE

find --set-root /minint/setupldr.bin

chainloader /minint/SETUPLDR.BIN



title Microsoft Windows

fallback 0

map (hd1) (hd0)

map (hd0) (hd1)

map --hook

root (hd0,0)

chainloader /ntldr

map --unhook

savedefault  --wait=10   0

map --hook

rootnoverify (hd0)





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users