Wednesday 15 May 2013

Windows Bootable USB

Extracting the ISO to USB

First well need a few bits installed. I'm doing this on a Debian host but I'm sure the packages are there for EL or any other flavour ;-)

su -c `apt-get install ntfs-3g gparted -y

So then we need to clean up the USB stick with gparted.

Format it to ntfs using all the space.(Make sure you format the right drive, otherwise you'll FUBAR your OS) and make a note of the drive number.

Then we need a temporary mount point:

$ mkdir /tmp/windows_usb

Now we mount our ISO

$ mount windows_iso.iso /tmp/windows_usb

Now copy over then contents of your ISO to wherever your USB key is mounted, mines in 
/media/37265723dhgsdhg23857/

$ cp -r /tmp/windows_usb/* /media/

Will probably take a while depending on speed of USB key.

Now were going to need a little tool called ms-sys, and it probably wont be in your standard OS 
repo's, but it's at sourceforge and you'll also need to install some tools for building stuff from source:

$ sudo apt-get install build-essential module-assistant gettext-y

$ wget http://prdownloads.sourceforge.net/ms-sys/ms-sys-2.3.0.tar.gz

$ tar xvf ms-sys-2.3.0.tar.gz ; cd ms-sys-2.3.0 ; make ; sudo make install

If all is well you should have no errors and be ready to write a master boot record to the USB drive:

$ ms-sys -7 /dev/sd{?}

Replace {?} with the disk number of your device (noted from gparted)

Now you should have a bootable Windows USB key!

No comments:

Post a Comment