LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-02-2017, 01:45 PM   #1
davexnet
LQ Newbie
 
Registered: May 2016
Posts: 28

Rep: Reputation: Disabled
Grub - booting to a saved boot sector


Hi all,
I have a boot sector (512 bytes saved using the Linux DD command). I'm interested
in finding out if Grub2 can boot to this saved boot sector.

It's possible to do this in reverse with the Windows XP boot mechanism to boot
to linux like this, this boot.ini extract shows an option to boot to Linux
using the saved boot sector

default=multi(0)disk(0)rdisk(0)partition(3)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="Microsoft Windows XP Professional F" /FASTDETECT /NOEXECUTE=OPTIN /USEPMTIMER
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional C" /FASTDETECT /NOEXECUTE=OPTIN /USEPMTIMER
c:\Linux_boot_sector.bkp="Linux"

I would like to do the reverse, access a saved boot sector in Grub2 to boot to
Windows XP
 
Old 02-02-2017, 04:23 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,952

Rep: Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073
No - only the hardware can boot a boot sector.

What you are showing in the boot.ini is using the next stage in the boot sequence, the code saved from the first sector of the Linux partition. Linux loaders are smart enough to do this chain loading natively, ntldr isn't, so you have to force it using the saved sector.
Remember, to use the boot.ini, the BIOS has already booted the MBR on the Windows disk - so you are looking at later sequences, not the initial boot code.
 
Old 02-02-2017, 04:47 PM   #3
davexnet
LQ Newbie
 
Registered: May 2016
Posts: 28

Original Poster
Rep: Reputation: Disabled
That's fine, I have a legacy system (Bios/MBR).
My plan is to turn on the PC, POST, boot the Grub Loader, and have a menu item pointing to the saved
boot sector I mentioned above(windows XP).
Seems I was not clear in my description.

Can THIS be done?

Perhaps I should give my setup. HD0 has Windows 10 boot loader, Windows 10, Windows XP and the Linux partition.
HD1 contains the Grub loader. When I boot from HD1 I get a choice of booting Linux or Windows 10.

If I select Windows 10, the Windows 10 loader gets control and I can select either Windwos 10 or XP from Windows 10's menu.

I'd like to find a way to boot XP without going through the Windows 10 boot sequence - hence my idea of somehow using the saved XP
boot sector - or can NTLDR be chain-loaded? Then The boot sector becomes moot (I think)

Last edited by davexnet; 02-02-2017 at 05:01 PM.
 
Old 02-02-2017, 05:03 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,740

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
You might be able to chainload that saved boot sector:
Code:
set root=(hd0,2)
chainloader /path/to/file
Or, with a blocklist if you know the sector offset:
Code:
chainloader (hd0,2)27268+1
Whether that boot sector will successfully load the next stage of the bootloader is another question entirely.
 
Old 02-02-2017, 06:36 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,952

Rep: Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073
The XP loader code no longer exists - later installs (of what M$oft call "dual boot") replace the boot code of the currently installed system.
I haven't checked Win10, but it has always been this way.
 
Old 02-02-2017, 06:53 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,740

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
Quote:
Originally Posted by syg00 View Post
The XP loader code no longer exists - later installs (of what M$oft call "dual boot") replace the boot code of the currently installed system.
I haven't checked Win10, but it has always been this way.
I hope you are not saying that chainloading to the partition boot sector on a Windows partition no longer works, because my laptop has been doing exactly that with GRUB chainloading to Windows 7 or Windows 10. Yes, Microsoft has "dual boot," but you don't have to use it. Neither of the Windows partitions on my laptop knows about the other (GRUB is configured to hide the "other" partition).
 
Old 02-02-2017, 07:01 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,952

Rep: Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073
Sorry, that was a bit too generalised.
A standard (second) install used to always force the dual boot setup. I suspect the OP didn't take steps to avoid that happening.
 
Old 02-02-2017, 10:29 PM   #8
davexnet
LQ Newbie
 
