Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Erased windows boot loader

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
DaveA
Posts: 8
Joined: 2018-06-29 11:36

Erased windows boot loader

#1 Post by DaveA »

I have a dual disk system with Windows10 on one drive (sda1). I installed Debian on the second drive (sdb1). It asked where the boot loader should be placed and I entered sda1, assuming it would include both Windows and Debian as the BIOS is set to boot from the first (Windows) drive. Unfortunately, I can now only see Debian, which boots and runs, but I cannot now load Windows, which I had expected Grub to provide as an option.
I have tried the Microsoft recovery tool and the ubuntu recovery tool but cannot recover the Windows boot loader. I can see all my Windows files so I believe my Windows system is untouched apart from the boot loader. Is this recoverable?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Erased windows boot loader

#2 Post by p.H »

Is this an EFI or BIOS/legacy boot setup ? The installer asking where the boot loader should be placed suggests BIOS/legacy.
What is the output of os-prober (as root) ?
Can you install the package boot-info-script, run bootinfoscript (as root) and post the report ?

I am surprised that GRUB accepted to install its boot image in a DOS/NTFS partition boot sector on an disk other than the one which contains /boot/grub.

Avoid using automatic recovery tools without knowing what's going on, this may just make things worse.

DaveA
Posts: 8
Joined: 2018-06-29 11:36

Re: Erased windows boot loader

#3 Post by DaveA »

I am fairly cerain it is a BIOS legacy boot as (1) The BIOS is still set to legacy MBR and it booted Windows10 OK before the Debian installation and (2) The windows recovery tool with diskpart, list disk, does not show an asterisk in the GPT column.

os-prober runs and returns but give no output
I tried to attach the bootinfoscript but it does not seem possible to attach .txt files or files with no extension, so I have pasted it into the text below - apologies.

I also installed ubuntu on sdb2 to run the recovery tool, but got the same problem. I don't believe I have touched sda1 (the Windows10 drive) at all, apart from Debian corrupting the MBR. I can see all my Windows10 folders and files from ubuntu, so I am reasonably confident my Windows system is intact.

I would prefer to install a valid grub that sees Windows and Debian or alternatively, recover the Windows MBR and then look at ways to have a dual-boot dual-drive Windows/Debian system. I prefer Debian to ubuntu because I do a lot of C programming and its a good platform for my work. Although my Windows files were backed up prior to the Debian installation, it would be a lot of work to resurrect all the tools and packages etc.

Thanks for your help.
==========
Boot Info Script 0.78 [09 October 2019]


============================= Boot Info Summary: ===============================

=> Grub2 (v2.00) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
for /boot/grub. It also embeds following components:

modules
---------------------------------------------------------------------------
fshelp ext2 part_msdos biosdisk search_fs_uuid
---------------------------------------------------------------------------

config script
---------------------------------------------------------------------------
search.fs_uuid 94ef6ea0-337c-4200-9e9b-d80986f75114 root hd1,msdos5
set prefix=($root)'/boot/grub'

---------------------------------------------------------------------------
=> Windows 7/8/2012 is installed in the MBR of /dev/sdb.

sda1: __________________________________________________________________________

File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files: /Boot/BCD /Windows/System32/winload.exe

sda2: __________________________________________________________________________

File system: ntfs
Boot sector type: Windows 8/2012: NTFS
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:

sdb1: __________________________________________________________________________

File system: vfat
Boot sector type: FAT32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:

sdb2: __________________________________________________________________________

File system: Extended Partition
Boot sector type: Unknown
Boot sector info:

sdb5: __________________________________________________________________________

File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 20.04.2 LTS
Boot files: /boot/grub/grub.cfg /etc/fstab
/boot/grub/i386-pc/core.img

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: TOSHIBA DT01ACA0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sda1 * 2,048 975,689,589 975,687,542 7 NTFS / exFAT / HPFS
/dev/sda2 975,689,728 976,769,023 1,079,296 27 Hidden NTFS (Recovery Environment)


Drive: sdb _____________________________________________________________________
Disk /dev/sdb: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM002-1BD14
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Partition Boot Start Sector End Sector # of Sectors Id System

/dev/sdb1 2,048 1,050,623 1,048,576 b W95 FAT32
/dev/sdb2 1,052,670 976,771,071 975,718,402 5 Extended
/dev/sdb5 * 1,052,672 976,771,071 975,718,400 83 Linux


"blkid" output: ________________________________________________________________

Device UUID TYPE LABEL

/dev/loop0 squashfs
/dev/loop1 squashfs
/dev/loop2 squashfs
/dev/loop3 squashfs
/dev/loop4 squashfs
/dev/loop5 squashfs
/dev/loop6 squashfs
/dev/loop7 squashfs
/dev/loop8 squashfs
/dev/loop9 squashfs
/dev/sda1 204456204455F94C ntfs
/dev/sda2 FE5A89015A88B843 ntfs
/dev/sdb1 E5AC-7F1C vfat
/dev/sdb5 94ef6ea0-337c-4200-9e9b-d80986f75114 ext4

========================= "ls -l /dev/disk/by-id" output: ======================

total 0
lrwxrwxrwx 1 root root 9 Jun 25 18:23 ata-PLDS_DVD+_-RW_DH-16AES_FY13D7363943H50IYA00 -> ../../sr0
lrwxrwxrwx 1 root root 9 Jun 25 18:23 ata-ST500DM002-1BD142_Z3T7LE7S -> ../../sdb
lrwxrwxrwx 1 root root 10 Jun 25 18:24 ata-ST500DM002-1BD142_Z3T7LE7S-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 25 18:24 ata-ST500DM002-1BD142_Z3T7LE7S-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Jun 25 18:24 ata-ST500DM002-1BD142_Z3T7LE7S-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 9 Jun 25 18:23 ata-TOSHIBA_DT01ACA050_28NBYKAAS -> ../../sda
lrwxrwxrwx 1 root root 10 Jun 25 18:24 ata-TOSHIBA_DT01ACA050_28NBYKAAS-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 25 18:24 ata-TOSHIBA_DT01ACA050_28NBYKAAS-part2 -> ../../sda2
lrwxrwxrwx 1 root root 9 Jun 25 18:23 wwn-0x5000039fd2efb58e -> ../../sda
lrwxrwxrwx 1 root root 10 Jun 25 18:24 wwn-0x5000039fd2efb58e-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 25 18:24 wwn-0x5000039fd2efb58e-part2 -> ../../sda2
lrwxrwxrwx 1 root root 9 Jun 25 18:23 wwn-0x5000c5004ed5e232 -> ../../sdb
lrwxrwxrwx 1 root root 10 Jun 25 18:24 wwn-0x5000c5004ed5e232-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 25 18:24 wwn-0x5000c5004ed5e232-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Jun 25 18:24 wwn-0x5000c5004ed5e232-part5 -> ../../sdb5

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/sdb5 / ext4 (rw,relatime,errors=remount-ro)


=========================== sdb5/boot/grub/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 [ "${initrdfail}" = 2 ]; then
set initrdfail=
elif [ "${initrdfail}" = 1 ]; then
set next_entry="${prev_entry}"
set prev_entry=
save_env prev_entry
if [ "${next_entry}" ]; then
set initrdfail=2
fi
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 initrdfail {
if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
if [ -z "${initrdfail}" ]; then
set initrdfail=1
if [ -n "${boot_once}" ]; then
set prev_entry="${default}"
save_env prev_entry
fi
fi
save_env initrdfail
fi; 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,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 94ef6ea0-337c-4200-9e9b-d80986f75114
else
search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
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=10
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=hidden
set timeout=10
# Fallback hidden-timeout code in case the timeout_style feature is
# unavailable.
elif sleep --interruptible 10 ; then
set timeout=10
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/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 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-94ef6ea0-337c-4200-9e9b-d80986f75114' {
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='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 94ef6ea0-337c-4200-9e9b-d80986f75114
else
search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
fi
linux /boot/vmlinuz-5.8.0-59-generic root=UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 ro quiet splash $vt_handoff
initrd /boot/initrd.img-5.8.0-59-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-94ef6ea0-337c-4200-9e9b-d80986f75114' {
menuentry 'Ubuntu, with Linux 5.8.0-59-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.8.0-59-generic-advanced-94ef6ea0-337c-4200-9e9b-d80986f75114' {
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='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 94ef6ea0-337c-4200-9e9b-d80986f75114
else
search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
fi
echo 'Loading Linux 5.8.0-59-generic ...'
linux /boot/vmlinuz-5.8.0-59-generic root=UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.8.0-59-generic
}
menuentry 'Ubuntu, with Linux 5.8.0-59-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.8.0-59-generic-recovery-94ef6ea0-337c-4200-9e9b-d80986f75114' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 94ef6ea0-337c-4200-9e9b-d80986f75114
else
search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
fi
echo 'Loading Linux 5.8.0-59-generic ...'
linux /boot/vmlinuz-5.8.0-59-generic root=UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 ro recovery nomodeset dis_ucode_ldr
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.8.0-59-generic
}
menuentry 'Ubuntu, with Linux 5.8.0-43-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.8.0-43-generic-advanced-94ef6ea0-337c-4200-9e9b-d80986f75114' {
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='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 94ef6ea0-337c-4200-9e9b-d80986f75114
else
search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
fi
echo 'Loading Linux 5.8.0-43-generic ...'
linux /boot/vmlinuz-5.8.0-43-generic root=UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 ro quiet splash $vt_handoff
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.8.0-43-generic
}
menuentry 'Ubuntu, with Linux 5.8.0-43-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.8.0-43-generic-recovery-94ef6ea0-337c-4200-9e9b-d80986f75114' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 94ef6ea0-337c-4200-9e9b-d80986f75114
else
search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
fi
echo 'Loading Linux 5.8.0-43-generic ...'
linux /boot/vmlinuz-5.8.0-43-generic root=UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 ro recovery nomodeset dis_ucode_ldr
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-5.8.0-43-generic
}
}

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

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

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

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

### 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 ###
--------------------------------------------------------------------------------

=============================== sdb5/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb5 during installation
UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sdb1 during installation
#UUID=E5AC-7F1C /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
--------------------------------------------------------------------------------

=================== sdb5: Location of files loaded by Grub: ====================

GiB - GB File Fragment(s)

453.754196167 = 487.214858240 boot/grub/grub.cfg 1
322.007350922 = 345.752760320 boot/grub/i386-pc/core.img 1
6.432952881 = 6.907330560 boot/vmlinuz 1
5.432876587 = 5.833506816 boot/vmlinuz-5.8.0-43-generic 1
6.432952881 = 6.907330560 boot/vmlinuz-5.8.0-59-generic 1
5.432876587 = 5.833506816 boot/vmlinuz.old 1
321.575748444 = 345.289330688 boot/initrd.img 1
321.008499146 = 344.680251392 boot/initrd.img-5.8.0-43-generic 3
321.575748444 = 345.289330688 boot/initrd.img-5.8.0-59-generic 1
321.008499146 = 344.680251392 boot/initrd.img.old 3

======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown BootLoader on sdb2

00000000 29 da 35 d1 af dd d5 1b 40 21 7d 7e e9 48 e9 54 |).5.....@!}~.H.T|
00000010 40 da 55 43 83 95 f8 7f fc a0 53 3c 99 4a a7 f4 |@.UC......S<.J..|
00000020 7b b2 5a ae b9 95 84 c8 e0 06 25 1e e4 8b 57 60 |{.Z.......%...W`|
00000030 e1 ac 9f 25 a6 e6 46 59 7a af 0d c8 3f 19 44 48 |...%..FYz...?.DH|
00000040 56 ac 3a e9 30 74 db eb b6 69 e3 e1 16 3a bf 82 |V.:.0t...i...:..|
00000050 59 5b d6 a2 12 46 76 ca aa 73 0d d6 fe 43 cb ba |Y[...Fv..s...C..|
00000060 8e 7d 84 72 47 72 4d 03 13 74 86 da 98 1b 84 e7 |.}.rGrM..t......|
00000070 81 62 63 86 96 a9 05 a5 10 f0 84 9f 29 be 90 86 |.bc.........)...|
00000080 ff 10 91 88 b4 be 65 3e 21 2e 24 62 e7 c6 b4 29 |......e>!.$b...)|
00000090 f2 f7 87 1e 72 b7 65 91 5e 25 c1 b9 9b 4e 0c da |....r.e.^%...N..|
000000a0 d6 bd 12 08 38 d0 bd 0a 43 c4 e3 b5 82 92 8e 3a |....8...C......:|
000000b0 14 e8 44 40 b7 75 78 9f 5e 22 de 78 83 b9 a9 0d |..D@.ux.^".x....|
000000c0 6f 3e cb 21 71 00 d5 d5 91 9b 3a f1 44 83 cd a9 |o>.!q.....:.D...|
000000d0 a0 01 10 35 04 ee 06 15 62 9c b2 d9 ab c3 1d 73 |...5....b......s|
000000e0 24 20 cf e8 e9 be 03 13 42 8c 2c f0 a4 3d 8a d8 |$ ......B.,..=..|
000000f0 1c 26 29 04 1a 15 c8 9f 94 54 cc 1c f3 36 12 a5 |.&)......T...6..|
00000100 a1 1c 4c 5e 12 fb e4 df fa 2a d7 2b 0b 4e 8a 4a |..L^.....*.+.N.J|
00000110 cc 62 40 8f 6a 2a 52 83 69 8f 2f aa b1 55 bd 2c |.b@.j*R.i./..U.,|
00000120 4d 07 71 59 24 81 b2 9d 6e c6 53 9b e9 6c 68 71 |M.qY$...n.S..lhq|
00000130 23 a9 03 26 8f c0 05 d2 a5 f8 de 31 f6 cc a4 6c |#..&.......1...l|
00000140 1b 35 47 5c be a4 e2 32 a9 3f a1 47 f0 f5 6f 67 |.5G\...2.?.G..og|
00000150 36 bc f9 c8 ab 2f 9e 45 77 83 1e 3e b7 b6 80 e1 |6..../.Ew..>....|
00000160 bc bd ea e9 1e 95 8e 6f 7b 24 13 51 7d 59 9c 0e |.......o{$.Q}Y..|
00000170 d0 b6 31 ec 5a c4 2f 7b 8b 70 be 5b 75 0b 82 6f |..1.Z./{.p.[u..o|
00000180 8b e5 bf 55 03 41 33 43 e5 0d 7d b7 81 13 52 71 |...U.A3C..}...Rq|
00000190 90 e2 47 5c b8 ec 70 bd e3 99 f4 44 66 ad a4 a7 |..G\..p....Df...|
000001a0 89 e8 57 ce 11 bb 54 5f 54 20 8a 0a 43 ec 6d 9b |..W...T_T ..C.m.|
000001b0 76 f2 86 a3 28 e4 5d 08 a3 54 82 f5 59 b7 80 fe |v...(.]..T..Y...|
000001c0 c2 ff 83 fe c2 ff 02 00 00 00 00 48 28 3a 00 00 |...........H(:..|
000001d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Erased windows boot loader

#4 Post by p.H »

DaveA wrote:I tried to attach the bootinfoscript but it does not seem possible to attach .txt files or files with no extension, so I have pasted it into the text below
I would not want it as an attachment. But please put it within "code" tags (editing your post) so that it is properly formatted.
DaveA wrote:I also installed ubuntu on sdb2
No, you didn't. The report shows that Ubuntu is installed in /dev/sdb5. You should not have done this. It erased any information about how Debian was installed. Couldn't your run recovery tools from Debian or a live system ? Or even better, not run any recovery tool until you know what is going on.

About the report :
The boot sector in /dev/sda1 does not contains a GRUB boot image. Either you did not install GRUB in /dev/sda1(wasn't it /dev/sda instead ?), or the recovery tools replaced it with a Windows boot sector. GRUB's boot image is present in the MBR of /dev/sdb, but that's Ubuntu's GRUB, so we don't know where you installed Debian's GRUB.

The NTFS filesystem in /dev/sda1 lacks at least one important boot file, /bootmgr, unless Windows 10 uses a different boot scheme from previous versions. Even if you had installed Debian's GRUB in /dev/sda1, it would have modified only the boot sector, not the filesystem itself, nor removed any boot files. The presence of this file is part of Windows detection by os-prober. You can test this :
- Boot GRUB
- At the boot menu, press "c" to start GRUB shell
- type the following command to load and run Windows boot sector :

Code: Select all

set root=hd0,msdos1
chainloader +1
boot
One question : can you explain why there is a FAT partition /dev/sdb1 which looks like an EFI partition and why /etc/fstab contains comments saying that it was mounted on /boot/efi, like an EFI partition would be ?

DaveA
Posts: 8
Joined: 2018-06-29 11:36

Re: Erased windows boot loader

#5 Post by DaveA »

Thanks - I accept your criticism and have no idea about the answers to your "one question".

About 2 years ago I bought a second disk and installed Debian as a dual boot, which worked well. About 18 months ago, a Debian upgrade lost the Windows boot in grub. I re-installed Windows10 and did not nother with Debian on the 2nd drive. This week, I decided to install Debian on my second drive. I carefully went through the installation. When it asked about the grub loader, I gave sda. When I rebooted, all I could see was Debian but no Windows. I don't think Linux should obliterate bona fide OS boot managers. It asked for my confirmation.

Now I have a problem. Do I simply re-install Windows (yet again) or can I recover the windows boot? If I can get back to Windows, that would be really helpful. I have used Unix/Linux since 1975 but if Linux is going to cause me lots of problems, I will stick with Windows and msys2 for C and OpenGL. I simply asked for help - can I recover my Windows boot?

Best regards, Dave

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

Re: Erased windows boot loader

#6 Post by bester69 »

DaveA wrote:Thanks - I accept your criticism and have no idea about the answers to your "one question".

About 2 years ago I bought a second disk and installed Debian as a dual boot, which worked well. About 18 months ago, a Debian upgrade lost the Windows boot in grub. I re-installed Windows10 and did not nother with Debian on the 2nd drive. This week, I decided to install Debian on my second drive. I carefully went through the installation. When it asked about the grub loader, I gave sda. When I rebooted, all I could see was Debian but no Windows. I don't think Linux should obliterate bona fide OS boot managers. It asked for my confirmation.

Now I have a problem. Do I simply re-install Windows (yet again) or can I recover the windows boot? If I can get back to Windows, that would be really helpful. I have used Unix/Linux since 1975 but if Linux is going to cause me lots of problems, I will stick with Windows and msys2 for C and OpenGL. I simply asked for help - can I recover my Windows boot?

Best regards, Dave
try this template for manual booting:
edit:
/etc/grub.d/40_custom


menuentry 'Microsoft Windows 10' --class windows {
insmod part_msdos
insmod ntfs
insmod ntldr
search --set=root --label dvd10 --hint hd0,msdos3
drivemap -s (hd0) ${root}
ntldr /bootmgr
}

- then you have to replace label (dvd10)with the windows label gparted shows you
- hd0 stay like that if you0re using only one disk
- msdos3 , replaced with number of windows partition (msdos1 if its first one)

and then , update-grub, and that should work
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Erased windows boot loader

#7 Post by p.H »

DaveA wrote:When it asked about the grub loader, I gave sda
In your original post you said sda1. However in either case that could not delete files in sda1.
DaveA wrote:I don't think Linux should obliterate bona fide OS boot managers.
If you ask to install GRUB in a given location, it will erase any previous boot loader (or at least the part of it) which was in this location. This is unavoidable. But Windows boot sectors are not required to detect and boot Windows from GRUB.
DaveA wrote:Do I simply re-install Windows (yet again) or can I recover the windows boot?
I cannot help you recovering Windows 10 boot, since I never used this version. With previous versions, booting from a Windows installer media and select repair allowed to fix boot issues, but I don't know if this is still valid with Windows 10. You may get more efficient help in Windows users communities.
bester69 wrote:ntldr /bootmgr
This won't help if bootmgr is not present at the root of the Windows partition. bootinfoscript did not report it. Maybe it's wrong and it is worth checking directly.

DaveA
Posts: 8
Joined: 2018-06-29 11:36

Re: Erased windows boot loader

#8 Post by DaveA »

Thanks for the suggestions. I realised that the boot partition is on the 2nd drive, so I reformatted it as a FAT32 partition and ran bootrec /BuildBCD from the Windows recovery disk, so I can now boot Windows without Grub.

I would still like to install Debian on my 2nd drive as a dual-boot system. Are there are guidelines for this, in particular to avoid the problem I encountered losing the Windows boot?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Erased windows boot loader

#9 Post by p.H »

Do you mean that
- Windows is installed on sda but its boot partition is on sdb
- and Ubuntu is installed on sdb but GRUB is on sda ?

Am I the only one thinking that this is utterly wrong and heading into trouble ?

Can you post the new report from bootinfoscript ? No need to include grub.cfg contents.

DaveA
Posts: 8
Joined: 2018-06-29 11:36

Re: Erased windows boot loader

#10 Post by DaveA »

Gparted shows:
sda: one partition
sda1 NTFS 465 GB (presumably Windows)

sdb: 4 partitions
sdb1: FAT32 512 MB (presumably boot)
sdb2: extended 465 GB
sdb5: ext4 465 GB (presumably ubuntu no longer bootable)
unallocated unallocated 1MB

So, yes, Windows is only sda1 and the boot partition is on sdb1
There is no grub as I used Windows recovery on sdb1 to get the MBR back
No, there are two of us who think this is wrong and troublesome - you and me.
I cannot post a bootinfoscript because I cannot run ubuntu or Debian unless I re-install them or try a live disk. Would it show anything useful?

I installed a bona fide licensed Windows Pro and subsequently followed the instructions to install Debian which got me into this mess.
I ran originally with a single disk and Windows before adding a second disk and tried installing Debian.
I am currently writing a textbook that needs to get to the publishers by August using Word, hence my desire to recover Windows and reluctance to experiment with Debian.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Erased windows boot loader

#11 Post by p.H »

DaveA wrote:Gparted shows:
You could just post the output of "fdisk -l", you know. That would provide more information than your words.
DaveA wrote:sda: one partition
sda1 NTFS 465 GB (presumably Windows)
What has become of sda2 shown in the boot report as a recovery NTFS partition ?
DaveA wrote:There is no grub as I used Windows recovery on sdb1 to get the MBR back
GRUB was installed in the MBR of sda, so restoring Windows boot in sdb1 should not have erased it.
DaveA wrote:I cannot post a bootinfoscript because I cannot run ubuntu or Debian unless I re-install them or try a live disk. Would it show anything useful?
Yes, I think it would help knowing where exactly are Windows boot files. If you still have Ubuntu's installer, you can use it to reinstall GRUB in sdb as it should be.

DaveA
Posts: 8
Joined: 2018-06-29 11:36

Re: Erased windows boot loader

#12 Post by DaveA »

Output from fdisk -l below. I also get a red warning that "partition 2 does not start on a physical sector boundary". sdc is the USB I used to copy the output from fdisk.

My plan is to work with my Windows system for now. I have some free time in October and will format both drives, install a clean Windows10 on the 1st drive and install a clean Debian on the 2nd drive. I am not happy that my system is in a mess and don't know whether it was caused by Windows or Debian (or subsequently by ubuntu or the disk recovery tools).

Disk /dev/loop0: 1.99 GiB, 2109763584 bytes, 4120632 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 /dev/loop1: 218.102 MiB, 229629952 bytes, 448496 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 /dev/loop2: 31.9 MiB, 32595968 bytes, 63664 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 /dev/loop3: 55.48 MiB, 58159104 bytes, 113592 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 /dev/loop4: 51.4 MiB, 53522432 bytes, 104536 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 /dev/loop5: 64.79 MiB, 67915776 bytes, 132648 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 /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: TOSHIBA DT01ACA0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xbaaaf921

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 975689589 975687542 465.2G 7 HPFS/NTFS/exFAT
/dev/sda2 975689728 976769023 1079296 527M 27 Hidden NTFS WinRE


Disk /dev/sdb: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM002-1BD14
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x248fb359

Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 1050623 1048576 512M c W95 FAT32 (LBA)
/dev/sdb2 1052670 976771071 975718402 465.3G 5 Extended
/dev/sdb5 * 1052672 976771071 975718400 465.3G 83 Linux



Disk /dev/sdc: 3.75 GiB, 4009754624 bytes, 7831552 sectors
Disk model: USB DISK 2.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe69a2d5d

Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 8064 7831551 7823488 3.7G c W95 FAT32 (LBA)

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Erased windows boot loader

#13 Post by p.H »

The partition sda2 is still present, contrary to what you wrote. This illustrates how personal descriptions and interpretations are less reliable than raw terminal output.
The FAT partition sdb1 does not have the boot flag, so it is highly unlikely it is used by Windows as a boot partition.
The logical partition sdb5 has the boof flag ; this is totally useless, as the standard DOS/Windows MBR boot code checks this flag only on primary partitions (GRUB MBR does not care at all about this flag).

I doubt that the FAT partition sdb1 is used by Windows boot. If you cannot run bootinfoscript, you could at least do some checks.
- In Windows disk manager, check the status of sdb1.
- Check the contents of sdb1 with a file explorer.
- Check whether the file "bootmgr" is in sda1 (Windows system partition) or sdb1.
- Boot without the drive sdb connected.

DaveA
Posts: 8
Joined: 2018-06-29 11:36

Re: Erased windows boot loader

#14 Post by DaveA »

Output from bootinfoscript, hope it's helpful

Code: Select all

                  Boot Info Script 0.61      [1 April 2012]


============================= Boot Info Summary: ===============================

 => Windows is installed in the MBR of /dev/sda.
 => Windows is installed in the MBR of /dev/sdb.

sda1: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /bootmgr /Boot/BCD /Windows/System32/winload.exe

sda2: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista/7: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sdb1: __________________________________________________________________________

    File system:       vfat
    Boot sector type:  Unknown
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        

sdb2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  Unknown
    Boot sector info: 

sdb5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  Ubuntu 20.04.2 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: TOSHIBA DT01ACA0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1    *          2,048   975,689,589   975,687,542   7 NTFS / exFAT / HPFS
/dev/sda2         975,689,728   976,769,023     1,079,296  27 Hidden NTFS (Recovery Environment)


Drive: sdb _____________________________________________________________________
Disk /dev/sdb: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM002-1BD14
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1               2,048     1,050,623     1,048,576   c W95 FAT32 (LBA)
/dev/sdb2           1,052,670   976,771,071   975,718,402   5 Extended
/dev/sdb5    *      1,052,672   976,771,071   975,718,400  83 Linux


"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/loop0                                              squashfs   
/dev/loop1                                              squashfs   
/dev/loop2                                              squashfs   
/dev/loop3                                              squashfs   
/dev/loop4                                              squashfs   
/dev/loop5                                              squashfs   
/dev/sda1        204456204455F94C                       ntfs       
/dev/sda2        FE5A89015A88B843                       ntfs       
/dev/sdb1        D48B-C49E                              vfat       EFI
/dev/sdb5        94ef6ea0-337c-4200-9e9b-d80986f75114   ext4       
/dev/sr0         2021-02-09-19-06-26-00                 iso9660    Ubuntu 20.04.2.0 LTS amd64

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/fuse        /run/user/999/doc        fuse       (rw,nosuid,nodev,relatime,user_id=999,group_id=999)
/dev/loop0       /rofs                    squashfs   (ro,noatime)
/dev/sr0         /cdrom                   iso9660    (ro,noatime,nojoliet,check=s,map=n,blocksize=2048)


=========================== sdb5/boot/grub/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 [ "${initrdfail}" = 2 ]; then
   set initrdfail=
elif [ "${initrdfail}" = 1 ]; then
   set next_entry="${prev_entry}"
   set prev_entry=
   save_env prev_entry
   if [ "${next_entry}" ]; then
      set initrdfail=2
   fi
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 initrdfail {
    if [ -n "${have_grubenv}" ]; then if [ -n "${partuuid}" ]; then
      if [ -z "${initrdfail}" ]; then
        set initrdfail=1
        if [ -n "${boot_once}" ]; then
          set prev_entry="${default}"
          save_env prev_entry
        fi
      fi
      save_env initrdfail
    fi; 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,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  94ef6ea0-337c-4200-9e9b-d80986f75114
else
  search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
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=10
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=10
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 10 ; then
    set timeout=10
  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/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 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-94ef6ea0-337c-4200-9e9b-d80986f75114' {
	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='hd1,msdos5'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  94ef6ea0-337c-4200-9e9b-d80986f75114
	else
	  search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
	fi
	linux	/boot/vmlinuz-5.8.0-59-generic root=UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 ro  quiet splash $vt_handoff
	initrd	/boot/initrd.img-5.8.0-59-generic
}
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-94ef6ea0-337c-4200-9e9b-d80986f75114' {
	menuentry 'Ubuntu, with Linux 5.8.0-59-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.8.0-59-generic-advanced-94ef6ea0-337c-4200-9e9b-d80986f75114' {
		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='hd1,msdos5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  94ef6ea0-337c-4200-9e9b-d80986f75114
		else
		  search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
		fi
		echo	'Loading Linux 5.8.0-59-generic ...'
		linux	/boot/vmlinuz-5.8.0-59-generic root=UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 ro  quiet splash $vt_handoff
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-5.8.0-59-generic
	}
	menuentry 'Ubuntu, with Linux 5.8.0-59-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.8.0-59-generic-recovery-94ef6ea0-337c-4200-9e9b-d80986f75114' {
		recordfail
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		set root='hd1,msdos5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  94ef6ea0-337c-4200-9e9b-d80986f75114
		else
		  search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
		fi
		echo	'Loading Linux 5.8.0-59-generic ...'
		linux	/boot/vmlinuz-5.8.0-59-generic root=UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 ro recovery nomodeset dis_ucode_ldr 
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-5.8.0-59-generic
	}
	menuentry 'Ubuntu, with Linux 5.8.0-43-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.8.0-43-generic-advanced-94ef6ea0-337c-4200-9e9b-d80986f75114' {
		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='hd1,msdos5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  94ef6ea0-337c-4200-9e9b-d80986f75114
		else
		  search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
		fi
		echo	'Loading Linux 5.8.0-43-generic ...'
		linux	/boot/vmlinuz-5.8.0-43-generic root=UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 ro  quiet splash $vt_handoff
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-5.8.0-43-generic
	}
	menuentry 'Ubuntu, with Linux 5.8.0-43-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.8.0-43-generic-recovery-94ef6ea0-337c-4200-9e9b-d80986f75114' {
		recordfail
		load_video
		insmod gzio
		if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
		insmod part_msdos
		insmod ext2
		set root='hd1,msdos5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  94ef6ea0-337c-4200-9e9b-d80986f75114
		else
		  search --no-floppy --fs-uuid --set=root 94ef6ea0-337c-4200-9e9b-d80986f75114
		fi
		echo	'Loading Linux 5.8.0-43-generic ...'
		linux	/boot/vmlinuz-5.8.0-43-generic root=UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 ro recovery nomodeset dis_ucode_ldr 
		echo	'Loading initial ramdisk ...'
		initrd	/boot/initrd.img-5.8.0-43-generic
	}
}

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

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

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

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

### 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 ###
--------------------------------------------------------------------------------

=============================== sdb5/etc/fstab: ================================

--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdb5 during installation
UUID=94ef6ea0-337c-4200-9e9b-d80986f75114 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sdb1 during installation
#UUID=E5AC-7F1C  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
--------------------------------------------------------------------------------

=================== sdb5: Location of files loaded by Grub: ====================

           GiB - GB             File                                 Fragment(s)


======================== Unknown MBRs/Boot Sectors/etc: ========================

Unknown BootLoader on sdb1

00000000  eb 58 90 4d 53 44 4f 53  35 2e 30 00 02 08 0e 18  |.X.MSDOS5.0.....|
00000010  02 00 00 00 00 f8 00 00  3f 00 ff 00 00 08 00 00  |........?.......|
00000020  00 00 10 00 f9 03 00 00  00 00 00 00 02 00 00 00  |................|
00000030  01 00 06 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040  80 00 29 9e c4 8b d4 4e  4f 20 4e 41 4d 45 20 20  |..)....NO NAME  |
00000050  20 20 46 41 54 33 32 20  20 20 33 c9 8e d1 bc f4  |  FAT32   3.....|
00000060  7b 8e c1 8e d9 bd 00 7c  88 56 40 88 4e 02 8a 56  |{......|.V@.N..V|
00000070  40 b4 41 bb aa 55 cd 13  72 10 81 fb 55 aa 75 0a  |@.A..U..r...U.u.|
00000080  f6 c1 01 74 05 fe 46 02  eb 2d 8a 56 40 b4 08 cd  |...t..F..-.V@...|
00000090  13 73 05 b9 ff ff 8a f1  66 0f b6 c6 40 66 0f b6  |.s......f...@f..|
000000a0  d1 80 e2 3f f7 e2 86 cd  c0 ed 06 41 66 0f b7 c9  |...?.......Af...|
000000b0  66 f7 e1 66 89 46 f8 83  7e 16 00 75 39 83 7e 2a  |f..f.F..~..u9.~*|
000000c0  00 77 33 66 8b 46 1c 66  83 c0 0c bb 00 80 b9 01  |.w3f.F.f........|
000000d0  00 e8 2c 00 e9 a8 03 a1  f8 7d 80 c4 7c 8b f0 ac  |..,......}..|...|
000000e0  84 c0 74 17 3c ff 74 09  b4 0e bb 07 00 cd 10 eb  |..t.<.t.........|
000000f0  ee a1 fa 7d eb e4 a1 7d  80 eb df 98 cd 16 cd 19  |...}...}........|
00000100  66 60 80 7e 02 00 0f 84  20 00 66 6a 00 66 50 06  |f`.~.... .fj.fP.|
00000110  53 66 68 10 00 01 00 b4  42 8a 56 40 8b f4 cd 13  |Sfh.....B.V@....|
00000120  66 58 66 58 66 58 66 58  eb 33 66 3b 46 f8 72 03  |fXfXfXfX.3f;F.r.|
00000130  f9 eb 2a 66 33 d2 66 0f  b7 4e 18 66 f7 f1 fe c2  |..*f3.f..N.f....|
00000140  8a ca 66 8b d0 66 c1 ea  10 f7 76 1a 86 d6 8a 56  |..f..f....v....V|
00000150  40 8a e8 c0 e4 06 0a cc  b8 01 02 cd 13 66 61 0f  |@............fa.|
00000160  82 74 ff 81 c3 00 02 66  40 49 75 94 c3 42 4f 4f  |.t.....f@Iu..BOO|
00000170  54 4d 47 52 20 20 20 20  00 00 00 00 00 00 00 00  |TMGR    ........|
00000180  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001a0  00 00 00 00 00 00 00 00  00 00 00 00 0d 0a 44 69  |..............Di|
000001b0  73 6b 20 65 72 72 6f 72  ff 0d 0a 50 72 65 73 73  |sk error...Press|
000001c0  20 61 6e 79 20 6b 65 79  20 74 6f 20 72 65 73 74  | any key to rest|
000001d0  61 72 74 0d 0a 00 00 00  00 00 00 00 00 00 00 00  |art.............|
000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f0  00 00 00 00 00 00 00 00  ac 01 b9 01 00 00 55 aa  |..............U.|
00000200

Unknown BootLoader on sdb2

00000000  29 da 35 d1 af dd d5 1b  40 21 7d 7e e9 48 e9 54  |).5.....@!}~.H.T|
00000010  40 da 55 43 83 95 f8 7f  fc a0 53 3c 99 4a a7 f4  |@.UC......S<.J..|
00000020  7b b2 5a ae b9 95 84 c8  e0 06 25 1e e4 8b 57 60  |{.Z.......%...W`|
00000030  e1 ac 9f 25 a6 e6 46 59  7a af 0d c8 3f 19 44 48  |...%..FYz...?.DH|
00000040  56 ac 3a e9 30 74 db eb  b6 69 e3 e1 16 3a bf 82  |V.:.0t...i...:..|
00000050  59 5b d6 a2 12 46 76 ca  aa 73 0d d6 fe 43 cb ba  |Y[...Fv..s...C..|
00000060  8e 7d 84 72 47 72 4d 03  13 74 86 da 98 1b 84 e7  |.}.rGrM..t......|
00000070  81 62 63 86 96 a9 05 a5  10 f0 84 9f 29 be 90 86  |.bc.........)...|
00000080  ff 10 91 88 b4 be 65 3e  21 2e 24 62 e7 c6 b4 29  |......e>!.$b...)|
00000090  f2 f7 87 1e 72 b7 65 91  5e 25 c1 b9 9b 4e 0c da  |....r.e.^%...N..|
000000a0  d6 bd 12 08 38 d0 bd 0a  43 c4 e3 b5 82 92 8e 3a  |....8...C......:|
000000b0  14 e8 44 40 b7 75 78 9f  5e 22 de 78 83 b9 a9 0d  |..D@.ux.^".x....|
000000c0  6f 3e cb 21 71 00 d5 d5  91 9b 3a f1 44 83 cd a9  |o>.!q.....:.D...|
000000d0  a0 01 10 35 04 ee 06 15  62 9c b2 d9 ab c3 1d 73  |...5....b......s|
000000e0  24 20 cf e8 e9 be 03 13  42 8c 2c f0 a4 3d 8a d8  |$ ......B.,..=..|
000000f0  1c 26 29 04 1a 15 c8 9f  94 54 cc 1c f3 36 12 a5  |.&)......T...6..|
00000100  a1 1c 4c 5e 12 fb e4 df  fa 2a d7 2b 0b 4e 8a 4a  |..L^.....*.+.N.J|
00000110  cc 62 40 8f 6a 2a 52 83  69 8f 2f aa b1 55 bd 2c  |.b@.j*R.i./..U.,|
00000120  4d 07 71 59 24 81 b2 9d  6e c6 53 9b e9 6c 68 71  |M.qY$...n.S..lhq|
00000130  23 a9 03 26 8f c0 05 d2  a5 f8 de 31 f6 cc a4 6c  |#..&.......1...l|
00000140  1b 35 47 5c be a4 e2 32  a9 3f a1 47 f0 f5 6f 67  |.5G\...2.?.G..og|
00000150  36 bc f9 c8 ab 2f 9e 45  77 83 1e 3e b7 b6 80 e1  |6..../.Ew..>....|
00000160  bc bd ea e9 1e 95 8e 6f  7b 24 13 51 7d 59 9c 0e  |.......o{$.Q}Y..|
00000170  d0 b6 31 ec 5a c4 2f 7b  8b 70 be 5b 75 0b 82 6f  |..1.Z./{.p.[u..o|
00000180  8b e5 bf 55 03 41 33 43  e5 0d 7d b7 81 13 52 71  |...U.A3C..}...Rq|
00000190  90 e2 47 5c b8 ec 70 bd  e3 99 f4 44 66 ad a4 a7  |..G\..p....Df...|
000001a0  89 e8 57 ce 11 bb 54 5f  54 20 8a 0a 43 ec 6d 9b  |..W...T_T ..C.m.|
000001b0  76 f2 86 a3 28 e4 5d 08  a3 54 82 f5 59 b7 80 fe  |v...(.]..T..Y...|
000001c0  c2 ff 83 fe c2 ff 02 00  00 00 00 48 28 3a 00 00  |...........H(:..|
000001d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
00000200


=============================== StdErr Messages: ===============================

cat: /tmp/BootInfo-zLU13mL8/Tmp_Log: No such file or directory


p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Erased windows boot loader

#15 Post by p.H »

Yes it is helpful.
As expected, GRUB's boot image has been replaced with Windows boot program in the MBR of sda, and /bootmgr is present in sda1 as it should be.
Unexpectedly, Windows boot program has also been installed in the MBR of sdb, and the FAT partition sdb1 was reformated : new UUID, new label "EFI", but it still has the standard "0b" type identifier for FAT32 instead of "ef" for "EFI" in the partition table and no boot flag, and it does not seem to contain any boot files. I do not have any explanation for this.

Anyway, I am confident that Windows now boots only from sda as it should. You could try to disconnect sdb to confirm it.
So you can either install any GNU/Linux distribution (and GRUB) in sdb, or just reinstall GRUB in sdb from a live system.
Two ways : with or without chroot.

Within chroot on /dev/sdb5 (/dev, /proc and /sys must be available as usual) :

Code: Select all

grub-install /dev/sda
Without chroot (assume grub packages are present) :

Code: Select all

mount /dev/sdb5 /mnt
grub-install --boot-directory=/mnt/boot /dev/sda
umount /mnt
You need to select sdb in the BIOS boot menu to boot GRUB and Ubuntu.
Once in Ubuntu, you must reconfigure GRUB to not reinstall itself in /dev/sda after the next update :

Code: Select all

dpkg-reconfigure grub-pc # make sure to select /dev/sdb and *not* /dev/sda
Also, you can run update-grub to add Windows to GRUB's menu.

Post Reply