0

I made usb disk multiboot installation, ubuntu and windows 10.

sudo parted -s /dev/sdb mklabel msdos

sudo parted -s /dev/sdb mkpart primary 1MiB 551MiB

sudo parted -s /dev/sdb set 1 esp on
sudo parted -s /dev/sdb set 1 boot on

sudo mkfs.fat -F32 /dev/sdb1
sudo parted -s /dev/sdb mkpart primary 551MiB 100%

sudo mkfs.ext4 /dev/sdb2

sudo mkdir /media/{efi,data}

sudo mount /dev/sdb1 /media/efi
sudo mount /dev/sdb2 /media/data

sudo grub-install --target=i386-pc --recheck --boot-directory="/media/data/boot" /dev/sdb
sudo grub-install --target=x86_64-efi --recheck --removable --efi-directory="/media/efi" --boot-directory="/media/data/boot"

Then I made folder for iso and copied there needed isos.

sudo mkdir /media/data/boot/iso
sudo chown 1000:1000 /media/data/boot/iso

hosek@yoga:/media$ ls -la /media/data/boot/iso/
total 7911028
drwxr-xr-x 2 hosek hosek       4096 čen 23 10:40 .
drwxr-xr-x 4 root  root        4096 čen 23 10:38 ..
-rw-rw-r-- 1 hosek hosek 3285123072 dub 20 09:09 ubuntustudio-19.04-dvd-amd64.iso
-rw-rw-r-- 1 hosek hosek 4815753216 čen 13 09:24 Win10_1903_V1_Czech_x64.iso
hosek@yoga:/media$ 

Now I insert this to /media/data/boot/grub/grub.cfg file.

menuentry "ubuntustudio-19.04-dvd-amd64.iso" {
isofile="/boot/iso/ubuntustudio-19.04-dvd-amd64.iso"
loopback loop "${isofile}"
linux (loop)/casper/vmlinuz iso-scan/filename="${isofile}" file=/cdrom/preseed/ubuntustudio.seed boot=casper quiet splash ---
initrd (loop)/casper/initrd
}

menuentry "Win10_1903_V1_Czech_x64.iso" {
# Insert modules needed in order to access the iso-file
insmod part_gpt
#insmod part_msdos
insmod ntfs
insmod ext4
# Insert module needed in order to find partition
insmod search_fs_uuid

# Set UUID of partition with the iso-image
# and let grub2 find the partition
# (save it's identifier to the variable $root)
set uuid="8ff5d218-2b0c-471c-8356-98686a351111"
search --no-floppy --set=root --fs-uuid $uuid

# Mount the iso image by addressing it with (partition)/path
set iso=/boot/iso/Win10_1903_V1_Czech_x64.iso
loopback loop ($root)$iso

# boot (chain-load) the image using the cdboot.efi file located
# on the win10-image
chainloader (loop)/efi/microsoft/boot/cdboot.efi
}

When I restart computer and boot from usb, it shows me menu.

ubuntustudio-19.04-dvd-amd64.iso
Win10_1903_V1_Czech_x64.iso

When I choose ubuntustudio-19.04-dvd-amd64.iso, it is ok. But when I choose Win10_1903_V1_Czech_x64.iso, it shows me, that file /efi/microsoft/boot/cdboot.efi not found.

Where could be the problem? And what about Windows 7 installation, is the menuantry for grub same?

Thanks.

0

Check this. As far as I could know, you can't boot a Windows ISO with GRUB.

Technically installing from windows's .iso file can't be possible. You can boot from the .iso using grub but after that Windows will loss contact with the mounted location or it is not capable of it. So both grub & Windows should aware of mount and boot. Currently Windows doesn't support.

What I know works, is to copy the contents to your USB root, not in a subfolder, and then use a menu like this:

menuentry "Windows installer" {
  set root='hd01'
  insmod ntldr
  ntldr /bootmgr
}

I haven't been able to boot from EFI, and I think is not possible either.

  • Thank you. So I need to create special partition for windows os and copy to root? Or can I just extract windows folder to usb data partition and set up the path? Thanks. – Stanislav Hosek Jun 23 '19 at 16:11
  • Give me some time to try again. If a remember correctly, windows 7 won't work on a different partition than the root. I mean, it boots, but the installer won't detect the hard disk. With windows 10, I think that you can put it in a new partition. I'll check it now. – guillermo chamorro Jun 23 '19 at 16:20
  • Yes, I remember this issue about w7 disk problem. Ok, I will wait. Let me know. Thank you very much. – Stanislav Hosek Jun 23 '19 at 16:25
  • It was like that. Windows 7 in a different partition will boot but won't detect the hd. Windows 10 is ok on a different partition. – guillermo chamorro Jun 23 '19 at 17:18
  • Ok, so if is not another solution for w7, then good bye w7. Thank you for answer. – Stanislav Hosek Jun 23 '19 at 17:23

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.