To create a Windows 7 installer USB mass storage in Debian GNU/Linux, these tools are needed:
- fdisk (util-linux)
- mkfs.ntfs (ntfs-3g)
- ms-sys (http://ms-sys.sourceforge.net/)
Steps for creating the installer:
- Run fdisk on the device.
fdisk /dev/sdb
- Create a new empty DOS partition table.
Command (m for help): o Building a new DOS disklabel with disk identifier 0x7ebabd73.
- Create a single primary partition.
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4, default 1): 1 First sector (2048-32767, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-32767, default 32767): Using default value 32767
- Set the partition bootable flag to active.
Command (m for help): a Partition number (1-4): 1
- Write the change to the storage device.
Command (m for help): w The partition table has been altered! Syncing disks.
- Create a new NTFS volume in the new partition.
mkfs.ntfs -f /dev/sdb1
- Mount the filesystem.
mount /dev/sdb1 /mnt/win7
- Copy the content of Windows 7 installer.
rsync --progress --stats -rv /mnt/win7dvd/* /mnt/win7/
- Unmount the filesystem.
umount /mnt/win7
- Run ms-sys
ms-sys -7 /dev/sdb