Borked MBR - Windows XP!

Hi everyone,

First post here and it’s a doozy :slight_smile:

My other half has a Dell Optiplex 755 with Windows XP on it, and this is her main machine - please don’t judge. She has decided to go the OpenSuse route and after installing into VirtualBox and liking it decided that she’d like the dual boot option, so off she went and did it. Kudos to her for that.

However, while Tumbleweed works very nicely, there is no option for Windows XP in the grub menu and I’ve come to the end of my very limited understanding of Linux to help progress any further.

As it’s a fresh install of Tumbleweed there’s no real concern in losing that if necessary but she can’t afford to lose the windows side as her work is on it. Is the best option to go via a Windows XP install disc and look at recovery options to see if that’ll repair the MBR?

Other salient points:

  • there was no backup made of windows (beyond copying contents of the partition to external hard drive, has anyone got further suggestions?);
  • the partition is visible and can be mounted to view files, but it still isn’t discoverable via os-prober/YAST boot loader;
  • it doesn’t appear to be set up for efi;

On a positive note, she’s very happy using Tumbleweed and I’ve installed it on VirtualBox myself and am quite enjoying it, but we’re both still very new to it, so any guidance would be really appreciated.

Many thanks,

Jes

You have mentioned EFI. Is openSUSE using EFI booting on this system? If so, that would explain the problem.

There is no EFI on a 755. ISTR that putting Windows into the boot menu is something the installer forgets to do, maybe because probe other OS isn’t preselected, or first boot isn’t a real boot but a kexec boot. After an operation that regenerates /boot/grub2/grub.cfg Windows should appear in the boot menu. Check /etc/default/grub to be sure GRUB_DISABLE_OS_PROBER=“true” is not present in it. If it is, remove it or change true to false. If you need to change it, follow that up with sudo grub2-mkconfig -o /boot/grub2/grub.cfg. Following that there should be a Windows selection in the boot menu.

Some time ago GRUB2 changed the default behaviour for os-prober. If GRUB_DISABLE_OS_PROBER is not set to false in /etc/default/grub then os-prober will NOT be run (see here)!

So GRUB_DISABLE_OS_PROBER=“false” is necessary in /etc/default/grub to have os-prober searching for other OSs (e.g. Windows XP) and include them in the boot menu.

Regards

susejunky

General note Linux will not see other OS’s if they use different boot methods. ie legacy/EFI. The openSUSE installer will set boot based on how the Installer is booted. I’d expect XP to us legacy booting but your mileage may vary.

In any case you should be able to select the boot OS in the BIOS/UEFI

In Tumbleweed open YaST -> Boot Loader

Go to tab “Bootloader Options” and look if the tick box “Probe Foreign OS” is set. If not: tick it.

On the same tab under “Default Boot Section” you should be able to choose the default OS, i.e Win XP or TW to boot into if nothing is chosen manually in booting the machine.

Hi Everyone,

Thanks for the responses but having followed all the advice so far, there’s still no sign of Windows.

I’m not there at the moment but will post the config files in a couple of days to see if that highlights any issues.

Thanks for all the suggestions, the support is very much appreciated.

Jes

Well are you sure it is still there??

Show fdisk -l ( lower case L) as root

I believe that if you take pure defaults on install it will use the whole disk thus overwriting XP or other OS

Quoting from the original post:

So if the files are still there it looks like a GRUB / os-prober / overwritten MBR problem (BTW I had a similar problem many years ago with Win-Vista).

If you can see the Windows partition then it is probably mixed boot methods. XP is probably legacy (ie MBR) boot if the hardware supports EFI it may be set to default boot external drives in EFI mode and the installer will then default to install openSUSE in EFI mode which is incompatible with the presumed XP MBR boot mode thus osprober will not see the XP installation. In any case you should be able to boot to any OS via BIOS options

Show us


fdisk -l  ( lower case L) as root
/CODE]

There is no UEFI on a 755, or a 760, or a 780, or a 745. 790 I don’t remember.

Hi All,

Back with an update, though there’s only negative stuff to report so far.

What have I tried?:-

  • Windows XP installation disk on cd - froze after “Press Key to Boot from this CD”
  • Windows XP installation disk on USB - Got to Windows and then BSOD.

So all round not good.

In case it’ll help with insight here is the output from cat /root/grub2/grub.cfg

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


