2

I deleted the original iso and would like to retrieve it without having to download it again.

If possible, the preferred way would be to create an iso around the same size as the original, using only the size of the files and not the size of the usb device.

1
  • How did you create the live USB drive (which tool did you use)?
    – sudodus
    Mar 1, 2018 at 12:04

2 Answers 2

1

Use dd to create an iso :

sudo dd if=/dev/sdx of=/path/file.iso

Where /dev/sdx is you liveUSB.

See Convert bootable USB to ISO file

4
  • The dd method of /dev/sdx creates an iso the size of the usb device. Adding a parttion number, as in /dev/sdx1, does create an iso around the original size. Will check if it is a functioning iso.
    – merlecka
    Mar 1, 2018 at 11:23
  • Hmm, I think you gonna skip the partitioning scheme/boot loader of your liveUSB with that method (see : unix.stackexchange.com/a/325314 and askubuntu.com/a/860580/798765 ). Mar 1, 2018 at 12:01
  • By that, I mean (and correct me if I'm wrong, all of those stuff are far too complicated for a simple mind like mine;) if you lsblk a liveUSB, you've got at least 2 partitions : one for your OS itself and one with the bootloader (that will be eventually mounted as "/boot"). If you take and "dd" only one of the partition (let's say the bigger one), you skip the other (ie the bootable one). Mar 1, 2018 at 12:05
  • 1
    @merlecka, SimonVanMachin is right.
    – sudodus
    Mar 1, 2018 at 12:10
1

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)
    • dd

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .