Create a bootable USB from a bootable DVD

Using Fedora 29. I am trying to create an iso image from my single win7 DVD (puchased from ultimatebootrepair.com) and then create a bootable USB drive from that to use in a computer with no DVD R/W.

  1. put DVD in drive.

  2. F29 LXDE Menu > Sound & Video > GnomeBaker > Tools >Copy Data CD >
    click “Only Create Image” > Browse to select location for output .iso
    I used ~/builds/windows7_CD.iso

  3. cd ~/builds/

  4. stick suficient size usb in and using “mount” command determine device and mount location eg:

    mount
    /dev/sda1 on /run/media/user/3879-5BF7 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

  5. So then use dd to copy the file to the usb:
    sudo dd if=windows7_CD.iso of=/dev/sda1

It looked fine, but it will not boot.
I have tried enabling legacy boot and others but still no boot.
The first level of files looks like this:

 ls -go "/run/media/how2/GRMCULF(X)REO_EN-RU_DVD"
total 1164
-r--r--r--.  1    104 Jul 26  2012 autorun.inf
dr-xr-xr-x.  4    480 Feb 20  2016 boot
-r--r--r--.  1 383786 Apr 11  2011 bootmgr
-r--r--r--.  1 669568 Apr 12  2011 bootmgr.efi
dr-xr-xr-x.  4    132 Feb 20  2016 efi
-r--r--r--.  1   3587 Feb 24  2016 m0nkrus.nfo
-r--r--r--.  1 112400 Apr 11  2011 setup.exe
dr-xr-xr-x. 13   8948 Feb 22  2016 sources
dr-xr-xr-x.  5    180 Feb 20  2016 support
dr-xr-xr-x.  3     84 Feb 20  2016 upgrade

Could it be those parens in that drive name?
What am I doing wrong?
Thanks

  Never used Win’dows' non-installation medias.  Aside from partioning device creating a separate efi-partition (as there is efi dir)...  Did you’ve tried this:  Tools to convert Windows 10 iso to usb (at least UNetbootin should work in GNU Linux)?  Chances are this will work for "7" too.

Windows installation isos won’t boot when dd’ed on a USB – it’s a known fact (and I’ve tried that myself).

You can try WoeUSB application, it’s in the repos, install it with:

sudo dnf install WoeUSB

I think I’ve tried it once after discovering, and was successful – but I’m not 100% sure on this. Before this I also did find and tried instructions for manually making windows installation USB – once successfully and other time without success. If WoeUSB won’t help you, I’ll try to find the links for manual path.

@how0909, I assume you don’t have access to a working windows installation? From my experience, if WoeUSB won’t help you – then it’s much easier to use Windows to create a bootable Windows installation USB.

1 Like

Thanks. I downloaded WoeUSB and gave it a try but got error:
cp:error reading '.sources/$OEM$/$$/SETUP/SCRIPTS/
SetupComplete.cmd’Input/output error
The command “cp”${source_file}“”${dest_file}""failed with exit
status “1”,program is prematurely aborted

I have already installed Windows from the disk onto that machine with the DVD r/w, so I will not be able to try to create another iso from that. But I think I will look into those other methods using Windows to create a bootable Windows installation USB. Either that or buy a Stick with XP on it or something. That wasn’t too bad. Funny to see old win7 though…
Thanks for your help.

To boot an ISO on USB it should be a hybrid disc. To check, do file windows7_CD.iso. If the output says “ISO 9660 CD-ROM filesystem …” it is not a hybrid and needs to be converted.

Luckily converting to hybrid is simple: isohybrid --uefi windows7_CD.iso (or omit --uefi if you don’t need it to be UEFI bootable). The isohybrid command is provided by the syslinux package which you will need to install if it is not already present on your system.

After that you can copy the ISO image onto the USB device using your choice of method. The advice I’ve seen is typically like: sudo dd bs=4M if=windows7_CD.iso of=/dev/sda conv=fdatasync

1 Like

hmm, here’s what I got with that:

isohybrid --uefi windows7_DVD.iso
isohybrid: windows7_DVD.iso: unexpected boot catalogue parameters

isohybrid  windows7_DVD.iso
isohybrid: windows7_DVD.iso: unexpected boot catalogue parameters

file windows7_DVD.iso
windows7_DVD.iso: ISO 9660 CD-ROM filesystem data 'GRMCULF(X)REO_EN-RU_DVD' (bootable)

Wierd, it used to be a udp file system. Don’t know when that was changed.Possibly with that command. Should have checked before running isohybrid.

You might have wanted to do file first to see what you’re working with. Maybe try re-extracting an ISO from the DVD and start over? Just in case other methods messed something up. The other is of course to search for the error encountered with isohybrid.

Didn’t want to leave a dead end thread here so:

Apparently I was mistaken. Running “file” on the original iso file shows is an ISO 9660 after all. I swear I saw udp somewhere. So they both say this and are the same size:

~/build> file windows7_DVD.iso
windows7_DVD.iso: ISO 9660 CD-ROM filesystem data ‘GRMCULF(X)REO_EN-RU_DVD’ (bootable)

~/build> ls -go
total 3934872
-rw-rw-r–. 1 4029304832 Mar 2 14:33 windows7_DVD.iso

So I tried the to dd the iso again but with line above:

~/build> sudo dd bs=4M if=windows7_DVD.iso of=/dev/sda1 conv=fdatasync

dd: error writing ‘/dev/sda1’: No space left on device
231+0 records in
230+0 records out
966553600 bytes (967 MB, 922 MiB) copied, 49.399 s, 19.6 MB/s

Only 966Mb of space left?
Does that mean that the original dd is still there and can’t be touched for some reason?

Then I thought I’d start over. My thinking was that the drive is just memory that needs to be blanked out and rewritten and these tools should do that right? Sso I did these with gparted:

(parted) mklabel msdos

(parted) mkpart primary fat32 1MiB 100%

(parted) print
Model: (file)
Disk /dev/sda1: 967MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 966MB 965MB primary fat32 lba

hahahaha so that flash is messed up now I guess. I have heard of such things but never exerienced it.

I had installed the win7 from the DVD the other day, so I stuck the flashdrive in there. Right off the fm said it needed to format the drive. It started but soon stopped saying that it could not format the drive. Then I saw in tutorial at:
eassos.com/how-to/windows-was-unable-to-complete-the-format.php

goto fileman > rightclick Computer > select Manage > select “Disk Management” on left > new window - select flash - rightclick > New Simple Volume wizard

This seems to be working. As it started it was showing 7gb total capacity (yea). I de-elected quick format and it seemed to work. I think there was one large win32 partition I was able to write to with notepad:

G:>dir
Volume in drive G is NEW VOLUME
Volume Serial Number is 923E-5DA3
Directory of G:
03/08/2020 05:46 PM 246 x1.txt
1 File(s) 246 bytes
0 Dir(s) 7,985,946,624 bytes free

Then I put the fashdrive in the F29 laptop to try the dd command on it. But it failed ‘out of space’ at 967 MB again!

So I’m nuts with this thing now and I saw some other pages on using the Windows “diskpart” utility. It would seem to be getting somewhere but ulimately fail like:

DISKPART> select disk 1
Disk 1 is now the selected disk.

DISKPART> clean all
DiskPart has encountered an error: The system cannot find the file specified.
See the System Event Log for more information.

DISKPART> ATTRIBUTES DISK CLEAR READONLY
Disk attributes cleared successfully.

DISKPART> convert mbr
DiskPart successfully converted the selected disk to MBR format.

DISKPART> create partition primary
DiskPart has encountered an error: The system cannot find the file specified.
See the System Event Log for more information.

DISKPART> list partition
There are no partitions on this disk to show.

DISKPART> convert gpt
DiskPart has encountered an error: The system cannot find the file specified.
See the System Event Log for more information.

So , after messing with this drive all day with no success I threw it in the woodstove like throwing the One Ring into Mt Doom from which it was forged! It’s $8 - screw it!

I’m certainly not sure but I think the original dd is what did it in as eluded to by nightromantic above. Thanks for all your help.

Oh, hang on. The output should be to the device (/dev/sda), not a partition (/dev/sda1). Try again with:
sudo dd bs=4M if=windows7_CD.iso of=/dev/sda conv=fdatasync

You could also try a different flash drive in case of a hardware issue.

1 Like

Oh I see, big difference! I will dig up another drive and try again tonight. It would have been interesting to see if that would have worked on the messed up flash but I over-reacted and it is no more. Now I’ll never know… Thanks for that sharp observation!

For sure that will make a big difference in copying to the flash drive. In fact, once this is done correctly, try booting in case it works for you even without a hybrid ISO. This seems to be the source of your original issue.

However, that’s independent of the issue of making the ISO a hybrid. Not sure if it’s a Windows specific problem, or the way the ISO was created from the disc, or something else. More experimentation and troubleshooting is needed.

If booting doesn’t work with the “burned” ISO file copied to a USB device, perhaps try creating the ISO file from scratch (maybe with a different tool, Gnome Disks has typically worked well for me), inspect with file, and then see what isohybrid does.

Most likely your old drive would still work after a proper dd or even just zeroing out via dd and then repartitioning on Linux. Tho you did create a sort of nested partition table, no wonder Windows was all up in arms hehe

Flash memory is just memory. AFAICT it doesn’t treat partition table data specially, just like a post-it note doesn’t know what’s the title and what’s the rest of the text. It’s just a bunch of ones and zeroes that only means something to the OS.

Well I found another drive and did

sudo dd bs=4M if=windows7_DVD.iso of=/dev/sda conv=fdatasync
960+1 records in
960+1 records out
4029304832 bytes (4.0 GB, 3.8 GiB) copied, 863.948 s, 4.7 MB/s

But sadly, it will not boot. Switched bios to legacy but still no luck. So what now? Think I can get this drive back? The computer with the dvd r/w now has the win7 on it so I will not be able to use any Fedora stuff to try to make another iso. I don’t think windows media player will write an image file… It would have to be something else. I will not be putting linux back on that machine for a while cause I need win7 for taxes. Thought about a dual boot but I’d have to relearn all that. Times tight. Hey thanks for the suggestions though.

Oh wait, I see the udf now. It shows up in the output for the device in mount:

~> mount

/dev/sda on /run/media/how2/GRMCULF(X)REO_EN-RU_DVD type udf (ro,nosuid,nodev,relatime,uid=1000,gid=1000,iocharset=utf8,uhelper=udisks2)

~> file “/run/media/how2/GRMCULF(X)REO_EN-RU_DVD”
/run/media/how2/GRMCULF(X)REO_EN-RU_DVD: directory

~> file /dev/sda
/dev/sda: block special (8/0)

@how0909,

  1. The most reliable and hassle-free way of making Windows install USB flash drive from an ISO I’ve found is using Rufus under Windows (on another machine under Windows, for example).

    https://rufus.ie/

  2. There’s also official windows program to do the same:

    https://www.microsoft.com/en-us/download/windows-usb-dvd-download-tool

    I’ve used it to create Windows 7 bootable DVD, but had trouble with Win10.

  3. Just for the broadening our perspectives, so to say, I’m quite sure I’ve used this recipe once successfully:

    linux - Fedora: Create windows 8.1 bootable USB - Super User

    I don’t think it’ll work with win7 though (but again, I’m not sure). I think it works with UEFI boot only (that’s why just unpacking files on a fat32 partition is enough, as suggested). Also I think it worked with earlier Win10 version for me, but a later one had an installation file more that 4 GB in size – and that couldn’t be written to or read from a fat32 partition. Again, not 100% sure, as I’ve tried it quite some time ago.

  4. Here’s another guide – with more details/explanations along the similar lines but using ntfs partition instead of fat32 one, and I think it’s good for BIOS boot. I haven’t tried / verified this one myself.

    Create a Bootable Windows 7 or 10 USB Drive in Linux

  5. I’ve tried WoeUSB myself – right now – and it created a Win7 USB for me without any errors. Moreover, I’ve tested it, and it booted successfully in BIOS mode.

    We can try to troubleshoot it erroring out in your case – if you want. I think)

    It also has it’s own github repo:

    GitHub - slacka/WoeUSB: WoeUSB is a simple tool that enable you to create your own usb stick windows installer from an iso image or a real DVD. It is a fork of Congelli501's WinUSB.

    And there’s a wiki there too, although I haven’t seen you particular error there (but I wasn’t very thorough, just looked briefly).


    One bit of useful information from the wiki regading hybrid iso discussion above:

    Why Not Just Using dd or cp ?

    Windows Installation Disk Images aren’t Hybrid ISOs , thus they won’t make USB storage bootable if it is rawly-written.

1 Like

Well thanks for all that…
Last night I first tried Rufus which was moving along but ended up failing. From log:
Extracting: F:\m0nkrus.nfo (3.5 KB)
Extracting: F:\setup.exe (109.8 KB)
Extracting: F:\sources$OEM$$$\SETUP\SCRIPTS\SetupComplete.cmd (2.3 KB)
Error reading UDF file /sources/$OEM$/$$/SETUP/SCRIPTS/SetupComplete.cmd

At that point I felt like I should try to create another iso from the DVD, but what to use in win7? But then I got my wind back and went over to the linux and tried the method described in https://superuser.com/a/743825
Good exercise if nothing else:) There things were looking ok until part way through copying the mounted iso to the mounted flash. Seems that cp craps out during the copy of this huge file which I to both listings for:

~>  ls -l /home/me/mnt/sources/install.wim
-r--r--r--. 1 nobody nobody 3676707402 Feb 22  2016 /home/me/mnt/sources/install.wim


~>  ls -l /media/flash/sources/i*
-rwxr-xr-x. 1 root root 3515035648 Mar 11 12:04 /media/flash/sources/install.wim

# after which come many "cp: error reading '/home/how2/mnt/xxx' : Input/output error

# still had plenty of space it seems:
~>  df /media/flash/
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/sda1        7800424 3958732   3841692  51% /media/flash

