Tuesday, January 3, 2012

Making a bootable pendrive of Windows 7 using Linux

Creating a bootable USB drive of Windows 7 (or even Vista or XP) in Linux the non-nerdy way. So this doesn't involve using the dd command anywhere.

The steps involved are :

  1. Get the required Windows OS iso image. I shall use the Windows 7 example.
  2. Format your USB drive to NTFS. Use Disk Utility in Ubuntu to do it or any other way you prefer.
  3. Mount the image, use the following set of commands to mount the iso image.

    Code:
    $ su -
    # mkdir -p /mnt/disk
    # mount -o loop disk1.iso /mnt/disk
    # cd /mnt/disk
    # ls -l
  4. Copy everything present in the /mnt/disk directory to your formatted USB drive.
  5. You now need to manually install the Windows MBR into your USB drive. To do this, install this very handy tool called ms-sys

    Install it :
    Code:
    tar xvf ms-sys-2.1.5.tar.gz
    cd ms-sys
    make
    make install #as root
    Write a Windows 7 MBR to your USB drive (as root)

    Use the "ms-sys -h" command for other the right option for other Windows Operating Systems
    Code:
    ms-sys -7 /dev/sdX
    Replace 'X' with your USB drive letter, its usally 'b' so its /dev/sdb.

    Once you are done, you have a Windows 7 Bootable USB drive.
If you are stuck anywhere, or encounter any problem please do ping us or leave a comment and we will get back to you as soon as possible.