Making bootable usb/flash drive for Windows 7 / Windows 8 by using Grub2

Published on Author gryzli

Here we will used the following concentions:

  • USB drive mapped to: /dev/sdb
  • Windows 7 or 8 ISO  – win7.iso
  • Running linux  with grub2 (I’m running Fedora 20 right now)
  • parted
  • ntfs-3g

 

1| By using parted we must make the following modifications on /dev/sdb

  • Make MSDOS label:
    • mklabel msdos
  • Set boot flag
    • set boot
  • Create primary partition
    • mkpart ….

 

2| Format the newly created partition with NTFS filesystem

mkfs.ntfs /dev/sdb1

 

3| Mount the USB stick , Mount the Windows image and copy the files

mount /dev/sdb1 /mnt/usb

mount win7.iso /mnt/win7

cp -rf /mnt/win7/* /mnt/usb/

sync

4| Install GRUB2 and create grub2 config file

Install grub2 with the following command:

grub2-install --no-floppy --force --boot-directory=/mnt/usb/boot /dev/sdb

 

Write down the UUID of /dev/sdb1 partition

blkid | grep /dev/sdb1

You need to copy the ID which looks like this:

/dev/sdb1: UUID=”18680CF017449E47 TYPE=”ntfs” PARTUUID=”000968f1-01″

 

Create grub2 config file on the usb

vim /mnt/usb/boot/grub2/grub.cfg

menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
insmod part_msdos
insmod ntfs
insmod ntldr
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root 18680CF017449E47 # This is the EUID of the usb disk
ntldr /bootmgr
}

One Response to Making bootable usb/flash drive for Windows 7 / Windows 8 by using Grub2

  1. Hi,
    Your procedure is perfect and works.
    So, a big thank you to you ;-)

    Just one thing :
    Today due to difference in versions = grub-install instead grub2-install