### BEGIN /etc/grub.d/00_header ###
set btrfs_relative_path="y"
export btrfs_relative_path
if  -f ${config_directory}/grubenv ]; then
  load_env -f ${config_directory}/grubenv
elif  -s $prefix/grubenv ]; then
  load_env
fi


if  "${env_block}" ] ; then
  set env_block="(${root})${env_block}"
  export env_block
  load_env -f "${env_block}"
fi


if  "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   if  "${env_block}" ] ; then
     save_env -f "${env_block}" next_entry
   fi
   set boot_once=true
else
   set default="${saved_entry}"
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}"
    if  "${env_block}" ] ; then
      save_env -f "${env_block}" saved_entry
    else
      save_env saved_entry
    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 btrfs
set root='hd0,msdos2'
if  x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f
else
  search --no-floppy --fs-uuid --set=root a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f
fi
    font="/usr/share/grub2/unicode.pf2"
fi


if loadfont $font ; then
  if  "${grub_platform}" = "efi" ]; then
    echo "Please press 't' to show the boot menu on this console"
  fi


  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_input console
terminal_output gfxterm
insmod part_msdos
insmod btrfs
set root='hd0,msdos2'
if  x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f
else
  search --no-floppy --fs-uuid --set=root a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f
fi
insmod gfxmenu
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans-Bold14.pf2
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans10.pf2
loadfont ($root)/boot/grub2/themes/openSUSE/DejaVuSans12.pf2
loadfont ($root)/boot/grub2/themes/openSUSE/ascii.pf2
insmod png
set theme=($root)/boot/grub2/themes/openSUSE/theme.txt
export theme
if  x${boot_once} = xtrue ]; then
  set timeout=0
elif  x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=8
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=8
fi
if  -n "$extra_cmdline" ]; then
  menuentry "Help on bootable snapshot #$snapshot_num" {
    echo "Select the default entry of the snapshot boot menu."
    echo "Examine the snapshot, and if it's OK,"
    echo "   run 'snapper rollback' and reboot."
    echo "See 'System Rollback by Booting from Snapshots'"
    echo "   in the manual for more information."
    echo "  ** Hit Any Key to return to boot menu **  "
    read
  }
fi
### END /etc/grub.d/00_header ###


### BEGIN /etc/grub.d/00_tuned ###
set tuned_params=""
set tuned_initrd=""
### END /etc/grub.d/00_tuned ###


### BEGIN /etc/grub.d/10_linux ###
menuentry 'openSUSE Tumbleweed'  --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod btrfs
	set root='hd0,msdos2'
	if  x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f
	else
	  search --no-floppy --fs-uuid --set=root a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f
	fi
	echo	'Loading Linux 5.16.0-1-default ...'
	linux	/boot/vmlinuz-5.16.0-1-default root=UUID=a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f  ${extra_cmdline} quiet mitigations=auto
	echo	'Loading initial ramdisk ...'
	initrd	/boot/initrd-5.16.0-1-default
}
submenu 'Advanced options for openSUSE Tumbleweed' --hotkey=1 $menuentry_id_option 'gnulinux-advanced-a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f' {
	menuentry 'openSUSE Tumbleweed, with Linux 5.16.0-1-default' --hotkey=2 --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.16.0-1-default-advanced-a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod btrfs
		set root='hd0,msdos2'
		if  x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 --hint='hd0,msdos2'  a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f
		else
		  search --no-floppy --fs-uuid --set=root a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f
		fi
		echo	'Loading Linux 5.16.0-1-default ...'
		linux	/boot/vmlinuz-5.16.0-1-default root=UUID=a0d285c5-b4e3-4ec2-b3d0-00dbf912d59f  ${extra_cmdline} quiet mitigations=auto
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd-5.16.0-1-default
	}
}


### 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+ ###
### END /etc/grub.d/20_memtest86+ ###


### BEGIN /etc/grub.d/30_os-prober ###
### 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 ###


### BEGIN /etc/grub.d/80_suse_btrfs_snapshot ###
btrfs-mount-subvol ($root) /.snapshots @/.snapshots
if  -f "/.snapshots/grub-snapshot.cfg" ]; then
  source "/.snapshots/grub-snapshot.cfg"
fi
### END /etc/grub.d/80_suse_btrfs_snapshot ###


### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###


### BEGIN /etc/grub.d/95_textmode ###
if  "${grub_platform}" = "efi" ]; then
  # On EFI systems we can only have graphics *or* serial, so allow the user
  # to switch between the two
  hiddenentry 'Text mode' --hotkey 't' {
    set textmode=true
    terminal_output console
  }