# so a look at dmesg so see what that says:

dmesg > yfile    #sample lines:

[41038.767965] loop0: rw=524288, want=8396032, limit=7869736
[41038.767970] attempt to access beyond end of device

 # All of yfile is that -  4502 lines of it!
# But the iso mount looks plenty large. and I can access the files on that ok.
~>  du -s  ~/mnt/
4273414 /home/how2/mnt/

Next I was going to try to copy that file alone and see if I could get through that but it stopped at the same point. Destination has same size: 3515035648. So what’s that mean? /dev/sda1 shows 7800424 blocks but I can only write to 3958732 ? Sounds like this flash is messed up now like the last one was.

@how0909, if both WoeUSB and Rufus are failing, then the reason can be in the iso file itself. I’ve used Rufus several times in the past (and read about it even more), it’s quite reliable.

I would suggest finding (or making) other iso file – if just to verify/rule out this suspicion.

You can just as well use Linux to make your ISO.

First of all, once more, WoeUSB has a handy option to make a bootable USB from the DVD disk directly (in addition to iso option you’ve already tried). You can try that one.

Second option is using gnome’s Disks application. With DVD inserted, choose it from the devices list on the left, then press button with three vertical dots in upper-right corner of the application window (next to eject button), and choose “Make a drive image” from the menu. It’ll make you an iso file from you DVD disk.

Third option is using dd in command line:

dd if=/dev/sr0 of=~/my_iso_file.iso status=progress

where

  • if= is the device name of your DVD Drive. It’s easy to see in the Gnome’s Disks GUI application or (a little less clear) in output of lsblk command – it’ll have type ROM there.

  • of= is the full path to the iso file you’re creating (in this case). In my example it’s a file in my home directory.

  • status=progress is optional, but will give you a nice feedback of the progress of the whole process. Without it dd just seems to hang there forever (while it’s actually doing it’s job in the background). I like this option very much :slight_smile:

Please note you don’t need (and even should not!) use sudo with dd in this case.


I’d suggest you to try copying this file to some temporary folder on your hard drive – for example, make a folder Win7_tmp in your Documents folder – and copy it there.

If the iso file is bad/corrupted in some way – then you’ll get the same or similar error – and you’ll be quite sure the iso file is the culprit (and not the USB drive or something else).

Also

this sort of hints that you have trouble with your iso. loop0 is the device iso file was mounted to, number for want is bigger than number for limit, and the next line hints that iso file srot of has it’s tail cut off – it says it’s bigger (want) than the actual size (limit) is. I’m no expert, am mostly guessing here – and of course I can be completely wrong – but that’s how I understand these two lines.

And if file can’t be read successfully – then of course you can’t write it too.

Also this would explain all your previous errors with WoeUSB and Rufus.

@nightromantic I think the OP’s DVD drive is on a Windows-only machine. I agree making another ISO is a good idea.

@how0909 You could search for ISO creating programs for Windows and/or pick through a Wikipedia list: Comparison of disc image software - Wikipedia Something that has Extract=Yes, Output=ISO, and OS=Windows. Of course the usual cautionary caveats apply when downloading and installing unknown software.

Yes, the DVD r/w is on a win7 laptop. On the rufus page there is a small section about creating an iso and it mentions a couple of programs for that. I downloaded and installed CDBurnerXP but won’t be able to try it until tonight. Btw, I did try to cp that file to a dir on the hard drive but it failed at the same byte and the failure notes a reading error:

~>  sudo cp -v /home/me/mnt/sources/install.wim  ~/Downloads/
'/home/me/mnt/sources/install.wim' -> '/home/me/Downloads/install.wim'
cp: error reading '/home/me/mnt/sources/install.wim': Input/output error

~>  ls -go /home/me/Downloads/install.wim
-r--r--r--. 1 3515035648 Mar 12 10:34 /home/me/Downloads/install.wim

So it looks like the iso is the problem.

@fasulia, @how0909,

– yes, I’ve missed that, sorry )

As the angle with iso creation on Windows is already covered, I’ll supply this though – just so you know Linux can help you even on a Windows machine sometimes ))

You can almost always boot from Fedora Live USB, do something you need, then reboot the computer to Windows again. If you won’t write files to your Windows partitions – then this operation won’t affect Windows installation at all. At times it’s very-very useful – even sometimes to recover from troubles with Windows itself.

Caveats apply, of course. There are some notebooks that won’t boot Linux Live USB or have some issues with it. But from my experience (not very extensive – meaning I haven’t had my hand on many various notebooks) most of them will boot and work reasonably well.

So you can make an iso file – and save it on another flash drive to avoid touching Windows partitions. It isn’t simpler than using Windows program – yes – but it’s an ok backup plan )

I strongly second this.