How to create ISO file from bootable Windows USB?

I have Windows installation pendrive.
I would like to make an ISO and be able to reuse it on another pendrive or with ventoy.

After searching an reading of man dd I tried:
dd if=/dev/sda of=Windows7.iso conv=sparse,fsync,noerror status=progress

The used space on pendrive is around 4GB but dd is trying to create iso file that has over 15GB (I canceled the process)

How can I achieve what I want?

You don’t have to - you can download the ISO from Microsoft

Hello @860lacov,

dd copies all from the source till the end exept you say where to stop. You can limit it with the count-option.

And did you write in your command if=/dev/sda and is /dev/sda really the origin of the pendrive?

So if you only want an ISO for windows installation @linux-aarhus suggestion seems to be the easiest. :wink:

I don’t have Extended Security Update so I can’t download WIndows 7

Thats why I tried sparse option in conv.

And yes. sda is my the origin of the pendrive. My system is on nvme… :wink:

Hm, ok. Perhaps there is still something written in the data blocks so dd thinks its no NULL-block. You dont use bs-option so your bs value should set to 512 as default. So I guess the solution in this link would not work.

Perhaps this will help you further:

You still can use the count-option if you are sure all the stuff is written at the beginning of the pendrive.

What says:

lsblk /dev/sda
1 Like
sda      8:0    1 28,9G  0 disk 
└─sda1   8:1    1 28,9G  0 part

You cannot create a ISO from an installed Windows 7.

The only thing you can do is to copy the wim file from the factory partition - if one exist.

Using ventoy you can boot Windows from a wim file.

You can also download the Windows 7 iso file somewhere in the internet.

E.g.: windows 7 iso download - Google Suche

I wanted to create ISO from bootable pendrive with Windows 7 installer

And if I don’t have Microsoft check sums, how can I check if the iso isn’t modified?

I have downloaded the Windows 7 SP1 from the internet and it works without any problem.
I also have Windows 7 SP1 DVD at home.

Just use dd to make a copy of the usb - then you can load it into a virtual machine

sudo dd if=/dev/sdxY of=/home/$USER/win.iso status=progress

the image can be written to another stick

sudo dd if=/home/$USER/win.iso of=/dev/sdy status=progress

But you can use Gnome disk to create an image of a partition using Gnome disks if you prefer gui.

Thats what he tried to do in the first post. But he wont have a image of 32GB size (which the pendrive is) cause ony 4GB are used.
So I mentioned to use dd’s count-option instead of conv=sparse.

With …

bs=32M count=128

it should only copy the first 4GB. But I dont know if this image will work.

Sorry - but: no

He used
dd if=/dev/sda
instead of the partition like suggested by @linux-aarhus

dd if=/dev/sdxY ...

Ah, ok thats right. But the filesize of the ISO will be the same I guess cause his sda1 takes the whole pendrive.

… apparently that is not so

I was intending to try this for myself - not sure whether it will be a valid comparison when using some Linux .iso
and I’d have to “destroy” (at least temporarily) my Ventoy stick in order to write an .iso directly to it
to then try to re-create that same .iso from what was written to the pendrive