Está en la página 1de 4

How to make Windows 7 USB ash install media from L...

http://serverfault.com/questions/6714/how-to-make-win...

How to make Windows 7 USB ash install media from Linux?

I have: ISO image of Windows 7 install media 4 GB USB ash drive no DVD drive Linux installed
linux windows-7 usb

edited Jun 16 '11 at 17:03 Peter Mortensen 1,200 4 10 21

asked May 9 '09 at 22:50 Ian Kelling 1,012 2 9 17 100% accept rate

feedback

5 Answers
You can accomplish this with dd. Open up a terminal, your going to need to nd what device is your pendrive. If you have the drive mounted you can nd the name of the device by typing "mount" and looking at it's entry. Something like the following: /dev/sdb1 on /media/USBDISK type vfat (rw,nosuid,nodev,uhelper=hal,uid=1000,utf8,shortname=mixed) In this case the rst partion of /dev/sdb is mounted at /media/USBDISK. Open a root shell and unmount the drive. umount /dev/sdb1 Go to the directory where your ISO is stored in a root shell and type in the following: (Replace windows7.iso with whatever the iso is called, and /dev/sdb with the device id of your usb stick). dd if=windows7.iso of=/dev/sdb If your motherboard supports booting o of a pendrive it should be able to boot o it. This will get the installer on the pendrive not the OS itself.
answered May 11 '09 at 14:28 TrueDuality 1,085 1 9 24

4 Doesn't work for me. bytesum Jun 2 '10 at 16:41


Does your motherboard support booting from USB? That'll be the ultimate deciding factor of whether this approach will work or not. TrueDuality Jun 4 '10 at 14:46

5 Doesn't work for me either and my machine does support USB booting just ne. Maybe this
approach can work on machines that can boot DVD-style USB-storage but most BIOSes assume HDD-style layout on USB (meaning 512 byte MBR with boot code in it). On thing worth a mention: Fedora CD/DVD images, unlike W7, do in fact have such MBR with boot code and partition table on them, making them suitable for HDD/USB boot too. Tronic Aug 28 '10 at 17:35

1 of 4

18/01/13 03:24

How to make Windows 7 USB ash install media from L...

http://serverfault.com/questions/6714/how-to-make-win...

2 This does require that your motherboard is able to boot USB-CDROM not just USB-HDD
TrueDuality Oct 5 '10 at 12:43

4 This solution is missing the MBR-installation step, and will typically not work unless it
magically is there already. The solution by @Gunthers is complete. stolsvik Dec 25 '11 at 1:30

Was this post useful to you?

Yes

No

OK, after unsuccessfully trying all methods mentioned here, I nally 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 or lilo -M . This works with the Windows 7 retail version. Here is the complete rundown again: Install ms-sys - if it is not in your repositories, get it here. Or alternatively, make sure lilo is installed (but do not run the lilocong step on your local box if e.g. Grub is installed there!) Check what device your USB media is assigned - here we will assume it is /dev/sdb . Delete all partitions, create a new one taking up all the space, set type to NTFS (7), and remember to set it bootable: # cfdisk /dev/sdb or fdisk /dev/sdb (partition type 7, and bootable ag)

Create an NTFS lesystem: # mkfs.ntfs -f /dev/sdb1 Write Windows 7 MBR on the USB stick: # ms-sys -7 /dev/sdb (info) Mount ISO and USB media: # mount -o loop win7.iso /mnt/iso # mount /dev/sdb1 /mnt/usb Copy over all les: # cp -r /mnt/iso/* /mnt/usb/ ...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 le... Just use dd: # dd if=/dev/sdb of=/win7.img and reverse if/of next time you want to put the Windows 7 installer onto USB. As always, double check the device names very carefully when working with dd .
edited Dec 25 '11 at 7:38 stolsvik 109 5 answered Aug 4 '10 at 15:38 Gunthers 371 3 3

or (e.g. on newer Ubuntu installs)

sudo lilo -M /dev/sdb mbr

...or use the standard GUI le-browser of your system

2 of 4

18/01/13 03:24

How to make Windows 7 USB ash install media from L...

http://serverfault.com/questions/6714/how-to-make-win...

1 Would be nice to mention the numerical partition type to use in cfdisk as well (7, 86, 87?)
Johan Dahlin Sep 5 '10 at 21:03

1 It worked with type 7 Ropez Sep 15 '10 at 20:56 1 Just a note: If your ntfs lesystem gives weird permission errors when you write to it even as
root, make sure you've installed ntfs-3g. Jeremy Salwen Jun 24 '11 at 6:32

1 I tried this directly onto a hard drive, and I got the error "windows cannot access the
installation sources" once I booted up from it. Jeremy Salwen Jun 24 '11 at 7:21 Worked except I didn't need to run ms-sys - Just set the boot ag in GParted. l0b0 Nov 17 '11 at 22:09 show 1 more comment feedback

PCambell's suggestion is good but you will also want to clear the MBR, the linux equivalent is below I tried this and it worked (I'm not sure why the dd method failed but seems the partition had to be ntfs?): work out which /dev/device is your usb ash drive and unmount it clear the MBR: dd if=/dev/zero of=/dev/device bs=446 count=1 run fdisk /dev/device remove all partitions and create 1 primary partition, make it bootable then save the changes run mkfs.ntfs /dev/device1 (partition 1) copy the entire contents of the windows install iso on to the partition you created
answered Mar 27 '10 at 8:24 Raymond

feedback

If you could manage to do all these tasks from within your linux desktop, you'll be rocking the house. I think the toughest part would be ddling with all the operations that Windows' Diskpart does. Making the partition marked as 'active' and 'boot', 'primary', etc.
answered May 10 '09 at 0:17 p.campbell 2,895 5 20 41 I think GParted (gparted.sourceforge.net) can handle all the partition ags just ne. See e.g. gparted.sourceforge.net/screenshots.php . And I haven't tested but it looks like rsync can substitute for robocopy in that checklist. Matthew Flaschen May 10 '09 at 2:47

feedback

Instead of dd if=windows7.iso of=/dev/sdb you write as root , dd if=windows7.iso of=/dev/sdb1 (ADD 1 at the end or whatever your USB drive is placed at.)
edited Jun 16 '11 at 17:49 Peter Mortensen 1,200 4 10 21 answered Dec 22 '10 at 18:20 gonzo 1

3 of 4

18/01/13 03:24

How to make Windows 7 USB ash install media from L...

http://serverfault.com/questions/6714/how-to-make-win...

1 No, the of=sdb is correct as per the previous answers. James Broadhead Aug 13 '11 at
21:00

feedback

protected by Chris S Jun 16 '11 at 17:55


This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged linux
windows-7 usb or ask your own question.

4 of 4

18/01/13 03:24

También podría gustarte