Installing another OS without USB

I recently wanted to install (most probably dual-boot) Windows 7 in my laptop. I downloaded the .iso file for Windows 7, when I found out that I had no USB drives. So, I made a NTFS partition in my Drive (/dev/sda3), and extracted all the files there, hoping to boot the Windows 7 Setup from that partition.

I also made changes to the /boot/grub/grub.cfg file to add the option for the currently extracted drive to show up in boot.

Added the following code in /boot/grub/grub.cfg file:

menuentry 'Windows 7' --class windows --class os $menuentry_id_option 'osprober-chain-724D5FE1694E60F9' {
    set root='hd0,msdos3'
    insmod part_msdos
    insmod ntfs
    insmod ntldr
    
    
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  724D5FE1694E60F9
    else
      search --no-floppy --fs-uuid --set=root 724D5FE1694E60F9
    fi
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    chainloader +1
}

(Some changes were automatically made after running update-grub)

I also set the boot flag in the partition.

But after doing all these things, it didn't seem to work. During boot, an error shows up saying:

This is not a bootable disk. Please insert a bootable floppy and press any key to try again...

Is there any possible fix for this problem?

Is it possible to make a bootable hard disk without using a USB?

Any help would be appreciated.

5
задан 18 June 2020 в 13:00

3 ответа

If there's no boot record in a partition , you cannot boot it. You have to first extract the ISO file to that partition.Then try again.The ISO file should contain the desired boot record(as is the case for installation ISOs).

First off you have to extract it via dd , not a normal archive manager , because it have to rewrite the Partition Boot Record of the desired partition. So run this ( I do this each time I want to create a bootable USB stick) :

sudo dd if=/iso/file/address of=/dev/sda3 status=progress

Note that this will remove your NTFS partition so make sure you don't have any special file or data in that partition.Then I don't think there would be any problem booting the partition.If you cannot boot it via grub2 , try your system boot menu(Usually it's F12 but might differ based on your motherboard).

After the installation has finished, you can reformat that partition to NTFS again.

But if you cannot boot your linux after installation because the Windows bootloader has taken the precedence over grub2 as @summertime said , you can boot the ubuntu via the aforementioned method (i.e system boot menu) , then just run :

sudo update-grub

and reboot.

Hope it helps.

2
ответ дан 19 June 2020 в 21:23

Если вы хотите выполнить двойную загрузку, сначала установите Windows. Загрузчик Linux Grub2 может справиться с уже существующей установкой Windows, но в последний раз, когда я пытался это сделать, установщик Windows уничтожит загрузку Linux. Это не стоит хлопот.

6
ответ дан 19 June 2020 в 21:23

Я не знаю, что именно произошло, но я просто вводил некоторые случайные, но действительные команды в grub-cli .

Я бы попробовал сделать следующее:

  • Создание раздела с файлами (в данном случае / dev / sda3 ) как root:

set root = (hd0, msdos3)

  • Вставка некоторых необходимых модулей:
insmod part_msdos
insmod ntfs
insmod ntldr
  • Загрузка файла bootmgr (который я позже узнал, это Kernel):
ntldr /bootmgr

Это была часть, где я застрял. Но на этот раз я попробовал несколько действительно случайных команд (которые тоже могут быть недействительными). Но одна команда действительно работала и напрямую загружалась в программу установки Windows 7:

boot

Все работало нормально, поэтому я перезапустил свой ноутбук и попробовал тот же набор команд:

set root=(hd0,msdos3)
insmod part_msdos
insmod ntfs
insmod ntldr
ntldr /bootmgr
boot

И он снова заработал. Итак, я изменил файл конфигурации grub ( / boot / grub / grub. cfg ) как таковой (буквально добавив две строки в исходный код):

menuentry 'Windows 7' --class windows --class os $menuentry_id_option 'osprober-chain-724D5FE1694E60F9' {
    set root='hd0,msdos3'
    insmod part_msdos
    insmod ntfs
    insmod ntldr
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  724D5FE1694E60F9
    else
      search --no-floppy --fs-uuid --set=root 724D5FE1694E60F9
    fi
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    ntldr /bootmgr
    boot
    chainloader +1
}

После успешного сохранения этих изменений (как sudo ), опция Windows 7 в окне загрузки начал работать.

Спасибо всем, кто уделил время выяснению решения.

Примечание. Есть разные решения одной и той же проблемы. Для меня это решение работало отлично, если оно не работает для вас, попробуйте все упомянутые решения.

3
ответ дан 19 June 2020 в 21:23

Другие вопросы по тегам:

Похожие вопросы: