N
N
neosapient2017-04-02 22:44:23
GRUB
neosapient, 2017-04-02 22:44:23

[closed] What's wrong with configuring Grub to search for Windows 7? How to fix?

The question is closed, because in the end I deleted all the operating systems and installed them from scratch.
Hello.
Winchester began to crumble. I decided to install a new larger one and put Windows 7 and Ubuntu 16.4 there. At some point I got the configuration
/dev/dsa - 500 Gb - old disk - Windows 7
/dev/dsb - 1000 Gb - new disk - Windows 7 + Ubuntu
16.4 on the old disk. In turn, Grub settled on the new disk, which in one of the menu items allowed you to switch to the Windows bootloader.
In general, today I turned off the old disk. Those. the new one became /dev/dsa.
Grub was able to work with Ubuntu, but could not get the Windows bootloader to start - which is logical, since the disk was removed from the computer.
In general, I try to update Grub
> sudo update-grub
I reboot, and ... the Windows Loader item has disappeared. And the Windows boot point did not appear.
Then I decide to reinstall Grub
> sudo grub-install /dev/sda I
reboot, ... the Windows boot point did not appear.
Useful to read the forums. It offers the option of manually adding a menu item to Grub via the UUID of the disk partition. You can get this identifier through the command
> ls -la /dev/disk/by-uuid

drwxr-xr-x 2 root root 160 Apr 2 21:24 .
drwxr-xr-x 6 root root 120 Apr 2 21:24 ..
lrwxrwxrwx 1 root root Apr 10 21:55 0b87a9c3-7edd-47cf-8803-feefb59e122b -> ../../sda1
lrwxrwxrwx 1 root root Apr 10 2 21:55 2ab1cb42-9d1d-4ee9-a7a5-7fa6be4e87cb -> ../../sda6
lrwxrwxrwx 1 root root Apr 10 2 21:55 4c33d77c-a230-4c2d-a3fd-25b674ed09ef -> ../../sda7
lrwxrwxrwx 1 root root Apr 10 21:55 4EB83987B8396E99 -> ../../sda4
lrwxrwxrwx 1 root root Apr 10 21:55 a0adb5a5-d708-4275-a14a-0dbd1c2dd636 ->
../r.w./swx root root Apr 10 21:55 E85292D95292AC36 -> ../../sda2

Windows 7 lies on the sda2 partition. Those. I take the identifier UUID = E85292D95292AC36
6670f885bcb448959a02017aabe861cd.png
spoiler

> sudo fdisk -l
Устр-во Загрузочный Start Конец Секторы Size Id Тип
/dev/sda1 * 2048 6146047 6144000 3G 83 Linux
/dev/sda2 6146048 614627327 608481280 290,2G 7 HPFS/NTFS/exFAT
/dev/sda3 614629374 1127321599 512692226 244,5G 5 Расширенный
/dev/sda4 1127321600 1953519615 826198016 394G 7 HPFS/NTFS/exFAT
/dev/sda5 614629376 907595775 292966400 139,7G 83 Linux
/dev/sda6 907597824 932009983 24412160 11,7G 82 Linux своп / So
/dev/sda7 932012032 1127321599 195309568 93,1G 83 Linux
Partition 3 does not start on physical sector boundary.
Записи таблицы разделов не соответствуют порядку разделов на диске.

In general, I take the identifier UUID = E85292D95292AC36 I add
the following text to the file /etc/grub.d/40_custom

menuentry "Windows 7" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set E85292D95292AC36
chainloader +1
}

> sudo update-grub
In the spoiler, the text of the end of the /boot/grub/grub.cfg file. There you can see that my block has been added.
spoiler
#
### 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.
menuentry "Windows 7" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos2)'
search --no-floppy --fs-uuid --set E85292D95292AC36
chainloader +1
}
### 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 ###

I reboot. Grub starts. I see the menu item "Windows 7". I go into it and get a bootloading error message.
What could be wrong? How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ipc_ngs, 2017-04-04
@ipc_ngs

1. in the search command, replace --set with --set=root
2. try adding the "insmod ntldr" command and replacing "chainloader +1" with "ntldr /bootmgr" to run the windows bootloader directly (make sure the root of the windows partition sda2 does have such a file)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question