Jump to content











Photo
- - - - -

project with grub4dos xp/xubuntu dual boot with hard drives

grub4dos dual boot hard drive linux xp

  • Please log in to reply
20 replies to this topic

#1 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 27 June 2016 - 01:42 PM

hello,

please allow me to fast-forward to today in the project, this requires attention/correction.
I don't see any sign of grub4dos.  all I see is grub2 in the title bar.  
I also need a prepared menu.lst (something I don't know how to do) placed in /boot/grub/

from the beginning:

the motherboard is an A8N-LA
it is working with 2g of pc3200 ram
two IDE/pata hard drives are being used because of the sata driver issue (an issue that has blocked me every time).

the project is a dual-boot xp and xubuntu using grub4dos to eventually boot both OS's.
to partition a hard drive and  install xp on a hard drive by itself.
the xp hard drive will be on the end connector on a ribbon cable, jumpered as master.
then connect another hard drive to the middle connector, jumpered as slave and partition and install xubuntu.  grub2 will, at this time, be the bootloader.
then install grub4dos on the hard drive, with the intention of using grub4dos as the boot manager.  I prefer to remove grub2 entirely, but am willing to wait and see how this goes.  if leaving grub2 has any benefit, I am open to leaving it on.

I have now installed xp on a maxtor 6L020L1 and xubuntu on a quantum fireball ct1515

below I provide more relevant info

in the bios, under main tab
------------------------------------------------------------------------------------------
*first channel device 0                 maxtor 6L020L1
*first channel device 1                 quantum fireball
*second channel device 0                none
*second channel device 1                none
*third channel device 0                 plextor dvdr
*fourth channel device 0                none
*fifth channel device 0                 none
*sixth channel device 0                 none
------------------------------------------------------------------------------------------
under boot tab

------------------------------------------------------------------------------------------
1st boot device                         HDD group
2nd boot device                         CD-ROM group
3rd boot device                         floppy group
4th boot device                         network boot group

*floppy group boot priority             not installed
*CD-ROM group boot priority             plextor dvdr
*HDD group boot priority                maxtor 6L020L
*network group boot priority            not installed
------------------------------------------------------------------------------------------
when highlighting 'HDD group boot priority' and pressing 'enter', this is offered

1. 1st master:                          maxtor 6L020L
2. 1st slave:                           quantum fireball ct1515
------------------------------------------------------------------------------------------

more:
1. boot.ini from 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
 
2. fdisk -l  from xubuntu

ed@ed-ER919AA-ABA-SR1820NX-NA620 ~ $ sudo fdisk -l
[sudo] password for ed:

Disk /dev/sda: 20.5 GB, 20547841536 bytes
255 heads, 63 sectors/track, 2498 cylinders, total 40132503 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00051fc1

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    20482874    10241406    7  HPFS/NTFS/exFAT

Disk /dev/sdb: 17.4 GB, 17360093184 bytes
255 heads, 63 sectors/track, 2110 cylinders, total 33906432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000643db

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    17577983     8787968   83  Linux
/dev/sdb2        17577984    20508671     1465344   82  Linux swap / Solaris

Disk /dev/sdc: 4022 MB, 4022337024 bytes
124 heads, 62 sectors/track, 1021 cylinders, total 7856127 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004cd04


3. installation of grub4dos
 a. grldr placed in root of /dev/sdb1
 b. bootlace.com installed at /dev/sdb - NOT installed on sda, xp hard drive maxtor 6L020L  
 


sudo su

cd Desktop

./bootlace.com /dev/sdb

in case of permission error message:
 


sudo chmod 0777 bootlace.com

extra info.
to place grldr in root:
it should also be on desktop
 


sudo su

cd Desktop

cp grldr /


the OS's boot up fine with grub2, but, of course, that's not what I want.  all hardware is working properly.

problems that now exist:
I don't see any sign of grub4dos.  all I see is grub2 in the title bar.  
I also need a prepared menu.lst (something I don't know how to do) placed in /boot/grub/


any advice, suggestions, or info is most appreciated.

 



#2 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 27 June 2016 - 02:56 PM

Well, if you see GRUB2, it means that you installed it to the MBR of the first disk or anyway something calls it.

 

Just don't.

 

When you install *any* Linux you are usually offered to install the GRUB2 on the MBR of a disk - usually the first disk in the booting sequence - (JUST DO NOT) or into the PBR of a volume.

 

If you plan to dual boot with XP using grub4dos it makes a lot more sense to have the standard XP MBR, the standard XP PBR and this BOOT.INI:



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

If you choose to boot to XP, then you choose XP and boot to XP directly (without going through grub4dos).

If you choose to boot *anything else* then you choose grub4dos.

 

You seemingly have not progressed very far from here :frusty::
http://reboot.pro/to...-with-grub4dos/

 

STOP (for the moment) fiddling with bootlace.com.

 

Boot to the XP.

MAKE SURE that the MBR on first disk is the XP one, you can use MBRFIX to change it if needed:

http://www.sysint.no/mbrfix

 

VERIFY that the partition with XP is active.

VERIFY that the PBR of the partiton with XP is the one chainloading NTLDR.

DO NOT, I repeat DO NOT (for the moment) install grub4dos *anywhere*, just place grldr (and a menu.lst) together on first active partition on first disk (where NTLDR, BOOT.INI and NTDETECT.COM are) DO NOT place any copy of grldr (or menu.lst) anywhere on the second disk.

Switch off the PC.

DISCONNECT the second disk.

 

Just connect the first (master) hard disk and try booting, verifying that you can:

1) boot to BOOT.INI choices and boot XP from it

2) boot to BOOT.INI choices and boot grub4dos from it (and access contents of menu.lst

 

IF (and only IF) the above works as expected, switch off connect the second hard disk and reboot.

Nothing should change, you should still have the same two choices in BOOT.INI (XP or grub4dos).

 

IF (and only IF) the above works as expected, post the contents of the grub.cfg that load the Linux you installed and we will see how to "translate" them to grub4dos syntax, otherwise report what happens.

 

 

:duff:

Wonko



#3 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 29 June 2016 - 03:53 PM

When you install *any* Linux you are usually offered to install the GRUB2 on the MBR of a disk - usually the first disk in the booting sequence - (JUST DO NOT) or into the PBR of a volume.
I'm glad you mentioned this. this is definitely the FIRST place I screwed up here, and very likely the first place I screwed up with the other project. in the xubuntu installation, at the 'installation type' window, there's a dialog box under 'device for boot loader installation', and in that dialog box it says:

/dev/sda ATA MAXTOR 6L020L1 (20.5gb)
usually the first disk in the booting sequence
yes. by default the installer chose to put the bootloader on the xp mbr, the hard drive listed above.

well, to the very right at the end of the dialog box, there is a little down arrow. when I click on that down arrow I get this:

/dev/sda ATA MAXTOR 6L020L1 (20.5gb)
/dev/sda1 microsoft windows xp professional
/dev/sdb ATA QUANTUM FIREBALL (15gb)

/dev/sdb3 xubuntu

 

so are you saying the only acceptable choice here is the third (xubuntu/slave drive) one,

/dev/sdb ATA QUANTUM FIREBALL (15gb)

?

 

thanks Wonko


Edited by ejames82, 29 June 2016 - 04:00 PM.


#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 29 June 2016 - 06:18 PM

well, to the very right at the end of the dialog box, there is a little down arrow. when I click on that down arrow I get this:

/dev/sda ATA MAXTOR 6L020L1 (20.5gb)
/dev/sda1 microsoft windows xp professional
/dev/sdb ATA QUANTUM FIREBALL (15gb)

/dev/sdb3 xubuntu

 

so are you saying the only acceptable choice here is the third (xubuntu/slave drive) one,

/dev/sdb ATA QUANTUM FIREBALL (15gb)

?

Naah, both 

 

/dev/sdb ATA QUANTUM FIREBALL (15gb) <- this means "to the MBR of second disk"

/dev/sdb3 xubuntu <- this means "to the PBR/VBR of third partition on second disk"

 

might do (it depends on the final result expected.

 

Normally (once everything will be correctly configured) you will be using the NTLDR as "main" bootmanager, possible boot sequences:
BIOS->MBR(if first disk)->PBR of active partition (invoking NTLDR)->NTLDR->BOOT.INI (choices)->XP -> load XP

BIOS->MBR(if first disk)->PBR of active partition (invoking NTLDR)->NTLDR->BOOT.INI (choices)->grub4dos -> load grub4dos

 

Once in grub4dos you might  have (say):

  1. Boot directly the linux on second hard disk (third partition) by chainloading the kernel and initrd directly (i.e. bypassing both MBR and PBR and the GRUB2)
  2. Boot the GRUB2 on second hard disk by "blindly chainloading" the second disk PBR of third partition (i.e. bypassing only the MBR)
  3. Boot the GRUB2 on second hard disk by "blindly chainloading" the second disk MBR
  4. Boot the GRUB2 on second hard disk by chainloading the GRUB2's core.img as a linux kernel

For #1 and #4 you don't need to install GRUB2 at all (though cannot say if this is allowed by the installer or if you need to install it anyway to have the core.img and a correct grub.cfg to check which parameters are needed to boot the specific Linux distro kernel)

For #2 /dev/sdb3 xubuntu is correct.

For #3 /dev/sdb ATA QUANTUM FIREBALL (15gb) is correct.

 

In practice *anything* NOT on first disk will be fine.

 

Then it depends if you plan to have that Linux disk always as "slave" with the first disk as "Master" or if you want to give it the possibility of booting "by itself" which is advised (example, say that for *whatever* reason the first disk fails to boot, if the second disk is bootable you can boot from it only changing the boot priority in BIOS).

Then you choose how to boot this second hard disk in case the first is not available, like:

grub4dos in the MBR  (+hidden sectors) < when this or the following is chosen you have the same 4 choices as above.

grub4dos in the PBR

GRUB2 in the MBR

GRUB2 in PBR

something else (say Syslinux)

etc.

 

Personally I would install the GRUB2 to the MBR of second disk, as that would allow all 4 mentioned possibilities when the first disk is booted: 

/dev/sdb ATA QUANTUM FIREBALL (15gb) <- this means "to the MBR of second disk"

this way first disk is "XP" only as the OS manufacturer expects by default (with the little add-on of grub4dos which is not installed) and the second disk is "Xubuntu" only as the OS expects by default.

 

:duff:

Wonko



#5 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 01 July 2016 - 05:00 PM

ok, I was able to fix the mbr or of the xp (master) partition, and I reinstalled xubuntu so that there is no grub4dos installed yet, but there is grub2 installed to the xubuntu/slave mbr.  I chose to install grub2 to the xubuntu hard drive (mbr) and not the partition.

now..
to boot to xubuntu (slave), I need to get into the bios and set the fireball/xubuntu hard drive as first HDD in boot order.  just as you said, I get the grub2 menu.  from that menu I can boot both xubuntu and xp with no problem.

if I put the maxtor/xp HDD as first boot HDD in the bios, the computer boots right up to xp (no grub2 menu).  this is exactly what you said would happen, and what we want.

I then placed grldr at the root directory of xp/master, along with a menu.lst

here is the menu.lst I prepared at the root directory of xp.  remember, I told you I didn't know how to make one.  I gave it my best guess.


default        0

timeout        -1

title        windows xp
root        (hd0,0)
makeactive
chainloader    +1

title        xubuntu
root        (hd0,1)
kernel    /boot/vmlinuz-3.19.0-32-generic root=/dev/hda2 ro


I think this is where you told me to stop.  I will go back and double check your replies, but I have ran out of time.  I have to work tonight, but then I get two days off to continue this project.

thank you Wonko
 



#6 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 01 July 2016 - 06:22 PM

Yep, but if you add an entry to BOOT:INI for grub4dos you should be able to get to it.

The menu.lst is "wrong".

 

title windows xp
root (hd0,0) <- OK, but "fixed"
makeactive <- Why? The partition is already active, otherwise you wouldn't have got here, as you got here because the partition was active
chainloader +1<- OK, though this makes use of the PBR

This would be IMHO "better":

title windows XP

find --set-root /ntldr <- this is "portable", root (hd0,0) is OK, however 

chainloader /ntldr <- this directly chainloads the NTLDR

 

However both will bring you back to the BOOT.INI choices between XP and grub4dos.

 

title xubuntu
root (hd0,1) <- NO, NO, NO. (hd0) is still first disk, while the Linux is on second disk!
kernel /boot/vmlinuz-3.19.0-32-generic root=/dev/hda2 ro <- NO.NO,NO. hda is still first disk, while the Linux is on second disk! And WHERE is the initrd?

 

 

This might be "better":

title xubuntu 
find --set-root /boot/vmlinuz-3.19.0-32-generic <-this is "portable" if you want it "fixed" use root (hd1,1)

kernel /boot/vmlinuz-3.19.0-32-generic root=UUID=82d1598c-fdb4-4fc8-befe-49cfd987ee90 ro <-the UUID must match YOUR UUID

initrd /boot/initrd.img-3.19.0-32-generic <-a initrd is needed

 

Typically you get these values (names of the files and UUID from the grub.cfg of the GRUB2 you installed on second disk, but grub4dos includes a uuid command, so you can check it from grub4dos and even use the find --set-root using the UUID instead of a filename:
http://reboot.pro/to...d-in-this-code/

uuid (hd1,1)

:duff:

Wonko



#7 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 02 July 2016 - 02:21 AM

I wanted to toss out a quick question before I go to work.  I will put together a REAL reply later today.

in the menu.lst, in the first line, between 'default' and '0' there are 8 spaces, between 'kernel' and '/boot/vmlinuz-3.19.0-32-generic root=/dev/hda2 ro' there is 4 (at least there WERE when I posted-I think there still are).

 

 

default        0

timeout        -1

title        windows xp
root        (hd0,0)
makeactive
chainloader    +1

title        xubuntu
root        (hd0,1)
kernel    /boot/vmlinuz-3.19.0-32-generic root=/dev/hda2 ro

 

 

how do you know how many spaces are supposed to be between these entries?  I read from somewhere that you press the tab key and the cursor automatically jumps to where it's supposed to go, is this correct?  how important is this?  what are the applicable rules regarding the entry and the amount of spaces between it and the following entry on the same line?  what if I used 2 spaces?  7 spaces?  you know how fussy the linux terminal can be, I am just considering the possibility that this (grub4dos) may be just as fussy?

 

I see all the mistakes I made on the menu.lst and intend to go over them individually and in specific.

 

thank you Wonko



#8 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 03 July 2016 - 05:35 AM

The menu.lst is "wrong".
    
title windows xp
root (hd0,0) <- OK, but "fixed"

when you say 'fixed', you mean locked-in-place.  it definitely needs to be correct.  it is not flexible (it does not SEARCH).

makeactive <- Why? The partition is already active, otherwise you wouldn't have got here, as you got here because the partition was active
yes it is a mistake, but the bootloader ignores this mistake.  correct me if I'm wrong.

chainloader +1<- OK, though this makes use of the PBR
I am not clear on this.  is the suffix '+1' the tool that causes the bootloader to target the PBR?  if it merely said 'chainloader', would the bootloader target the mbr?


This would be IMHO "better":

title windows XP
find --set-root /ntldr <- this is "portable", root (hd0,0) is OK, however
chainloader /ntldr <- this directly chainloads the NTLDR

I agree.  that is MUCH better.  I forgot about those 'ntldr specific' commands.  grub4dos looks for ntldr in the expected locations.  this is definitely an excellent 'go to' when the 'fixed' method doesn't work.  

However both will bring you back to the BOOT.INI choices between XP and grub4dos.

 

BIOS->MBR(if first disk)->PBR of active partition (invoking NTLDR)->NTLDR->BOOT.INI (choices)->XP -> load XP

BIOS->MBR(if first disk)->PBR of active partition (invoking NTLDR)->NTLDR->BOOT.INI (choices)->grub4dos -> load grub4dos

understood.

title xubuntu
root (hd0,1) <- NO, NO, NO. (hd0) is still first disk, while the Linux is on second disk!

agreed.  I guess I would have found out the first time I tried to boot.  :)

kernel /boot/vmlinuz-3.19.0-32-generic root=/dev/hda2 ro <- NO.NO,NO. hda is still first disk, while the Linux is on second disk!
yep.  I was wrong.  assuming it's the first partition (I'll have to check that again), it would be root=/dev/hdb1
 
And WHERE is the initrd?
I wasn't sure it was needed.  my fault. it would look exactly as you have it below.
initrd /boot/initrd.img-3.19.0-32-generic

This might be "better":

title xubuntu
find --set-root /boot/vmlinuz-3.19.0-32-generic <-this is "portable" if you want it "fixed" use root (hd1,1)

kernel /boot/vmlinuz-3.19.0-32-generic root=UUID=82d1598c-fdb4-4fc8-befe-49cfd987ee90 ro <-the UUID must match YOUR UUID

initrd /boot/initrd.img-3.19.0-32-generic <-a initrd is needed

ok
     
Typically you get these values (names of the files and UUID from the grub.cfg of the GRUB2 you installed on second disk, but grub4dos includes a uuid command, so you can check it from grub4dos and even use the find --set-root using the UUID instead of a filename:
http://reboot.pro/to...d-in-this-code/

that 'find' command is the best.

uuid (hd1,1)
there are a couple linux commands (for the linux terminal, of course) to get the uuid
sudo blkid
ls -l /dev/disk/by-uuid/

 

thank you for all the terrific help

 



#9 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 03 July 2016 - 10:56 AM

Don't worry about spaces (one is needed, anything more than one is ignored by the grub4dos parser) 

 

The makeactive is unneeded, imagine that you set a variable (what actually makeactive does is to make the currently root partition active, i.e. it writes 0x80 to the MBR partition table entry corresponding to that partition):

SET myvar=0x80

...

and then you blindly set it to "0x80" again:

SET myvar=0x80

you write a byte to the MBR without any reason, you overwrite a byte which is already 0x80 with 0x80, it is not a "mistake", it is only superfluous.

 

You are (understandably :)) confused by the "short hand" of grub4dos commands.

chainloader +1

actually means:

chainloader ()+1

which in itself means:
chainloader <current root>+1

Since you ran the:

find --set-root /ntldr

command before the root has been already established (to (hd0,0) in you case), so in that menu.lst entry chainloader +1 actually means chainloader (hd0,0)+1

As a matter of fact there is another "layer" of "short hand", as the offset of 0 is implied, so it is actually:
chainloader (hd0,0)0+1

Which is the PBR, one sector from the start of the volume.

 

If you want to target the MBR, you:

rootnoverify (hd0)

chainloader +1

or

chainloader (hd0)+1

or

chainloader (hd0)0+1

 

The "generic syntax" of most disk/volume related grub4dos commands is:

Command <object> <offset>+<length>

there are a few exceptions/differences, however generally it is like the above.

If <object> is missing, current root is assumed

If <offset> is missing, 0 is assumed

 

About the "fixed" or "locked in" syntax vs. the "dynamic" find --set-root , each has its own advantages and disadvantages, if you have a zillion hard disks and the ntldr is on the last logical volume inside an extended partition on last disk, it will take it some time to boot, as it has to scan all previous disk volumes.

With the ntldr on (hd0,0) it is of course practically immediate, as it is first place where grub4dos will look for ntldr.

 

:duff:

Wonko



#10 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 07 July 2016 - 06:04 PM

the menu.lst has been edited correctly.  here it is:


default        0

timeout        -1

title        windows xp
root        (hd0,0)
chainloader    +1

title        xubuntu
root        (hd1,0)
kernel    /boot/vmlinuz-3.19.0-32-generic root=/dev/hdb3 ro
initrd    /boot/initrd.img-3.19.0-32-generic



here is the grub.cfg file


#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd1,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos3 --hint-efi=hd1,msdos3 --hint-baremetal=ahci1,msdos3  10452ae4-266c-46a0-b572-f1cca11a3278
else
  search --no-floppy --fs-uuid --set=root 10452ae4-266c-46a0-b572-f1cca11a3278
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=-1
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=-1
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/06_mint_theme ###
set menu_color_normal=white/black
set menu_color_highlight=white/light-gray
### END /etc/grub.d/06_mint_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Linux Mint 17.3 Xfce 32-bit' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-10452ae4-266c-46a0-b572-f1cca11a3278' {
    recordfail
    load_video
    gfxmode $linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos3'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos3 --hint-efi=hd1,msdos3 --hint-baremetal=ahci1,msdos3  10452ae4-266c-46a0-b572-f1cca11a3278
    else
      search --no-floppy --fs-uuid --set=root 10452ae4-266c-46a0-b572-f1cca11a3278
    fi
    linux    /boot/vmlinuz-3.19.0-32-generic root=UUID=10452ae4-266c-46a0-b572-f1cca11a3278 ro  quiet splash $vt_handoff
    initrd    /boot/initrd.img-3.19.0-32-generic
}
submenu 'Advanced options for Linux Mint 17.3 Xfce 32-bit' $menuentry_id_option 'gnulinux-advanced-10452ae4-266c-46a0-b572-f1cca11a3278' {
    menuentry 'Linux Mint 17.3 Xfce 32-bit, with Linux 3.19.0-32-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.19.0-32-generic-advanced-10452ae4-266c-46a0-b572-f1cca11a3278' {
        recordfail
        load_video
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos3'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos3 --hint-efi=hd1,msdos3 --hint-baremetal=ahci1,msdos3  10452ae4-266c-46a0-b572-f1cca11a3278
        else
          search --no-floppy --fs-uuid --set=root 10452ae4-266c-46a0-b572-f1cca11a3278
        fi
        echo    'Loading Linux 3.19.0-32-generic ...'
        linux    /boot/vmlinuz-3.19.0-32-generic root=UUID=10452ae4-266c-46a0-b572-f1cca11a3278 ro  quiet splash $vt_handoff
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-3.19.0-32-generic
    }
    menuentry 'Linux Mint 17.3 Xfce 32-bit, with Linux 3.19.0-32-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.19.0-32-generic-recovery-10452ae4-266c-46a0-b572-f1cca11a3278' {
        recordfail
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos3'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos3 --hint-efi=hd1,msdos3 --hint-baremetal=ahci1,msdos3  10452ae4-266c-46a0-b572-f1cca11a3278
        else
          search --no-floppy --fs-uuid --set=root 10452ae4-266c-46a0-b572-f1cca11a3278
        fi
        echo    'Loading Linux 3.19.0-32-generic ...'
        linux    /boot/vmlinuz-3.19.0-32-generic root=UUID=10452ae4-266c-46a0-b572-f1cca11a3278 ro recovery nomodeset
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-3.19.0-32-generic
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_lupin ###
### END /etc/grub.d/10_lupin ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry 'Memory test (memtest86+)' {
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos3'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos3 --hint-efi=hd1,msdos3 --hint-baremetal=ahci1,msdos3  10452ae4-266c-46a0-b572-f1cca11a3278
    else
      search --no-floppy --fs-uuid --set=root 10452ae4-266c-46a0-b572-f1cca11a3278
    fi
    knetbsd    /boot/memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos3'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos3 --hint-efi=hd1,msdos3 --hint-baremetal=ahci1,msdos3  10452ae4-266c-46a0-b572-f1cca11a3278
    else
      search --no-floppy --fs-uuid --set=root 10452ae4-266c-46a0-b572-f1cca11a3278
    fi
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Microsoft Windows XP Professional (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-80F01462F0146128' {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  80F01462F0146128
    else
      search --no-floppy --fs-uuid --set=root 80F01462F0146128
    fi
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    chainloader +1
}
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###




I have looked over the thread and I think we are ready to:
'post the contents of the grub.cfg that load the Linux you installed and we will see how to "translate" them to grub4dos syntax'

thank you



#11 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 07 July 2016 - 07:27 PM

Well you already translated it satisfactorily I believe.

 

Though somehow you will have to explain to me the "root (hd1,0)", maybe you want to set root to the same partition where the kernel and the initrd are AND NOT on first partition of second disk.  :frusty:

Test question: If in Linux it is /hdb3, which partition does it become in grub4dos?

 

You might want to add a few lines with the same various kernel options.

i.e. you translated this:
linux /boot/vmlinuz-3.19.0-32-generic root=UUID=10452ae4-266c-46a0-b572-f1cca11a3278 ro

to this:
kernel /boot/vmlinuz-3.19.0-32-generic root=/dev/hdb3 ro

(which is OK, if you want it "fixed")

you may want to add entries with options like:

  • quiet splash $vt_handoff
  • recovery nomodeset

 

:duff:

Wonko



#12 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 09 July 2016 - 05:26 PM

Test question: If in Linux it is /hdb3, which partition does it become in grub4dos?
ok

 
default        0

timeout        -1

title        windows xp
root        (hd0,0)
chainloader    +1

title        xubuntu
root        (hd1,2)
kernel    /boot/vmlinuz-3.19.0-32-generic root=/dev/hdb3 ro
initrd    /boot/initrd.img-3.19.0-32-generic


You might want to add a few lines with the same various kernel options.
i.e. you translated this:
linux /boot/vmlinuz-3.19.0-32-generic root=UUID=10452ae4-266c-46a0-b572-f1cca11a3278 ro
to this:
kernel /boot/vmlinuz-3.19.0-32-generic root=/dev/hdb3 ro
(which is OK, if you want it "fixed")

actually, for the reason you mentioned earlier.  the bootloader doesn't have to scan/search when the entry is fixed (of course, it has to be correct).  however, a newbie like me wants to know ALL the different ways, the uuid method is very handy as well.  it's easy enough to find the uuid.  I think I used a label with a previous grub4dos project that I lucked out and got to work years ago.  I tried it again months later, but was unsuccessful.  I couldn't remember how I did it.

you may want to add entries with options like:
quiet splash $vt_handoff
recovery nomodeset

I'm not sure what they are.  I do have an idea.  you tell me how they're applied and I will gladly do so.  you know your stuff so I am sure there's a good reason why you recommend it.

anyway, it looks like everything has been configured as it needs to be and I am ready for further instruction.
waiting to hear from you.  have a couple days off now.
thanks Wonko.

 







default        0

timeout        -1

title        windows xp
root        (hd0,0)
chainloader    +1

title        xubuntu
root        (hd1,2)
kernel    /boot/vmlinuz-3.19.0-32-generic root=/dev/hdb3 ro
initrd    /boot/initrd.img-3.19.0-32-generic



uuid
10452ae4-266c-46a0-b572-f1cca11a3278



#13 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 09 July 2016 - 05:55 PM

you may want to add entries with options like:
quiet splash $vt_handoff
recovery nomodeset

I'm not sure what they are.  I do have an idea.  you tell me how they're applied and I will gladly do so.  you know your stuff so I am sure there's a good reason why you recommend it.

Actually those cheat codes are in the grub.cfg you posted, I have no idea whatsoever what they are for, I simply had a quick look and noticed that the "default" GRUB2 grub.cfg has more than one entry to boot that Linux, so you may have wanted to replicate those.

But "cheat codes" don't change between grub4dos and GRUB2, they are simply parameters appended to the kernel or linux16 commands.

You can still have an entry in grub4dos chainloading the MBR of second disk and thus load the GRUB2 grub.cfg (and thus all the options in it).

title load grub2
rootnoverify (hd1)
chainloader +1

:duff:
Wonko

#14 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 10 July 2016 - 06:19 AM

quiet splash $vt_handoff

title        xubuntu splash
root        (hd1,2)
kernel    /boot/vmlinuz-3.19.0-32-generic root=/dev/hdb3 ro quiet splash $vt_handoff
initrd    /boot/initrd.img-3.19.0-32-generic


recovery nomodeset

title        xubuntu recovery
root        (hd1,2)
kernel    /boot/vmlinuz-3.19.0-32-generic root=/dev/hdb3 ro recovery nomodeset
initrd    /boot/initrd.img-3.19.0-32-generic

But "cheat codes" don't change between grub4dos and GRUB2, they are simply parameters appended to the kernel or linux16 commands.

easy enough.  a brief investigation on google gave me an example of their use (as you see above).

I plan on using these, but only by adding them one at a time, after I know the xp and xubuntu OS's are working properly (preferrably with grub4dos included), unless you think it's better a different way.

this is actually the plan that comes to mind when grub4dos has been installed :):
1. getting the computer to boot both xp and xubuntu
2. getting the computer to boot xubuntu with (by editing the menu.lst):
 a. fixed
 b. using the find command
 c. uuid
 d. using a label

    once I have actually succeeded with all of the above, adding in more.
    I need to go back and look over the thread, but what comes to mind is this:

adding in this (and here I thought grub2 would 'be in the way' I guess I was wrong):

title load grub2
rootnoverify (hd1)
chainloader +1



for starting out as a simple project, it has grown to include much more, which I was hoping for.
I really appreciate your expertise and your willingness to share it.

are we ready to install grub4dos?



#15 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 10 July 2016 - 08:09 AM

are we ready to install grub4dos?

Sure we are, though it  - as said - would make no sense whatsoever in your setup. (because you are dual booting with XP)

 

 

Quick recap.

The actual grub4dos is essentially the file grldr, it normally should reside in root of active partition.

 

There are three main ways to have it run at boot (of which one is not an install):

1) copy to the MBR + a few hidden sectors the file grldr.mbr <- this might conflict with a (nowadays very small number of) programs that make use of sectors past the MBR, it may be not compatible with - say - bitlocker - it may be overwritten by a number of tools