Registered: May 2016
Posts: 28

Original Poster
Rep: Reputation: Disabled
(double post)

Last edited by davexnet; 02-02-2017 at 10:40 PM.
 
Old 02-02-2017, 10:40 PM   #9
davexnet
LQ Newbie
 
Registered: May 2016
Posts: 28

Original Poster
Rep: Reputation: Disabled
The XP boot sector still exists, I captured it to a file before Windows 10 was installed. As I mentioned before, it may be moot.

Can't Grub2 chain load to XP's NTLDR directly ? If it could do this, don't even need the saved boot sector.

Let's face it, all the XP boot sector does is pass control to NTLDR
 
Old 02-02-2017, 10:51 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,952

Rep: Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073
Yeah, but it knows what to look for. Same as grub-install can find all the grub code because it knows what to look for to build the block list.
Who know what the structure is on the Windows partition.

If I was feeling real game I might dd that partition sector back, and try to see if osprober will find it. Win10 would then need to be recovered too get a valid boot loader - with the XP partition hidden. Then osprober again.

Your gun, your foot ...
 
Old 02-02-2017, 11:31 PM   #11
davexnet
LQ Newbie
 
Registered: May 2016
Posts: 28

Original Poster
Rep: Reputation: Disabled
I don't really know what you mean, but I'll post some more tomorrow when I can get my Linux system up
and can review grub.cfg

In a dual boot scenario, when Windows 10 is installed, does it save a copy of the XP boot sector?
Then When Widnows 10 is booted and XP is selected from the menu, does Windows 10's BOOTMGR/Winload branch directly to NTLDR ?
Or does it use the saved copy of XP's boot sector?

I don't think there is anything magic about the structure, as soon as the boot sector is executed and the first program is branched to,
by that point everything is referenced by file name. For example, NTLDR calls NTDETECT.COM and BOOT.INI - doesn't matter what physical
disk sector they're in, as long as they're in the same partition in the root directory.
 
Old 02-03-2017, 07:08 AM   #12
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware, Ubuntu
Posts: 10,094

Rep: Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369
I think you're making this more complicated than it needs to be. Grub (Legacy or Grub2) doesn't boot windows directly but rather chainloads which is simply pointing to the specific location of the boot files. So simply putting a simple chainload entry in the grub.cfg file pointing to the win 10 and xp partitions suggested above should suffice. The information which would be needed to post more specific recommendations:

is xp on a primary partition? (I would think so); is win 10 on a primary partition? which partition was marked active/bootable when you installed win 10. Windows will look for the active partition on which to install it's boot files and as far as I know, that still needs to be a primary partition with windows on an MBR install. So if you installed windows 10 while the xp partition was marked active, it has probably overwritten the IPL on the xp partition.

On the HP Desktop I use, I had entries for the win 7 partition as well as the recovery partition both of which would boot fine. When I installed win 10 to a primary partition I marked active, there was no problem booting it as well as win 7 with their chainload entries.

Your question is actually a windows question. Linux Grub has no problem booting different systems with a chainload entry it is how you installed your different windows that is the unknown factor.
 
Old 02-03-2017, 11:49 AM   #13
davexnet
LQ Newbie
 
Registered: May 2016
Posts: 28

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
I think you're making this more complicated than it needs to be. Grub (Legacy or Grub2) doesn't boot windows directly but rather chainloads which is simply pointing to the specific location of the boot files. So simply putting a simple chainload entry in the grub.cfg file pointing to the win 10 and xp partitions suggested above should suffice. The information which would be needed to post more specific recommendations:

is xp on a primary partition? (I would think so); is win 10 on a primary partition? which partition was marked active/bootable when you installed win 10. Windows will look for the active partition on which to install it's boot files and as far as I know, that still needs to be a primary partition with windows on an MBR install. So if you installed windows 10 while the xp partition was marked active, it has probably overwritten the IPL on the xp partition.

On the HP Desktop I use, I had entries for the win 7 partition as well as the recovery partition both of which would boot fine. When I installed win 10 to a primary partition I marked active, there was no problem booting it as well as win 7 with their chainload entries.

Your question is actually a windows question. Linux Grub has no problem booting different systems with a chainload entry it is how you installed your different windows that is the unknown factor.
The HDD contains a single Primary partition. In Windows XP it's marked system and active ("c:"). It contains the Windows 10 boot loader and the XP OS.
A logical drive has partitions for Windows 10 ("k:") and Linux. The Grub loader is installed on the other HDD. Hopefully this will explain the situation .
Here's the Disk Management view
http://www.mediafire.com/view/f8an9p...artitions.JPG#

Am I really making it more complicated that it is? I wish to boot, from the Grub menu, directly to XP bypassing the Windows 10 loader completely

EDIT here is the contents of the current grub.cfg

#
# 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='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
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=10
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=10
fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
insmod png
if background_image /boot/grub/grub-background.png; then
true
else
set menu_color_normal=light-gray/black
set menu_color_highlight=white/red
fi
### END /etc/grub.d/05_debian_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 'Peppermint GNU/Linux' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
linux /boot/vmlinuz-4.4.0-59-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff
initrd /boot/initrd.img-4.4.0-59-generic
}
submenu 'Advanced options for Peppermint GNU/Linux' $menuentry_id_option 'gnulinux-advanced-03a802ba-571d-439b-9335-4b2e64819a58' {
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-59-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-59-generic-advanced-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-59-generic ...'
linux /boot/vmlinuz-4.4.0-59-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-59-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-59-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-59-generic-init-upstart-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-59-generic ...'
linux /boot/vmlinuz-4.4.0-59-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff init=/sbin/upstart
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-59-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-59-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-59-generic-recovery-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-59-generic ...'
linux /boot/vmlinuz-4.4.0-59-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-59-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-57-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-57-generic-advanced-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-57-generic ...'
linux /boot/vmlinuz-4.4.0-57-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-57-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-57-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-57-generic-init-upstart-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-57-generic ...'
linux /boot/vmlinuz-4.4.0-57-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff init=/sbin/upstart
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-57-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-57-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-57-generic-recovery-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-57-generic ...'
linux /boot/vmlinuz-4.4.0-57-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-57-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-53-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-53-generic-advanced-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-53-generic ...'
linux /boot/vmlinuz-4.4.0-53-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-53-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-53-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-53-generic-init-upstart-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-53-generic ...'
linux /boot/vmlinuz-4.4.0-53-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff init=/sbin/upstart
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-53-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-53-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-53-generic-recovery-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-53-generic ...'
linux /boot/vmlinuz-4.4.0-53-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-53-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-47-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-47-generic-advanced-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-47-generic ...'
linux /boot/vmlinuz-4.4.0-47-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-47-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-47-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-47-generic-init-upstart-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-47-generic ...'
linux /boot/vmlinuz-4.4.0-47-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff init=/sbin/upstart
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-47-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-47-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-47-generic-recovery-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-47-generic ...'
linux /boot/vmlinuz-4.4.0-47-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-47-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-24-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-24-generic-advanced-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-24-generic ...'
linux /boot/vmlinuz-4.4.0-24-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-24-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-24-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-24-generic-init-upstart-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-24-generic ...'
linux /boot/vmlinuz-4.4.0-24-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro quiet splash $vt_handoff init=/sbin/upstart
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-24-generic
}
menuentry 'Peppermint GNU/Linux, with Linux 4.4.0-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-24-generic-recovery-03a802ba-571d-439b-9335-4b2e64819a58' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
echo 'Loading Linux 4.4.0-24-generic ...'
linux /boot/vmlinuz-4.4.0-24-generic root=UUID=03a802ba-571d-439b-9335-4b2e64819a58 ro recovery nomodeset
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.4.0-24-generic
}
}

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

