It depends how you created the live USB drive.
Cloned system
If you cloned the iso file, you can 'clone back' from the USB drive to an iso file. dd
can be used for this purpose, but it is risky. Please check and double-check, that you write to the iso file.
sudo dd if=/dev/sdx of=/path/file.iso
where /dev/sdx
is the block device specifying your live USB drive. You can identify the device with the following commands
sudo lsblk -f
sudo lsblk -m
sudo parted -ls
and replace x with the actual device letter. A cloned Ubuntu system has an iso 9660 file system.
This is the same method as what is recommended in the answer by @SimonVanMachin. See also this link,
Convert bootable USB to ISO file
A disadvantage of this method is that it will create an iso file that is as big as the USB pendrive, but the active content (drive head and partitions) can be much smaller. When you identify the device letter, you will also get information about the active content. Standard Ubuntu iso files are smaller than 2 GiB, so you can copy only the first 2 GiB with the following command
sudo dd if=/dev/sdx of=/path/file.iso bs=1M count=2k
- Cloning tools with a final checkpoint
- The Ubuntu Startup Disk Creator alias
usb-creator-gtk
- Disks alias
gnome-disks
- mkusb (for linux live-only drives)
- Win32 Disk Imager (in Windows)
- Cloning tool without a final checkpoint (dangerous)
Extracted system
If you extracted the system and modified the structure compared to the iso file, I think it will be much easier to download the iso file again than to create a working iso file from the system on the USB drive.
- Extracting tools
- Unetbootin
- mkusb (for linux persistent live drives and for Windows install drives)
- Rufus (in Windows)
But it is possible to create a general image
Instead of creating an iso file, you can create a general image (.img
file or compressed .img.gz
file) or a Clonezilla image. You can restore such an image to a USB pendrive (of at least the same size), but it will not work from a DVD disk.
$ sudo -s
# dd if=/dev/sdx bs=4096 | gzip -c /path/file.img.gz
# exit # remember to exit from sudo
I would recommend to make a Clonezilla image. It is safer and faster, because Clonezilla is only copying the used blocks (it skips blocks that are not used by partitions and file systems except the head of the drive). This means that the image will also be as small as possible. A Clonezilla image is a directory with a number of files, where the big files are compressed.
You find Clonezilla iso files as well as documentation at the following link,
http://clonezilla.org