3

I saw Dual boot - Installed arch and windows entry disappeared on grub and I have the same/similar problem. I have Grub and it shows only Debian setup and not MS-Windows. I also tried the following but without success -

[$] sudo grub-install /dev/sda
[sudo] password for shirish:
Installing for i386-pc platform.
Installation finished. No error reported.

Then -

[$] sudo grub-mkconfig -o /boot/grub/grub.cfg                                                                                       
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
D000001: cmpversions a='0:4.9.0-2-amd64' b='0:4.9.0-1-amd64' r=1
Found linux image: /boot/vmlinuz-4.9.0-2-amd64
Found initrd image: /boot/initrd.img-4.9.0-2-amd64
Found linux image: /boot/vmlinuz-4.9.0-1-amd64
Found initrd image: /boot/initrd.img-4.9.0-1-amd64
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Found GRUB Invaders image: /boot/invaders.exec
done

The above tells me it isn't able to find the MS-Windows partition.

Here's the output from parted -l -

l: ATA ST1000DM003-9YN1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system     Flags
 1      32.3kB  52.4GB  52.4GB  primary   ntfs
 2      52.4GB  1000GB  948GB   extended                  lba
 5      52.4GB  105GB   52.4GB  logical   ntfs
 6      105GB   305GB   200GB   logical   ext4            boot
 7      305GB   405GB   100GB   logical   ext4
 8      405GB   995GB   590GB   logical   ext4
 9      995GB   1000GB  5348MB  logical   linux-swap(v1)


Model: Seagate BUP Slim BK (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  2000GB  2000GB  primary  ntfs


and then lsblk output - 

[$] sudo lsblk -f                                                                                                                   
NAME   FSTYPE  LABEL               UUID                                 MOUNTPOINT
sda                                                                     
├─sda1 ntfs    WIN                 xxxxxxxxxxxxxxxxxxxx                     
├─sda2                                                                  
├─sda5 ntfs    Data                xxxxxxxxxxxxxxxxxxxx                     
├─sda6 ext4                        xxxxxxxxxxxxxxxxxxxx /
├─sda7 ext4                        xxxxxxxxxxxxxxxxxxxx /home
├─sda8 ext4                        xxxxxxxxxxxxxxxxxxxx/data
└─sda9 swap                        xxxxxxxxxxxxxxxxxxxx [SWAP]
sdb    iso9660 ISOIMAGE            2015-06-04-16-30-00-00               
└─sdb1 ntfs    Seagate-Slim-Backup xxxxxxxxxxxxxxxxxxxx                     /media/shirish/Seagate-Slim-Backup
sr0      

I haven't shared UUID info. for safety and privacy concerns.

My /boot/grub/grub.cfg makes no mention of any MS-Windows

[$] cat 
[$]

How do I get the MS-Windows again on the menu ?

I even tried osprober but no avail :(

[$] cat /usr/share/doc/os-prober/README

I even tried os-prober readme -

$ sudo cat /usr/share/doc/os-prober | grep 

$

I even tried the README but to no avail, from the README 0

Tests that require the partition to be mounted can be placed in
    30  /usr/lib/os-probes/mounted/. These tests are passed the following
    31  parameters: partition, mount point, filesystem.


 $ sudo mount /dev/sda1 /usr/lib/os-probes/mounted/

and tried things like -

[$] sudo os-prober partition /dev/sda1 /usr/lib/os-probes/mounted/
    [sudo] password for shirish: 
[$]

Then I ran os-prober as sudo -

[$] sudo os-prober

and then ran -

┌─[shirish@debian] - [/boot] - [10119]
└─[$] sudo grub-mkconfig -o /boot/grub/grub.cfg                                                                                       
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.9.0-2-amd64
Found initrd image: /boot/initrd.img-4.9.0-2-amd64
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Found GRUB Invaders image: /boot/invaders.exec
done

As can be seen it doesn't find the MS-Windows partition, is it lost forever or there may be a way out ?

Sadly had to unmount it :(

[$] sudo umount /usr/lib/os-probes/mounted/
[$] 

All out of ideas, it seems that Windows bootloader is all shot otherwise we should have had some output ?

This is how it looks in /etc/grub.d/40_custom after GAD3R's sharing -

#!/bin/sh
    exec tail -n +3 $0
# 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.
menuentry "Windows" {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    chainloader +1
    }

After putting GAD3R's suggestions I get -

[$] cat /etc/default/grub | grep GRUB_DISABLE_OS_PROBER                                                                            
    11  GRUB_DISABLE_OS_PROBER=false

and running update-grub I get the following -

[$] sudo update-grub                                                                                                               
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.9.0-2-amd64
Found initrd image: /boot/initrd.img-4.9.0-2-amd64
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Found GRUB Invaders image: /boot/invaders.exec

No change, so something is still amiss :(

  • Mount windows partition , run os-prober command then regenerate grub.cfg with grub-mkconfig .... – GAD3R Mar 9 '17 at 17:12
  • @GAD3R so sorry, I had actually done that but forgot to share that bit, now have edited it and showed what happened, any ideas ? – shirish Mar 9 '17 at 19:26
  • 1
    @GAD3R could you put your earlier answer again, the one in which you shared in /etc/grub.d/40_custom, apparently this is correct. It took the system a few days but now have the windows xp entry. – shirish Mar 17 '17 at 0:06
0

Edit your /etc/grub.d/40_custom as follows:

menuentry "Windows" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos1)'
chainloader +1
}

Add the following line to your /etc/default/grub :

GRUB_DISABLE_OS_PROBER=false

Run:

update-grub
  • I have updated my question with what you shared, the output isn't coming as expected. Any ideas ? – shirish Mar 10 '17 at 16:35
  • @shirish witch version of windows ? – GAD3R Mar 10 '17 at 16:46
  • (sheepishly) MS-Windows XP SP2, sorry for not sharing that before. – shirish Mar 10 '17 at 16:46
  • @shirish Try to boot using supergrubdisk (iso= 20M) from an USB bootable , use the command dd to create it ,the windows should be detect . Then i will edit my answer or remove it – GAD3R Mar 10 '17 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.