59

My laptop comes with a program called "Acer Recovery Management", which allows you to make a bootable recovery USB stick, from which you can boot to recover the computer to its original state.

Now, of course (I don't know why Acer didn't think about this) I don't want to give up a perfectly usable USB stick – which BTW needs to be at least 16 GB – to be a 'recovery disk' that I will probably never use anyway. But I still want to make it, just in case.

So, is there a way to convert the data on this bootable USB to an ISO file (or format), so that I can keep it on an external hard drive somewhere instead of a USB stick, and in case of problems convert the ISO back into a bootable USB with e.g. unetbootin?

JW.
  • 1,376

3 Answers3

61

To create an image from a drive

sudo dd if=/dev/sdx of=/path/to/new.iso

Alternatively, to create a USB drive from an image

sudo dd if=/path/to/iso of=/dev/sdx

Replace /dev/sdx with your USB drive, e.g. /dev/sdc.

WARNING: It is imperative that you make certain you are using the correct drive. If you don't use the correct drive, you could lose your data. To check your currently mounted drives, use the command lsblk.

Note: Copying large files (1 GB or higher) can take a long time, be patient.

camconn
  • 1,844
  • 2
    Have you tried it sometime? – user35443 Jan 13 '13 at 18:11
  • 5
    @user35443 I've used this method to create duplicate SD drives for my Raspberry Pi's – camconn Jan 13 '13 at 18:34
  • 6
    I can see that the it's only half of the pen drive actually used (around 2GB in a 4GB device). How can I produce an ISO that stores only the area that is used, instead of the full 4GB one? – nightcod3r Oct 24 '16 at 21:34
  • 2
    nightcod3r, just pipe it through gzip $> dd if=/dev/yourDevice bs=1M | gzip > /path/to/new.iso.gz – Wolfgang Dec 27 '16 at 20:36
  • 1
    Add bs=4M status=progress to make IO faster and see write progress. Command will look like sudo dd if=/dev/sdx of=/path/to/new.iso bs=4M status=progress. – MainActivity Dec 04 '18 at 13:41
  • 2
    I don't think this works. VirtualBox chokes on ISO's created this way saying it's an unreadable boot medium. – irwinr Jan 16 '19 at 18:33
  • 1
    Just a FYI. I attempted dd ... bs=4M status=progress which shows the progress. And then I noticed that the data transfer rate was initially OK (at 10+ MB/s on a USB2 device), but then somehow dropped to crawling (at several KB per second) when reading the supposedly empty data. So, it was not practical. Regardless, I doubt whether this would actually work. dd can be a backup/restore tool, but its raw output format would not necessarily be ISO9660 format. @irwinr voiced same concern above. – RayLuo Nov 29 '20 at 02:24
24

Another option is to use gnome-disks.

You can start if from a terminal with gnome-disks or look for the application Disks in the Dash.

Once the USB stick is mounted, select it and use the more actions icon to choose Create Image.

Disks is a GUI for the same command.

chaskes
  • 15,246
user171754
  • 241
  • 2
  • 2
3

"USB Image Tool" is a freeware for Windows which can create images of your BOOTABLE USB flash drives and also allows you to restore them later. This free tool can be used to create backup images of almost all types of BOOTABLE USB devices such as flash drives, card readers, digicams, cell phones and mobile music players.

Its a portable tool so you don't need to install it. Just download and run the program. Using the program is very easy. You can create the backup or restore the backup in a few clicks.

It can be used in Windows XP, Vista, Windows 7 and Windows 8. Both 32-bit and 64-bit editions are supported.

You can download it using following link: http://www.alexpage.de/usb-image-tool/download/

Jhilmil
  • 31
  • 1
    Tried it today, works fine. Used Universal Usb Installer to create the bootable Ubuntu 16.04.1 usb. Will use this utility in Windows to create restore points of Ubuntu on another disk. Made backup, corrupted usb, restored: had a working version. – Martin Feb 02 '17 at 15:19
  • 2
    Generates an IMG file, not ISO as requested by OP – K7AAY Aug 29 '18 at 15:15