Jump to content











Photo
- - - - -

grub4dos hard drive project - xp won't boot with grub4dos

grub4dos xp

  • Please log in to reply
16 replies to this topic

#1 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 31 May 2016 - 04:13 AM

hello,

 

 

I have embarked on a project where I installed xp and ubuntu 8.04 (hardy heron) on a hard drive.  the computer is old, a compaq evo, D51S (I think).  about 12 years old, so I thought an older OS would also be appropriate.  there is not an internet connection, but I am able to successfully move info to and from the computer's OS's with a flash drive.
after installing the dual-boot hard drive, I remove THAT hard drive and put in another hard drive and install ubuntu edgy eft (yes, it's even older than hardy heron, sorry).  after the installation finishes, I disconnect the cd drive and I place the hard drives on separate ribbon cables with edgy eft replacing the cd drive.  edgy eft is moved to the top of the boot order by what I believe is the computer's bios.  I then attempt to install grub4dos on the edgy eft hard drive and hope to boot xp and hardy heron from the dual-boot drive.
I am able to boot hardy heron.
I an not able to boot xp.  that's why I am here.

from what I recall, xp doesn't need a menu.lst in root, does it?  if it does, then that's what my problem is.  there isn't one (a menu.lst) there.  there is the file(s) ntldr, grldr, and a host of other things I thought might help after I read threads and tutorials I found while searching, many of which were not clear.  if xp needs a menu.lst, then I need help with this.

below is a load of info.  thank you for your expertise.

 

 

boot.ini from xp, edited while in xp

 

[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"
 

 

 

fdisk -l from edgy eft

 

root@ed-desktop:/home/ed# fdisk -l

Disk /dev/hdb: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb2            1276        2434     9309667+   5  Extended
/dev/hdb5            1276        1457     1461883+  82  Linux swap / Solaris
/dev/hdb6            1458        2434     7847721   83  Linux

Disk /dev/hdd: 81.9 GB, 81964302336 bytes
16 heads, 63 sectors/track, 158816 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1   *           1       50790    25598128+   7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/hdd2           50793       67050     8193150    5  Extended
Partition 2 does not end on cylinder boundary.
/dev/hdd5           50793       53439     1333363+  82  Linux swap / Solaris
/dev/hdd6           53439       67050     6859723+  83  Linux
root@ed-desktop:/home/ed#
 

 

fdisk -l from hardy heron

 

root@ed-desktop:/home/ed# fdisk -l

Disk /dev/sda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x18931893

   Device Boot      Start         End      Blocks   Id  System
/dev/sda2            1276        2434     9309667+   5  Extended
/dev/sda5            1276        1457     1461883+  82  Linux swap / Solaris
/dev/sda6            1458        2434     7847721   83  Linux

Disk /dev/sdb: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd006d006

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1        3187    25598128+   7  HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sdb2            3188        4207     8193150    5  Extended
/dev/sdb5            3188        3353     1333363+  82  Linux swap / Solaris
/dev/sdb6            3354        4207     6859723+  83  Linux
root@ed-desktop:/home/ed#
 

 

menu.lst edgy

 

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default        0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout        -1

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title        Windows 95/98/NT/2000
# root        (hd0,0)
# makeactive
# chainloader    +1
#
# title        Linux
# root        (hd0,1)
# kernel    /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=faa6365e-fb12-4e58-af93-4f6973cfba4a ro
# kopt_2_6=root=/dev/hdb6 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,5)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title        Ubuntu, kernel 2.6.17-10-generic
root        (hd0,5)
kernel        /boot/vmlinuz-2.6.17-10-generic root=/dev/hdb6 ro quiet splash
initrd        /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot

title        Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root        (hd0,5)
kernel        /boot/vmlinuz-2.6.17-10-generic root=/dev/hdb6 ro single
initrd        /boot/initrd.img-2.6.17-10-generic
boot

title        Ubuntu, memtest86+
root        (hd0,5)
kernel        /boot/memtest86+.bin
quiet
boot

### END DEBIAN AUTOMAGIC KERNELS LIST
title        Ubuntu 8.04.1, kernel 2.6.24-19-generic
root        (hd1,5)
kernel        /boot/vmlinuz-2.6.24-19-generic root=UUID=92cf9887-7006-4137-a710-1c45ccd303d0 ro quiet splash
initrd        /boot/initrd.img-2.6.24-19-generic
quiet

title        Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root        (hd0,5)
kernel        /boot/vmlinuz-2.6.24-19-generic root=UUID=92cf9887-7006-4137-a710-1c45ccd303d0 ro single
initrd        /boot/initrd.img-2.6.24-19-generic

title        Ubuntu 8.04.1, memtest86+
root        (hd0,5)
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title        Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Microsoft Windows XP Professional
root
savedefault        (hd1,0)
makeactive
chainloader    +1
 

 

menu.lst hardy heron

 

# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default        0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout        10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title        Windows 95/98/NT/2000
# root        (hd0,0)
# makeactive
# chainloader    +1
#
# title        Linux
# root        (hd0,1)
# kernel    /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=92cf9887-7006-4137-a710-1c45ccd303d0 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,5)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title        Ubuntu 8.04.1, kernel 2.6.24-19-generic
root        (hd0,5)
kernel        /boot/vmlinuz-2.6.24-19-generic root=UUID=92cf9887-7006-4137-a710-1c45ccd303d0 ro quiet splash
initrd        /boot/initrd.img-2.6.24-19-generic
quiet

title        Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root        (hd0,5)
kernel        /boot/vmlinuz-2.6.24-19-generic root=UUID=92cf9887-7006-4137-a710-1c45ccd303d0 ro single
initrd        /boot/initrd.img-2.6.24-19-generic

title        Ubuntu 8.04.1, memtest86+
root        (hd0,5)
kernel        /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title        Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title        Microsoft Windows XP Professional
root        (hd0,0)
savedefault
makeactive
chainloader    +1

title        Ubuntu, kernel 2.6.17-10-generic
root        (hd0,5)
kernel        /boot/vmlinuz-2.6.17-10-generic root=/dev/hdb6 ro quiet splash
initrd        /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot

title        Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root        (hd0,5)
kernel        /boot/vmlinuz-2.6.17-10-generic root=/dev/hdb6 ro single
initrd        /boot/initrd.img-2.6.17-10-generic
boot

title        Ubuntu, memtest86+
root        (hd0,5)
kernel        /boot/memtest86+.bin
quiet
boot
 



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 31 May 2016 - 08:07 AM

Well, if you boot to grub4dos, you are NOT booting to NTLDR.

"Normal" boot sequence (for XP):

BIOS->MBR of boot disk->PBR of Active partition->NTLDR->BOOT.INI choices->XP (or grub4dos)

"Normal" boot sequence (grub4dos installed to MBR):

BIOS->MBR (grldr.mbr)->grldr->first menu.lst found->whatever

"Normal" boot sequence (grub4dos installed to PBR):

BIOS->MBR of boot disk->PBR of Active partition->grldr->first menu.lst found->whatever

 

You do not *need* a menu.lst, you need an entry for XP in one oft the menu.lst you are already using.

But - temporarily - forget about it, press "c" to get to grub4dos command line and a the grub> prompt type:

find --set-root /ntldr

chainloader /ntldr

boot

 

You should get to the BOOT.INI chioices and from that (provided that the ARCPATH "multi(0)disk(0)rdisk(0)partition(1)\WINDOWS" is correct) you should be able to boot to XP.

Then, if it works, you can "translate it" to either:

title Windows XP

find --set-root /ntldr

chainloader /ntldr

or (if you prefer a "static" setup, lie the other ones you have):

title Windows XP

root (hd0,0)

chainloader /ntldr

and add the entry to the menu.lst that grub4dos uses when booting.

 

:duff:

Wonko



#3 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 31 May 2016 - 01:56 PM

hello wonko,

 

 

we get back a mixed bag when I try the grub commands.  to make a long story short, the computer reboots.

I know for sure that the xp does boot up if I unplug the molex from the edgy hard drive, eliminating it from the setup and focusing all resources and attention on the dual-boot hard drive.

 

here's what specifically happened when I put the commands in as you instructed:

 

grub> find --set-root /ntldr

(hd1,0)

 

grub> chainloader /ntldr

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

 

grub> boot

 

no reply from grub, and as I stated earlier, the computer reboots.

I have a question.  during this exchange:

grub> find --set-root /ntldr

(hd1,0)

is grub stating that it found ntldr on that partition? 

 

thank you for showing me this.  it's like you can query grub4dos for info.



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 31 May 2016 - 06:02 PM

Yep - somehow - you have the disks "exchanged".

 

Your BOOT:INI ARCPATH :

"multi(0)disk(0)rdisk(0)partition(1)\WINDOWS" <- this in Arcpath notation means 1st partition on first disk (disk 0)

and points to (hd0,0) <- in grub/gub4dos (NOT GRUB2) notation means partition at offset 0 (aka first partition) on first disk (disk 0)

 

But your hard disk is SECOND harddisk (or (hd1) or rdisk(1) or in DOS/BIOS notation disk 0x81 or 129), so you can 

EITHER:
replace the arcpath in boot.ini with one (or add a second one) pointing to second disk 

OR:

exchange disks in grub4dos:

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

root (hd0,0)

chainloader /ntldr

 

And yes, one of the best features of grub4dos is command line interactivity, which allows to run any number of commands and get the feedback, and in recent versions grub4dos command line is comparable to a minimal Operating System, not entirely unlike DOS (and supports aso batch scripts).

 

:duff:

Wonko



#5 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 01 June 2016 - 04:28 PM

well, I booted up, selected xp, pressed c, and took advantage of the grub prompt and put in the commands you instructed.

 

it worked perfectly  :)

my reason for doing that first was only because the computer was all ready to try.

 

then my menu.lst could say this and work?:

 

 

title    windows xp

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

root (hd0,0)

chainloader /ntldr

 

 

is this correct?

now about the first part of your post #4

EITHER:
replace the arcpath in boot.ini with one (or add a second one) pointing to second disk

I am going to try to make the edit from within hardy heron.  it will be nice to know if edits can be made successfully from linux, thus making the procedure risk free, because it can always be changed back and it will also prove that the linux notepad formatting is compatible with xp's (I read somewhere in my google searching that it might not be)

 

 

you're awesome, wonko, as usual.

I will let you know how it goes.



#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 02 June 2016 - 10:50 AM

Yep, that is correct. :)

The "issue" when comparing DOS/Windows text with Linux one is a different convention (it doesn't necessary apply to this or that command, it is "system wide").
Anything MS will use CR+LF (Carriage Return + Line Feed) at each "newline", Unix/Linux use just LF:
https://en.wikipedia.org/wiki/Newline

Cannot remember if the NTLDR parser will accept "just LF" as newline. :unsure:

Please note how technically you don't really-really need to "edit" the BOOT.INI, you need to replace two occurrences of a single character (changing it from 0 to 1) so you can do it in a number of ways with a search and replace tool or even with dd without actually "loading and editing the file".

Anyway there are a number of tools that convert CR+LF to LF and viceversa.

Most probably this simple edit can be done even in grub4dos :dubbio: but I never actually tried it (NTFS support in grub4dos is read only but you have direct disk access, the issue here might be that the BOOT:INI, being less than 700 bytes or so will be resident in the $MFT).

:duff:
Wonko

#7 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 03 June 2016 - 04:33 PM

well, this victory is going to be elusive.

I tried the edit you instructed to the boot.ini:

 

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

 

clicked 'save' and reboot.  then selected xp.

I received the following error message:

 

 

booting Microsoft Windows xp professional

 

(hd0,5): File system type is ext2fs, partition type 0x83

savedefault (hd1,0)

 

error 23.  error while parsing number.

 

press any key to continue

 

 

am I mistaken, or does the bootloader think xp is a linux ext file system and not ntfs?  that's odd.

anyway, since making the edit, I don't think I can get back into xp.  I need to make a detailed reply for you.  a bunch of different screens come up and I need to show you what each one says to give you a fair chance to figure out what is wrong.

I go to work tomorrow, then I get two days off.  I haven't had much of a chance to work on this.  I fit it into my day when I can.

thank you so much.



#8 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 03 June 2016 - 04:58 PM

I just noticed something:

this

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

hasn't been changed at all (it's the exact same as in reply #1), which is a mistake by me.  I did change that line.  what you see there was copied and pasted from above.  disregard that.  in the boot.ini that line actually says this:

default=multi(0)disk(0)rdisk(1)partition(0)\WINDOWS

my fault.

 

and then I realized that there are two lines that say the exact same thing. 

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

do both need to be changed?  because I changed the first 'default' line, but not the second 'Microsoft windows xp professional' line.

now I feel like such a duh.  I have been up 16 hours and it shows.  I am making matters worse.  :)



#9 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 03 June 2016 - 06:28 PM

 have been up 16 hours and it shows.  I am making matters worse.    :)

Yep. :)

The BOOT.INI has a .ini structure ;), values are divided in sections, one section is [boot loader],  value in the "default" key should match one of the entries in the [operating systems].

You should appreciate that in [boot loader] the "default" is the key name, and "multi(0)disk(0)rdisk(0)partition(1)\WINDOWS" is the value, whilst in the  [operating systems] section the "multi(0)disk(0)rdisk(0)partition(1)\WINDOWS" is the key name.

And JFYI, you cannot have a partition(0) :w00t: :ph34r:

Disks (rdisk) are numbered from 0, partitions are numbered from 1.

 

:duff:

Wonko



#10 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 05 June 2016 - 04:02 PM

I can still find ways to get into xp, though it's far from just clicking on the grub4dos menu entry and xp booting right up.

I have not yet removed grub2.  I was hoping I wouldn't have to, but now after all of these complications, I need to make sure you know it's still on both linux OS's (edgy eft and hardy heron).  it may be working in unexpected ways.  maybe you thought I removed it, sorry.  this may be why it's not going well, even with your help.  this may be the cause of the disks being 'exchanged'.

should I remove grub2?

by the way, this is just a project setup.  I set it up exclusively to test and learn grub4dos.  there is absolutely NO important data on this project computer.  I have already learned a great deal and it has been well worth the effort I have put in thus far.  this is a heck of a lot of fun.

I wanted to make sure you knew grub2 was still on here.  then I will give you a 'screen by screen' report of the text that comes up as I make choices.  it's really quite intriquing.  without you knowing what is happening specifically isn't giving you a fair chance to see what is going wrong.

 

about your last post:  then the boot.ini starts at rdisk 0, and partition starts at 1.  that was the case in reply #1.  I just wanted to point that out.

thank you so much.



#11 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 June 2016 - 05:52 PM

Nahh, unless you have a "very peculiar" grub2 install, it doesn't exchange disks.

 

Depending on the motherboard and BIOS (and the settings in it) disks may be exchanged, usually the disk you boot from is first disk (hd0) or rdisk(0), that XP has been installed at a time when that disk was first disk, and later (for whatever reason) you must have changed some settings (or added a disk) and that disk became non-first, if the disks are SATA, it is possible that the actual physical connector number determines the number of a disk.

 

If you boot to grub4dos, and press c (to get to command line) and run (of course BEFORE exchanging disks in grub4dos):

geometry (hd0)

and

geometry (hd1)

it will be pretty clear which disk the BIOS sees as what # and you can try swapping the connectors or change the disk order in BIOS.

 

:duff:

Wonko



#12 RoyM

RoyM

    Frequent Member

  • .script developer
  • 398 posts
  • Interests:Component level repair, Micro-processor based equipment. Computer Repair + Custom Builds.
    (ie. Game Machines, Custom Firewalls\Smoothwalls)
    Network Penetration and testing + Wireless.
    Fishing, Hunting, Camping, Gaming.
  •  
    United States

Posted 05 June 2016 - 08:06 PM

If you do have PATA, you may also want to check the Master/Slave/CS jumper on HD.

Regards

RoyM

 

Edited mistakenly wrote SATA



#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 June 2016 - 04:57 PM

Edited mistakenly wrote SATA

Call them IDE/ATA, it's easier ;).

 

:duff:

Wonko


  • RoyM likes this

#14 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 06 June 2016 - 05:24 PM

I tried swapping the hard drives on the connectors, and xp still wouldn't boot at the grub4dos screen.  so instead of adding more confusion to the situation (I was worried about myself being able to deal with it, I admit it), I swapped them back.  here is a detailed explanation of what is going on without the luxury of copy, paste, and internet (the next project will have those things to start with, along with up-to-date OS's that software will easily work with).

 

 

after bios screen

I pushed pause to stop

------------------------------------------------------------------
press hot-key to boot previous MBR, any other key to start grub

timeout: 5
--------------------------------------------------------------------
I tried pressing the hot-key (spacebar), but it didn't help to boot
to xp (or anything).  I tried spacebar numerous times to no avail.  I think it has the same effect as the action below does.  the text below happens so quickly that you may not be allowed to notice the info, where the hot-key allows you to examine each partition as it's tried (I assume).

-------------------------------------------------------------------------
try (hd0,0): invalid or null
try (hd0,1): extended
try (hd0,2): invalid or null
try (hd0,3): invalid or null
try (hd0,4): non-MS: skip
try (hd0,5): extended
try (hd0,5): EXT2:
---------------------------------------------------------------------
the computer goes right into the next screen by itself
-------------------------------------------------------------------
grub4dos 0.4.4 2009-03-31, memory: 639k / 758M, menuend: 0x48494

ubuntu, kernel 2.6.17-10-generic
ubuntu, kernel 2.6.17-10-generic (recovery mode)
ubuntu, memtest86+
ubuntu, 8.04.1, kernel 2.6.24-19-generic
ubuntu, 8.04.1, kernel 2.6.24-19-generic (recovery mode)
ubuntu, 8.04.1, memtest86+
other operating:
microsoft windows xp professional

use the up and down keys to highlight an entry.  press enter or 'b' to boot.  press 'e' to edit the commands before booting.  press 'c' for command-line.
-----------------------------------------------------------------------
if I go down and select xp and select enter:
------------------------------------------------------------------------
booting microsoft xp professional
root (hd0,1)
error 17: cannot mount selected partition
press any key to continue
---------------------------------------------------------------------
if I put in wonko's special commands
---------------------------------------------------------------
map (hd0) (hd1)
map (hd1) (hd0)
map --hook
root (hd0,0)
    filesystem type is ntfs, partition type 0x07
chainloader /ntldr
    will boot NTLDR from drive=0x80, partition=0x0(hidden sectors=0x3f)
boot
-------------------------------------------------------------------------
the next screen:
---------------------------------------------------------------------------
please select the operating system to start


microsoft windows xp professional
grub4dos

use the up and down keys to move the highlight to your choice.  
press enter to choose
seconds until the highlighted choice will be started automatically 30:

for troubleshooting and advanced start options for windows, press F8
-------------------------------------------------------------------------
this is a good screen to see.  once I am here, I am in.  my guess is, the above screen is delivered by windows xp boot.ini.  I have already booted to xp (successfully) by using esc and backspace keys, so my guess is, that ANY key will boot the computer into xp.  the computer will still get into xp, but not by merely selecting xp from the first screen, which, of course, is what we're after.  if I choose the 'grub4dos' choice from the above screen I go to another screen:
----------------------------------------------------------------------------------
grub4dos 0.4.4 2009-03-31, memory: 639k / 758M, menuend: 0x484A0

ubuntu, 8.04.1, kernel 2.6.24-19-generic
ubuntu, 8.04.1, kernel 2.6.24-19-generic (recovery mode)
ubuntu, 8.04.1, memtest86+
other operating systems
microsoft windows xp professional
ubuntu, kernel 2.6.17-10-generic
ubuntu, kernel 2.6.17-10-generic (recovery mode)
ubuntu, memtest86+

use the up and down keys to highlight an entry.  press enter or 'b' to boot.  press 'e' to edit a command before booting.  press 'c' for command-line.
--------------------------------------------------------------------------------
I think the screen above is from hardy heron because of the placement of xp in the middle of the list.  when I select xp from THIS list, the computer booted right up into xp.

that's where I am at with this dual-boot linux/xp plus linux setup.


some added info:
I read in the grub4dos tutorial that pressing 'insert' during the boot process can provide useful info, so I tried it.  immediately following this screen

-------------------------------------------------------------------------
try (hd0,0): invalid or null
try (hd0,1): extended
try (hd0,2): invalid or null
try (hd0,3): invalid or null
try (hd0,4): non-MS: skip
try (hd0,5): extended
try (hd0,5): EXT2:
---------------------------------------------------------------------
I tried the insert key.  this info was provided:
------------------------------------------------------------------------
hard drives: 2, int13: F00023CB, int15: F000F859
get_diskinfo(80),  int13/41(80),version=AA300005,  int13/08(80),version=0, C/H/
S=1023/240/63,  int13/02(80),err=0
warning: MBR cylinders(1024) is not equal to the BIOS one(1023)

warning: MBR heads(255) is not equal to the BIOS one (240)

warning: MBR total sectors (16450560) is greater than the BIOS one (15467760)
some buggy bios's could hang when you access sectors exceeding the bios limit
LBA, C/H/S=1024/255/63, sector count/size=16450560/512
get_diskinfo(81),version=AA300005,  int13/08(81),version=0, C/H/
S=1023/240/63,  int13/02(81),err=0,
warning: unrecognized partition table for device 81.  please rebuild it using a
microsoft-compatible FDISK tool (err=26).  current C/H/S=1023/240/63
LBA, C/H/S=1023/240/63, sector count/size=15467760/512
boot drive=80,  int13/4B01(80),err=1,drive=80, not CD
get_cdinfo(7F), int13/4B01(7F),err=1,drive=7F,  cdrom_drive == FFFFFFFF
starting cmain () open default  failure.

no PXE stack

end of menu init commands.  press any key to enter command line or run menu
---------------------------------------------------------------------
what I am wondering from this info, just the warnings that I can make SOME sense of, that I may have a hardware issue that may not allow booting to xp with grub4dos through the edgy eft hard drive.

 

thanks for all the help, guys, and yes, they are IDE (not sata) hard drives.



#15 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 07 June 2016 - 07:54 AM

I can confirm that you are making some confusion (don't worry, it is perfectly "normal" and part of the .fun in experimenting :))
Maybe too many hours after this without some planning in advance. :w00t: :ph34r:
 
What is the (expected) goal?
What is the actual plan you had to reach it?
 
What you reported above seems to me "perfectly normal", you are mixing (liberally) the hard disk order with the settings in the BOOT.INI with a "mixed environment".

Let's start calling disks with their name.
Your first disk (or hd0) is the one on which you have seemingly installed (why?) grub4dos to the MBR. Let's call it "ubuntu, 8.04.1".
Your second disk (or hd1) is the one on which you have the Windows XP, i.e. you have on it the NTLDR and BOOT.INI (and grldr, and menu.lst, this latter actually being the menu.lst of the GRUB, not GRUB4dos, put by the Ubuntu install in \grub\ or \boot\ etc.) besides the \Windows\ install directory, let's call it "Windows XP".

 

Let's see if I can "translate" your report in a more understandable manner), it seems like you are booting from a grub4dos (obsolete, NEVER recommended - as a matter of fact STRONGLY DEPRECATED version) installed ot the MBR of the "ubuntu, 8.04.1" disk.
 
What you actually do when you install grub4dos to the MBR is to write to the MBR (AND to a number of "hidden sectors") the file grldr.mbr.

This file when executed at boot time will try to LOCATE the file grldr and chainload it.

It will chainload the FIRST instance of grldr it can find on any disk.

Of course it looks for it in a given order, i.e. starting from "itself".
It starts by analyzing the partition table:
try (hd0,0): invalid or null <- first entry in partition table is EMPTY (NO GRLDR file here)
try (hd0,1): extended <- second entry in partition table is an extended partition (NO GRLDR file here)
try (hd0,2): invalid or null <-third entry in partition table is EMPTY (NO GRLDR file here)
try (hd0,3): invalid or null <-fourth  entry in partition table is EMPTY (NO GRLDR file here)
try (hd0,4): non-MS: skip <-first volume in Extended partition cannot possibly contain grldr (NO GRLDR file here)
try (hd0,5): extended
try (hd0,5): EXT2: <-second volume in Extended partition is EXT2 (BUT NO GRLDR file here)
 
Hmmm, let me try if there is another disk, yes, there is :):
try (hd1,0): NTFS <- here grldr IS found (but you cannot see this line since, because it is found, it will load, clearing the screen).

 

The grldr then looks for a menu.lst, in Root, in \boot\ and in \grub\ directories, these are the commands embedded into it (the version you are using):

configfile
default 0
timeout 1

title find /menu.lst, /boot/grub/menu.lst, /grub/menu.lst
	errorcheck off
	configfile /menu.lst
	configfile /boot/grub/menu.lst
	configfile /grub/menu.lst
	find --set-root --ignore-floppies --ignore-cd /menu.lst && configfile /menu.lst
	find --set-root --ignore-floppies --ignore-cd /boot/grub/menu.lst && configfile /boot/grub/menu.lst
	find --set-root --ignore-floppies --ignore-cd /grub/menu.lst && configfile /grub/menu.lst
	errorcheck on
	commandline

title commandline
	commandline

title reboot
	reboot

title halt
	halt

Since you have not a menu.lst specifically made for grub4dos and findable BEFORE the one made (for GRUB, not grub4dos) by the one or the other Ubuntu installs, the grldr will find the one or the other of them.

 

So it seems that you are booting from the MBR (+hidden sectors) on (hd0)="ubuntu, 8.04.1" but you are loading the grldr  residing on (hd1)="Windows XP", more exactly, on the first partition of second disk, i.e. (hd1,0), and then load the menu.lst residing (probably) on (hd1,1) and created by the "hardy heron" install.

 

At the time you installed the XP (and added the grldr and  the Ubuntu) you had only one disk in the system, so at the time the "Windows XP" disk was the first disk.

 

Then you added (again at a time when there was only one disk connected to the system) the other older Ubuntu on the "ubuntu, 8.04.1".

For *some reasons* (which can be found of course, it is either BIOS settings, disk connector order or as RoyM suggested jumpers on the actual disks) this latter disk remains "first disk" when you re-add the "Windows XP" disk.

 

The provisions in the menu.lst for XP were made "automagically" at the time the disk was the only one:

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root
savedefault (hd1,0)
makeactive
chainloader +1

and besides being intended for GRUB (and not for grub4dos which has "better" features) they need to be changed to reflect the presence of two disks (or better to make the entry "independent" from the presence of the one or the other disk), but right now the issue is the overcomplicated booting sequence.

If you describe the actual intended goal, I am sure that we can find a (much simpler and BTW faster) booting sequence working with the one or the other disk (or with both). :)

 

:duff:
Wonko

 

 



#16 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 08 June 2016 - 02:14 AM

Maybe too many hours after this without some planning in advance. :w00t: :ph34r:

point well taken.  I clearly see now that I could have used a better version of grub4dos.  the most important file from the package is the bootlace.com file, and I tried other versions to install it without success.  I understand that this choice is like 'building a house on top of dirt'.

do I have permission to PM you?  I have another project in mind, and I want to start it off the correct way  (grub4dos version, hard drive configuration, etc).  I don't want to muddy up the forum with every little thing.  what's your thought on this?

 

I am going to write up a detailed response to your reply (and the entire thread), but I will be busy for a few days and hours will be limited, but I will get to it.

I also wanted to point out a link to a thread that you were involved in that had a similar situation to mine, just to let you know I am still working on this.  I am actually having a heck of a good time.  :)

http://reboot.pro/to...-from-grub4dos/

I'll be back.  thanks



#17 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 08 June 2016 - 10:50 AM

Sure, no problem :).

If the matter sounds like having "public interest" we can then shift back to the forum.

 

:duff:

Wonko







Also tagged with one or more of these keywords: grub4dos, xp

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users