2) modify the volume bootsector to chainload grldr instead of (in your case) NTLDR <- a number of programs (like antivirus/disk tools, etc,) may detect a modification of the bootsector, you need to change also the backup bootsector

3) add a line for it in BOOT.INI <- what you already did, compatible with *almost anything*, simple, working

 

 

 

Since you are using XP using the good ol' grub4dos toolbox:

http://reboot.pro/to...ox-for-windows/

represents the easier option.

 

You can of course use bootlace.com directly, but it may be difficult to use due to the complexity of command line parameters.

Alternatively, see here:
http://reboot.pro/to...dows-and-linux/

 

:duff:

Wonko



#16 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 11 July 2016 - 07:37 AM

I have been thinking it over and it seems inevitable that grub2 has to be removed now, since the main purpose of the project is to use grub4dos (the toolbox for windows is too easy, it does all the work.  there's really no challenge to it).  it makes sense to use ntldr to boot xp, but grub2 is doing too much in this project at this point in time.  

if you agree, here is what I am thinking, moving forward.

should things go wrong, and I am somehow unable to boot up, I should always be able to boot to a live linux cd to make any necessary changes (as long as the hard drives are still connected), or even reinstall grub2, is this correct?  what, if any, other possible 'repair' options do I have?

here are a couple well-written threads by Kirkx and other folks that chime in that add alot of useful info for uninstalling grub2 and numerous options and methods for configuring the menu.lst files, and making the transition through the uninstall.

http://ubuntuforums....d.php?t=2248645
http://reboot.pro/to...-from-grub4dos/


thanks, as always.



#17 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 11 July 2016 - 08:43 AM

Yep, but - really - I don't understand why you would want to remove it.

I mean you have it, it is working (if needed) you won't be using it (as you directly chainload kernel and initrd from the grub4dos by-passing the grub2) it is not like you will regain meaningful disk space by removing the GRUB2.

In any case right now you have two disks set in such a way that if both are present in the system the first can boot both first and second disk (actually XP on first disk and Linux on second disk) and each of the disk can "boot itself on its own" (if the "other" disk is missing/damaged/etc.), so IMHO you shouldn't "remove GRUB2", what you could do could be instead to replace it with grub4dos, so that you keep the "independent" booting possibility.

 

:duff:

Wonko



#18 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 11 July 2016 - 10:35 AM

what you could do could be instead to replace it with grub4dos, so that you keep the "independent" booting possibility.

ok.  are you suggesting this:?

 

You can of course use bootlace.com directly, but it may be difficult to use due to the complexity of command line parameters.

I have no problem with this.  I am just trying to spare you the frustration of the frequent screw-ups by your truly.  But I see much more to be gained by doing this.  obviously you see much advantage in keeping grub2.

 

please proceed forward and present me with your suggested plan.
 



#19 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 11 July 2016 - 11:18 AM

I mean, the grub2 on second disk is a "standard" install, you are not using it so having it or not having it installed it makes no difference whatsoever, but should you in the future need to upgrade the Linux most probably it would expect a "standard" install so you have less probabilities of an issue.

 

Same goes (the other way round) for the XP install, now everything is "standard" (you simply have an added option in BOOT.INI) any tool looking for (say) the original XP MBR, the original XP PBR, etc. will find them.

 

Replacing the GRUB2 on the second disk with grub4dos (which is of course perfectly possible) sounds more like a (senseless) "integralist" approach (like "i won't have GRUB2 be on my installs"), but these are just tools, as long as they do what they are supposed to do, let 'em be.

 

Just as an example tomorrow you may need to - say - boot a Linux .iso and if you actually *need* the GRUB2 loopback device (as opposed to one of the possible workarounds in grub4dos) to load it, you will have it handy,

 

:duff:

Wonko



#20 ejames82

ejames82

    Member

  • Members
  • 39 posts
  •  
    United States

Posted 15 July 2016 - 04:43 PM

thank you, Wonko, for all of the help.  you are always busy helping countless people and found a way to fit me in, and I know I have been a tough case.

I know that you thought it 'made sense' to keep my setup the way it is (xp and xubuntu with grub2), and if I didn't customize this computer strictly to practice grub4dos, I would have.

but,....

you know what I am about to say, don't you?

I installed bootlace to the slave hard drive, xubuntu, and miraculously managed to get both OS's to boot up reliably and quickly.  of course, it took some work.  it goes directly to xp from the boot.ini screen, and, after some investigating and troubleshooting, I now boot up xubuntu from the grub4dos screen.  the boot.ini sceen has an entry for grub4dos.  the funny thing is, there is actually about twice as much work having to go in and out of the bios than it is setting up the grub4dos components.  you end up learning alot about the bios by the time you're done.  right when I was on the virge of booting xubuntu, I received a floppy drive error that took a half hour to resolve.  the bios was forcing the computer to look for a floppy that was not plugged in.  I disabled the floppy in the bios and solved the problem.  it's unbelievably quick now to boot up.

there is no substitute to actually using the grub4dos features.  several times it didn't work (it wouldn't boot to xubuntu) for one reason or another, but every time I tried I was provided useful feedback that advanced me closer and closer to figuring out why and eventually booting xubuntu.  one of the bootup screens even gave me an error and said 'try /dev/sdb3' (referring to the kernel line, the only place it could have been).  it appears that hdb3 was not 'approved' by the bootloader and it insisted on sdb3.    

