GC failing to see WinXP

Asked by Nick Fane on 2015-07-29

I have a dual boot installation with WinXP and a recently updated Peppermint Linux (now v6).
When I run GC is simply will not find the WinXP OS - only PM6, so I can no longer boot XP.
All attempts to update it are failing.
Can you point me to things to try - maybe it is documented somewhere, but I can't find it.
Thanks very much

Question information

Language:
English Edit question
Status:
Answered
For:
Grub Customizer Edit question
Assignee:
No assignee Edit question
Last query:
2015-07-31
Last reply:
2015-08-03

This question was reopened

GC should see all the contents of your grub menu. If WinXP wasn't included there, GC won't see it too as it's just running these scripts to get them.

If WinXP isn't visible on GC only, then I have to look into it. In this case I need the output of:

sudo /etc/grub.d/*_os-prober
OR (depends on your GC configuration)
sudo /etc/grub.d/proxifiedScripts/os-prober

And also the information whether you disabled os-prober (in GC: "look for other operating systems")

Nick Fane (nick-xrvasaslqc) said : #2

Dear Daniel
I was searching my own memory for what happened as I was working on several laptops at the same time!
In fact all was originally fine, then I tried a GC tweak to something minor, font size I think, and the somewhere in the save/load to MBR process the laptop locked up and I had to force a shutdown - I suspect that caused something, perhaps in the MBR, to get corrupted. I think that is what happened, I'm not quite sure when it 'went wrong'.

As far as I am aware I have not disabled os-prober, GC is certainly set to look for other Op systems.
BUT I can get nothing from os-prober, the first command line you suggest returns absolutely nothing, I just get the next $ prompt., the second alternative gives 'command not found'.

I suspect that something is wrong in the boot loader, but I am out-of-my depth in knowing how to fix it.
I found some vague references to "bootrec /fixboot" - but maybe you can give me some more detailed guidance?

Many thanks for any help

Nick Fane (nick-xrvasaslqc) said : #3

Thanks Daniel Richter, that solved my question.

Nick Fane (nick-xrvasaslqc) said : #4

sorry, seem to keep marking this as solve - unintentionally!

Manfred Hampl (m-hampl) said : #5

What is the output of

ls -l /etc/grub.d/*os-prober /etc/grub.d/proxifiedScripts/os-prober

and

sudo update-grub

?

Nick Fane (nick-xrvasaslqc) said : #6

The first command line: no such file or directory

sudo update-grub:
Generating grub configuration file ...
using custom appearance settings
Found background image: /home/user-1/Templates/W-M-GRUBscreenBG.png
Found linux image: /boot/vmlinuz-3.16.0-45-generic
Found initrd image: /boot/initrd.img-3.16.0-45-generic
Found linux image: /boot/vmlinuz-3.16.0-37-generic
Found initrd image: /boot/initrd.img-3.16.0-37-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin

Might that have fixed something?

Again, I need the output of:

sudo /etc/grub.d/*_os-prober
OR (depends on your GC configuration)
sudo /etc/grub.d/proxifiedScripts/os-prober

Manfred Hampl (m-hampl) said : #8

It seems that the script that is responsible to add lines for other operating systems into the grub menu is missing on your system.

what is the output of the commands (I hope they exist also on Peppermint the same way they are on Ubuntu)

uname -a
lsb_release -crid
dpkg -l | grep grub
apt-cache policy grub grub-pc grub-common
ls -l /etc/grub.d

Nick Fane (nick-xrvasaslqc) said : #9

Hi
By the way the machine name is Worcester-3
uname -a
Linux Worcester-3 3.16.0-45-generic #60~14.04.1-Ubuntu SMP Fri Jul 24 21:17:05 UTC 2015 i686 i686 i686 GNU/Linux

lsb_release -crid
Distributor ID: Peppermint
Description: Peppermint Six
Release: 6
Codename: trusty

dpkg -l | grep grub
ii grub-common 2.02~beta2-9ubuntu1.3 i386 GRand Unified Bootloader (common files)
ii grub-customizer 4.0.6-0ubuntu1~ppa1t i386 Grub Customizer - A graphical Grub2/BURG configuration application
ii grub-gfxpayload-lists 0.6 i386 GRUB gfxpayload blacklist
ii grub-pc 2.02~beta2-9ubuntu1.3 i386 GRand Unified Bootloader, version 2 (PC/BIOS version)
ii grub-pc-bin 2.02~beta2-9ubuntu1.3 i386 GRand Unified Bootloader, version 2 (PC/BIOS binaries)
ii grub2-common 2.02~beta2-9ubuntu1.3 i386 GRand Unified Bootloader (common files for version 2)

apt-cache policy grub grub-pc grub-common
grub:
  Installed: (none)
  Candidate: 0.97-29ubuntu66
  Version table:
     0.97-29ubuntu66 0
        500 http://tz.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
grub-pc:
  Installed: 2.02~beta2-9ubuntu1.3
  Candidate: 2.02~beta2-9ubuntu1.3
  Version table:
 *** 2.02~beta2-9ubuntu1.3 0
        500 http://tz.archive.ubuntu.com/ubuntu/ trusty-updates/main i386 Packages
        100 /var/lib/dpkg/status
     2.02~beta2-9 0
        500 http://tz.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
grub-common:
  Installed: 2.02~beta2-9ubuntu1.3
  Candidate: 2.02~beta2-9ubuntu1.3
  Version table:
 *** 2.02~beta2-9ubuntu1.3 0
        500 http://tz.archive.ubuntu.com/ubuntu/ trusty-updates/main i386 Packages
        100 /var/lib/dpkg/status
     2.02~beta2-9 0
        500 http://tz.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages

ls -l /etc/grub.d
total 80
-rwxr-xr-x 1 root root 9424 Jun 26 14:18 00_header
-rwxr-xr-x 1 root root 6064 Mei 2 17:45 05_debian_theme
-rwxr-xr-x 1 root root 11608 Apr 11 2014 10_linux
-rwxr-xr-x 1 root root 10412 Apr 11 2014 20_linux_xen
-rwxr-xr-x 1 root root 1992 Mac 12 2014 20_memtest86+
-rwxr-xr-x 1 root root 11692 Apr 11 2014 30_os-prober
-rwxr-xr-x 1 root root 1416 Apr 11 2014 30_uefi-firmware
-rwxr-xr-x 1 root root 214 Apr 11 2014 40_custom
-rwxr-xr-x 1 root root 216 Apr 11 2014 41_custom
drwxr-xr-x 4 root root 4096 Jul 27 23:27 backup
-rw-r--r-- 1 root root 483 Apr 11 2014 README

I hope that helps you!

The plot thickens - I have just loaded PM6 onto another (similar) laptop, set up GC in much the same way - all fine.
PM then did some updating online, and although the boot screen does still gives me both OS options, if I go into PM6 and open GC the menu there no longer shows WinXP - so no doubt if I saved/installed a revision to GC I would have the same problem. I hope that provides some better clues; I did say that a minor update to GC caused the original problem - now we can see a bit of what is happening.

Manfred Hampl (m-hampl) said : #10

This is a bit strange:

in response #6 the command ls -l /etc/grub.d/*os-prober /etc/grub.d/proxifiedScripts/os-prober gave "no such file or directory", but now in response #9 there is a file 30_os-prober in /etc/grub.d

What is the output of

sudo /etc/grub.d/30_os-prober

?

Nick Fane (nick-xrvasaslqc) said : #11

Sorry to be slow responding, I was out!

sudo /etc/grub.d/30_os-prober asks for a password but then produces absolutely nothing.
I have tried it on the other laptop I mentioned in #9, no response there either.

I re-checked the other response and can confirm again 'no such file or directory'

Sorry! I hope you have some clue as to what is happening.

Please show the file content of os-prober. Maybe it's damaged…

Nick Fane (nick-xrvasaslqc) said : #13

Sorry, I need slightly more explanation of how to do that.

Just use a text editor to open /etc/grub.d/30_os-prober or run

cat etc/grub.d/30_os-prober

Edit:

cat /etc/grub.d/30_os-prober

Nick Fane (nick-xrvasaslqc) said : #16

I've left out the comment lines to save space here!

prefix="/usr"
exec_prefix="/usr"
datarootdir="/usr/share"
quick_boot="1"

export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"

. "${datarootdir}/grub/grub-mkconfig_lib"

found_other_os=

adjust_timeout () {
  if [ "$quick_boot" = 1 ] && [ "x${found_other_os}" != "x" ]; then
    cat << EOF
set timeout_style=menu
if [ "\${timeout}" = 0 ]; then
  set timeout=10
fi
EOF
  fi
}

if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
  exit 0
fi

if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
  # missing os-prober and/or linux-boot-prober
  exit 0
fi

OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
if [ -z "${OSPROBED}" ] ; then
  # empty os-prober output, nothing doing
  exit 0
fi

osx_entry() {
    found_other_os=1
    if [ x$2 = x32 ]; then
        # TRANSLATORS: it refers to kernel architecture (32-bit)
 bitstr="$(gettext "(32-bit)")"
    else
        # TRANSLATORS: it refers to kernel architecture (64-bit)
 bitstr="$(gettext "(64-bit)")"
    fi
    # TRANSLATORS: it refers on the OS residing on device %s
    onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
        cat << EOF
menuentry '$(echo "${LONGNAME} $bitstr $onstr" | grub_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(grub_get_device_id "${DEVICE}")' {
EOF
 save_default_entry | grub_add_tab
 prepare_grub_to_access_device ${DEVICE} | grub_add_tab
 cat << EOF
        load_video
        set do_resume=0
        if [ /var/vm/sleepimage -nt10 / ]; then
           if xnu_resume /var/vm/sleepimage; then
             set do_resume=1
           fi
        fi
        if [ \$do_resume = 0 ]; then
           xnu_uuid ${OSXUUID} uuid
           if [ -f /Extra/DSDT.aml ]; then
              acpi -e /Extra/DSDT.aml
           fi
           if [ /kernelcache -nt /System/Library/Extensions ]; then
              $1 /kernelcache boot-uuid=\${uuid} rd=*uuid
           else
              $1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
              if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
                xnu_mkext /System/Library/Extensions.mkext
              else
                xnu_kextdir /System/Library/Extensions
              fi
           fi
           if [ -f /Extra/Extensions.mkext ]; then
              xnu_mkext /Extra/Extensions.mkext
           fi
           if [ -d /Extra/Extensions ]; then
              xnu_kextdir /Extra/Extensions
           fi
           if [ -f /Extra/devprop.bin ]; then
              xnu_devprop_load /Extra/devprop.bin
           fi
           if [ -f /Extra/splash.jpg ]; then
              insmod jpeg
              xnu_splash /Extra/splash.jpg
           fi
           if [ -f /Extra/splash.png ]; then
              insmod png
              xnu_splash /Extra/splash.png
           fi
           if [ -f /Extra/splash.tga ]; then
              insmod tga
              xnu_splash /Extra/splash.tga
           fi
        fi
}
EOF
}

used_osprober_linux_ids=

wubi=

for OS in ${OSPROBED} ; do
  DEVICE="`echo ${OS} | cut -d ':' -f 1`"
  LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
  LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
  BOOT="`echo ${OS} | cut -d ':' -f 4`"
  if UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`"; then
    EXPUUID="$UUID"

    if [ x"${DEVICE#*@}" != x ] ; then
      EXPUUID="${EXPUUID}@${DEVICE#*@}"
    fi

    if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" -a "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then
      echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2
      continue
    fi
  fi

  BTRFS="`echo ${OS} | cut -d ':' -f 5`"
  if [ "x$BTRFS" = "xbtrfs" ]; then
 BTRFSuuid="`echo ${OS} | cut -d ':' -f 6`"
 BTRFSsubvol="`echo ${OS} | cut -d ':' -f 7`"
  fi

  if [ -z "${LONGNAME}" ] ; then
    LONGNAME="${LABEL}"
  fi

  gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2

  case ${BOOT} in
    chain)

      case ${LONGNAME} in
 Windows*)
   if [ -z "$wubi" ]; then
     if [ -x /usr/share/lupin-support/grub-mkimage ] && \
        /usr/share/lupin-support/grub-mkimage --test; then
       wubi=yes
     else
       wubi=no
     fi
   fi
   if [ "$wubi" = yes ]; then
     echo "Skipping ${LONGNAME} on Wubi system" >&2
     continue
   fi
   ;;
      esac

      found_other_os=1
   onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
      cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
EOF
      save_default_entry | grub_add_tab
      prepare_grub_to_access_device ${DEVICE} | grub_add_tab

      if [ x"`${grub_probe} --device ${DEVICE} --target=partmap`" = xmsdos ]; then
   cat << EOF
 parttool \${root} hidden-
EOF
      fi

      case ${LONGNAME} in
 Windows\ Vista*|Windows\ 7*|Windows\ Server\ 2008*)
 ;;
 *)
   cat << EOF
 drivemap -s (hd0) \${root}
EOF
 ;;
      esac

      cat <<EOF
 chainloader +1
}
EOF
    ;;
    efi)

 found_other_os=1
 EFIPATH=${DEVICE#*@}
 DEVICE=${DEVICE%@*}
 onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
      cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-efi-$(grub_get_device_id "${DEVICE}")' {
EOF
      save_default_entry | sed -e "s/^/\t/"
      prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"

      cat <<EOF
 chainloader ${EFIPATH}
}
EOF
    ;;
    linux)
      if [ "x$BTRFS" = "xbtrfs" ]; then
         LINUXPROBED="`linux-boot-prober btrfs ${BTRFSuuid} ${BTRFSsubvol} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
      else
         LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
      fi
      prepare_boot_cache=
      boot_device_id=
      is_top_level=true
      title_correction_code=
      OS="${LONGNAME}"

      for LINUX in ${LINUXPROBED} ; do
        LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
        LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
        LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
        LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
        LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
        LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"

        if [ -z "${LLABEL}" ] ; then
          LLABEL="${LONGNAME}"
        fi

 if [ "${LROOT}" != "${LBOOT}" ]; then
   LKERNEL="${LKERNEL#/boot}"
   LINITRD="${LINITRD#/boot}"
 fi

 if [ -z "${prepare_boot_cache}" ]; then
   prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | grub_add_tab)"
   [ "${prepare_boot_cache}" ] || continue
 fi

 found_other_os=1
 onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
 recovery_params="$(echo "${LPARAMS}" | grep 'single\|recovery')" || true
 counter=1
 while echo "$used_osprober_linux_ids" | grep 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id' > /dev/null; do
     counter=$((counter+1));
 done
 if [ -z "$boot_device_id" ]; then
     boot_device_id="$(grub_get_device_id "${DEVICE}")"
 fi
 used_osprober_linux_ids="$used_osprober_linux_ids 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id'"

 if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
            cat << EOF
menuentry '$(echo "$OS $onstr" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
EOF
     save_default_entry | grub_add_tab
     printf '%s\n' "${prepare_boot_cache}"
     cat << EOF
 linux ${LKERNEL} ${LPARAMS}
EOF
            if [ -n "${LINITRD}" ] ; then
          cat << EOF
 initrd ${LINITRD}
EOF
            fi
        cat << EOF
}
EOF
     echo "submenu '$(gettext_printf "Advanced options for %s" "${OS} $onstr" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {"
     is_top_level=false
 fi
 title="${LLABEL} $onstr"
        cat << EOF
 menuentry '$(echo "$title" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-$LKERNEL-${recovery_params}-$boot_device_id' {
EOF
 save_default_entry | sed -e "s/^/$grub_tab$grub_tab/"
 printf '%s\n' "${prepare_boot_cache}" | grub_add_tab
 cat << EOF
  linux ${LKERNEL} ${LPARAMS}
EOF
        if [ -n "${LINITRD}" ] ; then
            cat << EOF
  initrd ${LINITRD}
EOF
        fi
        cat << EOF
 }
EOF
 if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then
     replacement_title="$(echo "Advanced options for ${OS} $onstr" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')"
     quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)"
     title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;"
     grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")"
 fi
      done
      if [ x"$is_top_level" != xtrue ]; then
   echo '}'
      fi
      echo "$title_correction_code"
    ;;
    macosx)
      if [ "${UUID}" ]; then
 OSXUUID="${UUID}"
 osx_entry xnu_kernel 32
 osx_entry xnu_kernel64 64
      fi
    ;;
    hurd)
      found_other_os=1
      onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
      cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class hurd --class gnu --class os \$menuentry_id_option 'osprober-gnuhurd-/boot/gnumach.gz-false-$(grub_get_device_id "${DEVICE}")' {
EOF
      save_default_entry | grub_add_tab
      prepare_grub_to_access_device ${DEVICE} | grub_add_tab
      grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
      mach_device="`echo "${grub_device}" | sed -e 's/(\(hd.*\),msdos\(.*\))/\1s\2/'`"
      grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
      case "${grub_fs}" in
 *fs) hurd_fs="${grub_fs}" ;;
 *) hurd_fs="${grub_fs}fs" ;;
      esac
      cat << EOF
 multiboot /boot/gnumach.gz root=device:${mach_device}
 module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
   --multiboot-command-line='\${kernel-command-line}' \\
   --host-priv-port='\${host-port}' \\
   --device-master-port='\${device-port}' \\
   --exec-server-task='\${exec-task}' -T typed '\${root}' \\
   '\$(task-create)' '\$(task-resume)'
 module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
}
EOF
    ;;
    minix)
   cat << EOF
menuentry "${LONGNAME} (on ${DEVICE}, Multiboot)" {
EOF
         save_default_entry | sed -e "s/^/\t/"
         prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
  cat << EOF
 multiboot /boot/image_latest
}
EOF
    ;;
    *)
      echo -n " "
      # TRANSLATORS: %s is replaced by OS name.
      gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2
    ;;
  esac
done

adjust_timeout

The file seems to be ok.

I think your windows bootloader is broken somehow.

Is it possible to view the file system contents? (Just click the windows partition on the left pane after opening the file manager)

If this works:

Please add a chainloader to the grub list, pointing to your windows partition. You can do this from grub customizer using the "add" button. Choose chainloader as type. Then boot from this new menuentry and report whether there's an error.

Nick Fane (nick-xrvasaslqc) said : #18

That worked - I now have a WinXP boot option again, and yes it does boot Win correctly!
Well done and thank you.

Is that a complete and permanent solution?

Then, I'll need to try the same solution with the other laptop, but I guess it is likely to work.

Have you any idea why the PM6 software update process seems to be breaking the bootloader?

Hmm... ok, interesting. I think there's no problem using this solution. The new menuentry just wont be updated automatically when you'll delete winXP or move it to another partition. However I think this task is rarely done ;-)

Why it isn't automatically detected anymore? There could be multiple reasons. 1. You damaged any file which is required from os-prober (there's a really deep dependecy tree) when forcing the shutdown. 2. The newer version of os-prober isn't compatible to winXP (possible since winXP isn't supported anymore, but don't know).

Nick Fane (nick-xrvasaslqc) said : #20

Hi Daniel
The 'forced shutdown' is probably not relevant - as the second laptop updated without any such issues.

I have just tried: sudo /etc/grub.d/30_os-prober on that second laptop (having checked that file exists!) - it produces no output at all.

I fear that some update of grub (???) from the peppermint updater may have broken os-prober.
Are there other things I could try to narrow-down the problem?

I expect to install PM6 on some more laptops shortly - it will be interesting to see if I get more problems.
As far as I am aware, no such problems have shown up on earlier versions of PM.

I will not be able to respond again until the end of the week.
Regards, Nick

If you can reproduce the problem without using grub customizer, then you should ask the developers of grub 2 or your distribution.

Can you help with this problem?

Provide an answer of your own, or ask Nick Fane for more information if necessary.

To post a message you must log in.