Unix

리눅스에서 Windows 7 설치 USB 만들기

ForceCore 2011. 4. 11. 17:38
윈도우에서 하는 법은 저번에 알아냈었다: http://forcecore.tistory.com/1229

하지만 리눅스에서 만드는 법도 존재한다: http://serverfault.com/questions/6714/how-to-make-a-windows-7-usb-flash-install-media-from-linux

OK, after unsuccessfully trying all methods mentioned here, I finally got it working. Basically, the missing step was to write a proper boot sector to the usb stick, which can be done from linux with ms-sys. This works with the Win7 retail version.

Here is the complete rundown again:

Install ms-sys, if it is not in your repos get it here.

Check what device your usb media is asigned - here we will assume it is /dev/sdb. Delete all partitions, create a new one taking up all the space, set type to NTFS, and set it bootable:

# cfdisk /dev/sdb

Create NTFS filesystem:

# mkfs.ntfs -f /dev/sdb1

Mount iso and usb media:

# mount -o loop win7.iso /mnt/iso

# mount /dev/sdb1 /mnt/usb

Copy over all files:

# cp -r /mnt/iso/* /mnt/usb/

Write Windows 7 MBR on usb stick:

# ms-sys -7 /dev/sdb

...and you're done.

After all that, you probably want to back up your usb media for further installations and get rid of the iso... Just use dd: # dd if=/dev/sdb of=/win7.img and reverse if/of next time you want to put the Win7 installer onto usb.

As always, double check the device names very carefully when working with dd.

요렇댄다. 실제로 되기도 한다. 신기한듯.