I also had difficulty with the menu.lst file on xubuntu, but, like you told me about a while ago, it was because I made the file on xp (in the future I have to find a way to archive which OS I produce the file on), put it on a flash drive, and copied it to xubuntu (a code incompatibility).  every time I made an edit, it appeared to save, but after reboot, reverted back.  this is another time when using the command-line and edit features paid off.  I immediately saw that the edit was not saved.  after I retyped it on linux (I know there were other ways to fix this, but this seemed like the simplest and most efficient) with a linux text editor, it worked.  between the edit and command-line features offered by grub4dos, I was able to figure out what changes to make to the menu.lst.

there has been alot more to this project, but I have tried to touch on most of it.

for the next few days I will experiment with the different ways to boot as I mentioned earlier, uuid, find command, and label.  then I will go back and look at the thread again.

when having two OS's on two hard drives has shown me all I wanted, I will eventually install another OS.  it could be a second OS on one of the two hard drives, or another OS on a third hard drive.  I have been thinking about this choice.  I also haven't forgotten your suggestion about making the slave hard drive able to boot by itself.  I have a feeling that THAT endevour is tougher than everything else I've done so far.

anyway, I just wanted to say that I have been working diligently at this, and will continue to do so as long as there is electricity.  :)

it's good to have you around.  you've been a HUGE help.



 



#21 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 15 July 2016 - 05:06 PM

You are welcome, I am sure :).

And of course there is nothing like experimenting (and failing and trying again until success is reached) to get the hang of how things work, I thought you were going for a "no hassle/low profile" setup, I am only too happy  that you are instead following this good advice:
 
 

Life is "trying things to see if they work".

 

Wonko approves of this.  :thumbsup:

 

:duff:

Wonko







Also tagged with one or more of these keywords: grub4dos, dual boot, hard drive, linux, xp

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users