fi
### END /etc/grub.d/95_textmode ###



and here’s the contents of /etc/default/grub


GRUB_DISABLE_OS_PROBER="false"
GRUB_TERMINAL="gfxterm"
GRUB_TIMEOUT="8"
GRUB_ENABLE_CRYPTODISK="n"
GRUB_GFXMODE="auto"
GRUB_DISABLE_RECOVERY="true"
GRUB_DISTRIBUTOR=
GRUB_DEFAULT="saved"
SUSE_BTRFS_SNAPSHOT_BOOTING="true"
GRUB_THEME="/boot/grub2/themes/openSUSE/theme.txt"
GRUB_HIDDEN_TIMEOUT="0"
GRUB_CMDLINE_LINUX_DEFAULT="quiet mitigations=auto"
GRUB_CMDLINE_XEN_DEFAULT="vga=gfx-1024x768x16"


This is really causing problems now so anything anyone can suggest will be gratefully appreciated.

Thanks,

Jes

755 is a core 2 duo model - probably pre-2011 so on UEFI in BIOS.

If the XP partition is still there - VirtualBox might boot it up.

I would install VirtuaBox and create a Windows XP machine - mount the CD in the virtualbox machine. - There are plenty of VirtualBox how to on youtube. I have a VirtualBox XP machine on my OpenSUSE 15.3 to run some old 16bit windows apps that I like to use - you can mount any folder into the XP machine to move files to/from XP.

Worse case is PM me and I can help you install VirtualBox and Windows XP ( worse case you can clone my XP if your Dell has a Windows Sticker on it - no licensed software on it my image - just freeware).

Teamviewer-suse is your friend - here is how to install it.

add this repo to your repos - then zypper in teamviewer-suse (allow the unsigned and the repo)

llrainey@VM1:/etc/zypp/repos.d> cat teamviewer.repo
[teamviewer]
name=TeamViewer - $basearch
baseurl=https://linux.teamviewer.com/yum/stable/main/binary-$basearch/
gpgkey=https://linux.teamviewer.com/pubkey/currentkey.asc
gpgcheck=1
repo_gpgcheck=1
enabled=1
type=rpm-md[teamviewer]
name=TeamViewer - $basearch
baseurl=https://linux.teamviewer.com/yum/stable/main/binary-$basearch/
gpgkey=https://linux.teamviewer.com/pubkey/currentkey.asc
gpgcheck=1
repo_gpgcheck=1
enabled=1
type=rpm-md

to add repo just cut and paste this into a terminal window:

sudo cat <<EOF > /etc/zypp/repos.d/teamviewer.repo
[teamviewer]
name=TeamViewer - $basearch
baseurl=https://linux.teamviewer.com/yum/stable/main/binary-$basearch/
gpgkey=https://linux.teamviewer.com/pubkey/currentkey.asc
gpgcheck=1
repo_gpgcheck=1
enabled=1
type=rpm-md[teamviewer]
name=TeamViewer - $basearch
baseurl=https://linux.teamviewer.com/yum/stable/main/binary-$basearch/
gpgkey=https://linux.teamviewer.com/pubkey/currentkey.asc
gpgcheck=1
repo_gpgcheck=1
enabled=1
type=rpm-md
EOF

It’s certainly a pre-2010 model, because my Optiplex 760, which does not have UEFI and is the model that replaced OP’s Optiplex 755, was manufactured in June 2009. My Optiplex 745, which is the model that OP’s Optiplex 755 replaced, was manufactured in July 2007, and does not have UEFI. I’m confident if my brother would answer me he would tell me his Optiplex 755 was made in 2008 or early 2009 and does not have UEFI. Thus it’s virtually certain OP’s Optiplex 755 was manufactured in 2008, and equally, does not have UEFI.

755 is a core 2 duo model - probably pre-2011 so no UEFI in BIOS.

That “on” should have been a “no” - fat fingers and error correct did not detect. in the previous post. UEFI was first adapted in 2006 but 2011 is the first year for mass produced UEFI machines. Vista 64 Pro SP1 was the first UEFI OS in January 2009. But Windows 8 in 2012 was the first windows versions that all versions supported UEFI.

My brother’s two 755s were made in May and June 2008 and do not have UEFI. I found in Optiplex 780 BIOS setup and reading the Optiplex 790 owner’s manual that the 790 was the first Optiplex with UEFI.