### 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='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
knetbsd /boot/memtest86+.elf
}
menuentry 'Memory test (memtest86+, serial console 115200)' {
insmod part_msdos
insmod ext2
set root='hd0,msdos10'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos10 --hint-efi=hd0,msdos10 --hint-baremetal=ahci0,msdos10 03a802ba-571d-439b-9335-4b2e64819a58
else
search --no-floppy --fs-uuid --set=root 03a802ba-571d-439b-9335-4b2e64819a58
fi
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 10 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-DE3C91D93C91AD51' {
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 DE3C91D93C91AD51
else
search --no-floppy --fs-uuid --set=root DE3C91D93C91AD51
fi
parttool ${root} hidden-
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry 'Windows Recovery Environment (loader) (on /dev/sdc1)' --class windows --class os $menuentry_id_option 'osprober-chain-4C61-C232' {
insmod part_msdos
insmod fat
set root='hd2,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 4C61-C232
else
search --no-floppy --fs-uuid --set=root 4C61-C232
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 ###

Last edited by davexnet; 02-03-2017 at 11:59 AM. Reason: grub
 
Old 02-03-2017, 06:23 PM   #14
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware, Ubuntu
Posts: 10,094

Rep: Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369
Quote:
t contains the Windows 10 boot loader and the XP OS.
There's your problem. Boot files for both windows 10 and xp on the same partition. If you want Grub to boot separate instances of windows, you need the boot files on separate partitions. If you had installed windows 10 to another primary partition marked active, you would be able to chainload either system directly from Grub from separate menuentries.

Your Disk Management output shows the windows 10 drive which you indicate is the 'k' drive as a logical partition. In the image you posted it only shows one primary partition but it obviously doesn't show all the partitions as your grub.cfg file shows Peppermint on sda10, so you might be able to create another primary on which to put windows 10 or at least it's boot files. I think you would need to mark it active before using the Custom installation option. That should work but you still have the problem of having the windows 10 boot files on the current xp partition. You could probably delete them but that might cause more problems.

The way you installed with boot files for both xp and 10 on the same partition is the problem. You might do better at a windows forum trying to change the windows boot files. I have no idea how you would go about it, never used xp and don't use any windows much. The way you have it installed, I don't think there is anything Grub can do for you.

Quote:
Am I really making it more complicated that it is? I wish to boot, from the Grub menu, directly to XP bypassing the Windows 10 loader completely
So as to the above question, no you are not making it more complicated than it should be. The complication came about when you installed the windows 10 boot files to the xp partition. I don't know how you could change it now. You might try a windows forum. Good luck.
 
Old 02-03-2017, 06:53 PM   #15
davexnet
LQ Newbie
 
Registered: May 2016
Posts: 28

Original Poster
Rep: Reputation: Disabled
This whole problem came about because of a quirk in my hardware. This causes
a problem in XP if it is booted up initially through the Windows 10 Boot Manager.
If it wasn't for tis I'd be quite happy for grub to boot to Windows 10and to select XP from there.

I did save a copy of the XP boot loader in a file. Of course, my inital idea was to see if Grub
could somehow boot to that file, or chain load to the xp partition, telling to invoke NTLDR.

I'm not going to reinstall it at this stage, I can always use a floppy disk to start XP if I have to.
Thanks for your comments and idea's.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Booting into linux when your boot sector is gone? Avatar Linux - General 23 10-29-2009 10:34 AM
[SOLVED] how can a boot sector be repaired to then allow grub to install for chainload booting james2b Linux - Newbie 20 10-08-2009 09:07 PM
GRUB stage 1.5 on partition boot sector ? Vilius Linux - Software 1 03-02-2009 04:54 PM
help on installing grub on first sector of /boot kirtikjr Linux - Software 1 06-27-2007 04:16 PM
Installed GRUB on MBR or First Sector of boot zillah Fedora 6 06-16-2005 11:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration