Creating Win-OS boot drive on Linux

TL;DR: I need to make a Win-7 bootable USB drive to reinstall Win-7, from a Linux PC as the Win-7 machine I had is borked. Not sure if this belong in Win-OS or Linux forum?

Recently I upgraded my hardware and my ageing Win-7 system got an AMD FM2 based heart (coming from AM3). When I tried booting the SSD (which in turn was successfully tranferred from an spinning rust device earlier and worked on the AM3 system just fine) it got hung in a repair circle. The report said that on the Win-7 side everything was OK, but an unknown failure prevented booting and do I want to repair Win-7? (again! and again. and AGAIN! :face_with_symbols_over_mouth: )

I have the Win-7 iso file (but not on bootable media, I’ve ran out of DVD-DL disks some time ago) and obviously tried the dd copy method, but so far it didn’t work, the drive wasn’t bootable. Tried Etcher, no luck either. The USB drive is 32GB (flash drive, not a harddrive or ssd!) so plenty of room for those 5GB or so. So, apparently I’m doing something wrong, but what am I overlooking? Note: I have no other Win-OS available, that borked Win-7 drive is the only one, all my other systems run Linux.

TIA!

Win7 normally can’t boot off of USB 3 (unless you slipstream drivers for USB3, AFAIK), so make sure that you are using a USB 2.0 port.

Etcher should be working, I’ve created boot drives from it before.

2 Likes

For Win10 and EFI boot, all you need to do is partition and format your USB drive to one big FAT32. Then loop mount the Win10 ISO (downloaded from Microsoft.com) and copy the contents onto the root of the USB drive. EFI just looks for a FAT partition, and tries to load /efi/boot/bootx64.efi (and a few other common names).

Example for sdc:

echo -e "unit: sectors\n/dev/sdc1 : start= 63, size= 30308481, Id= b" | sfdisk /dev/sdc
mkfs.vfat /dev/sdc1
mount -t vfat /dev/sdc1 /mnt/usb
mount -o loop win10.iso /mnt/dvd
rsync -avP /mnt/dvd/ /mnt/usb
umount /mnt/usb

I’m pretty sure I’m using USB2 ports, as that’s what’s mounted in the various cases. They do have USB3 on the mainboard, but I didn’t use those. I was a little surprised about Etchers failure too, although it did warn about creating Win-OS boot disks mostly failing. I tried, you’d never know, but alas.

@rcxb It’s a Win7 install, no Win10 on my machines! Anyway, you did set me up with another option to explore, I used NTFS to make a disk as per instructions I found online, but that too failed to boot. I shall try your method instead (sans Win10, but I’ll use the Win7 iso instead :wink: )

[edit] well, that did work, to a degree, but ultimately still failed. I got an error about the file sources/install.wim stating it was too large. Not even plain cp could handle it, that too error’d out with the same message. It’s only 4.4G! I may try Etcher again (unetbootin is not in the repo of my distro, unfortunately) later.

[edit2] Wanted to try Etcher again, but read more carefully the warning about flashing Win-OS onto a usb stick. It seems the WoeUSB tool is better suited for creating bootable Win-OS drives. I tried it (the dependencies are listed and not very surprising nor exhaustive) but for some reason when I ejected the USB drive it also vanished for the kernel, could not be found until I re-inserted it, which consequently auto-mounted itself in the tree so it can’t be used as it’s already mounted. See the circle here? :roll_eyes:

I’ll try tomorrow on another system, it’s well past midnight here so :sleeping_bed:

FAT32 has a 4GB file size limit. So in that case you need to create both a FAT32 partition, and an NTFS partition.

You may need to install ntfsprogs and ntfs-3g packages. Use fdisk to create partitions, set partition type to HEX:b for FAT32 and HEX:7 for NTFS. Use mkfs.ntfs /dev/sdc2 to create the NTFS partition, then mount it like usual.

If you’re lucky, your UEFI might let you just boot from a single large NTFS partition with everything on it. If not, here’s a blog telling you which files to put on which partition:

You could try to format the usb stick as exFAT.
Or just grab a bundle of DVD-R discs and burn a DVD.
One of the reasons why i still have an optical drive in my system. :smiley:

@rcxb Yeah, I figured that out after I shut down my PC and realised FAT32 has a 4GB file limit. I knew that, but it was late already :stuck_out_tongue: Anyway, I’m not using EUFI, I’m sticking with “legacy” MBR. EUFI doesn’t support Linux file systems and I won’t use it until it does. Although I may need to if I buy into the Zen platform (which I certainly hope to do when my disposable income allows such). I’ve skim-read the blog and they’re using a Win-OS PC for their tutorial. I’ll filter out the details I need when time permits, other activities have precedence ATM :wink:

I wish I could. As I’ve stated, I’ve run out of dual-layer DVD’s so USB is the only way ATM. A pile of suitable DVD’s from Aliexpress may not cost much, but it takes forever to get here and given my other expenditures, not a defensible expense right now.

2 Likes

They moved:

1 Like

@Dutch_Master

Can’t you just order a few at Azerty or Alternate, Megekko then?

That’s why i said you could try exFAT.
Since exFAT should also work with flash drives. :slight_smile:

Another option: Maybe you could use a boot manager like Ventoy and put the win7 iso on that,
and boot the install from there.

Due to my particular circumstances I simply cannot afford any expenditure not immediately related to the dark art of “living”. Besides, my car needs replacing, fairly urgently actually, so that’s another reason those DL-DVD’s aren’t coming any time soon.

As for this particular machine, I’ve booted it not even 5 mins ago and it already crashed on (high) temps. So that needs investigating first. I might be a while :roll_eyes:

This app-cli-here could help you a lot.

1 Like

Excellent software it saved my ass today. I needed win7 rescue cd quickly.

Chaotic AUR has binary build of this for Arch based distros. :slight_smile:

1 Like