I am trying to get an ISO file from a bootable USB memory stick. The device name for the stick is dev/sdf1
. In this answer: Convert bootable USB to ISO file , dd
was suggested for copying. So I did:
sudo dd if=/dev/sdf1 of=win7.iso
However, the stick has a size of 30G, but only 12G are used. Running the command above, it creates an iso image larger than 12G, I stopped dd
when the file was > 20G, since I ran out of disk space.
Is it normal that the ISO file gets so big or is there another way to achieve my goal?
Best Answer
dd
is a 1:1 copy, it copies the entire device regardless what's on it. If you only copy a partition (sdf1
) it's unlikely to be bootable as the bootloader usually resides on sdf MBR.If the free space is zeroed, you could save the free space by use of gzip.
To zero the free space, you may use:
To create a gzip compressed image:
To restore from that image, it's:
Other alternatives are
partimage
orntfsclone
(in case of ntfs), which only store files, not free space, however the result may not be bootable as it's not a 1:1 copy.