• Important: We recently upgraded our forum software - please let us know if you run into any issues.

ISO File Manipulation

Jarret B

Active Member
The ISO file is a standard (ISO-9660) to store data on optical media. In some cases the image is an exact duplicate of a disk. The data being saved can not only include the files themselves, but the folder structure, attributes of the files and boot information.
ISO files usually contain a copy of a CD or DVD. The ISO file may be compressed to save space but could be a true copy of sector-by-sector information making the ISO file the same storage size as the original media.
In this article we will cover the following points:

1. Creating an ISO File
2. Opening/Mounting an ISO File
3. Burning an ISO File
4. Extracting an ISO File to Multiple Drives

Creating an ISO File


Let’s look first at creating an ISO file with a Graphical User Interface (GUI). A common program on Linux systems is File-Roller (Archive Manager). The Title of the window is usually ‘Archive Manager’ but the program itself is call ‘file-roller’. You can install it by using the following command:

For Ubuntu/Debian:
Code:
sudo apt install file-roller -y
For Red Hat:
Code:
sudo yum install file-roller -y
Once File-Roller is installed then you only need to find the files you want to turn into an ISO. Keep in mind that the ISO can be a whole disk or a portion of it.
Select your files and folders, right-click on one and select ‘Compress...’. A window similar to Figure 1 will appear.

Figure 01.jpg

FIGURE 1

If you select the box to the right of the filename you can select something other than ‘.tar.gz’. One option is ‘.iso’ which is the extension we are looking for in this case. You can select the box under ‘Location’ to change where the ISO file will be saved. Once your settings are the way you want them you can click on ‘Create’ to make the ISO file.
File-Roller is a simple program to create an ISO file from folders and files. A drawback is that it is not a simple task to create an ISO from a CD/DVD which remains bootable.
For another option which allows bootable disks you can use Brasero. Most users see Brasero as a CD/DVD burning utility. Brasero will also allow you to ‘burn’ to an ISO image.
If you do not have Brasero pre-installed on your system you can perform one of the following:

For Ubuntu/Debian:
Code:
sudo apt install brasero -y
For Red Hat:
Code:
sudo yum install brasero -y
To create an ISO in Brasero you first open Brasero (see Figure 2). Once opened you select “Data Project”. Click the plus sign (+) at the upper left of the window (see Figure 3). In the next window select files and folders to add to the ISO. Continue to use the plus sign (+) until all of the content you want included in the ISO is completed. Once you have added all of the necessary files you can change the name of the ‘disk’. By default the new disk label will start with ‘Data disc’, followed by the current date. Delete the entry and change the label to what you prefer it to be. When all the settings are completed you can click on the ‘Burn’ button at the lower right. Another window will open to let you choose where the ISO file is to be saved. The very top of the window is a text entry box to let you change the name of the ISO file to be saved. Make your changes and then select ‘Create Image’. Another screen should appear to show the progress of the ISO creation.

Figure 02.jpg

FIGURE 2


Figure 03.jpg

FIGURE 3


For bootable disks you can make a bootable ISO image. Insert your bootable CD/DVD into your drive and open Brasero. Once opened you will need to select ‘Disc Copy’. The next window should show the inserted disk under ‘Select disc to copy’, otherwise select the appropriate disc. The second option is ‘Select a disc to write to’ so make sure it is set as ‘Image File’. Select ‘Properties’ to finish the settings for the ISO file. A window should appear asking where to save the file as well as a file name. Be sure to change the ‘Disc Image Type’ option to ‘ISO9660 image’ for the ISO format. Click on ‘Save’ once you have set everything as you need. Finally, select the ‘Create Image’ button to start the duplication. Once the copy is completed you should have a bootable ISO file.
An issue may arise that you have a USB drive from which you want to make an ISO image. In this case you will need an ISO generator that will work with a whole drive, even if it contains multiple partitions. To do this you will need the ‘gnome-disks’ program called ‘Disks’. To install the program use one of the following:

For Ubuntu:
Code:
sudo apt install gnome-disk-utility -y
For a Red Hat system the command is:
Code:
sudo yum install gnome-disk-utility -y
Open ‘Disks’ as shown in Figure 4. Select the drive you wish to image and then select the button with the 3 lines in the upper-right corner and select ‘Create Disk Image’. You will be prompted for a name (make sure the extension is ISO). You can also set the location of the file to be saved. Once set click on ‘Start Creating...’. Depending how large the drive is will determine the time it will take to create the image. Now you have an ISO of a USB Drive.

Figure 04.jpg

FIGURE 4


Opening/Mounting an ISO File

ISO files can be opened and certain or all files extracted from it. In this case you can use File-Roller for simple extractions. Right-click on the ISO and select to open it with Archive Manager (File-Roller). Within the Archive Manager list you can select single files or use the CTRL key and select multiple files and folders. Once you have made your selection you can drag-and-drop the selection to the folder in which you wish to extract them. You can also click on the ‘Extract’ button at the top of the window and then select the Target location for the extraction.
Mounting an ISO file is using that file and having it seen as if it were a CD/DVD without burning it. An ISO can be mounted on a system even if it does not have a CD/DVD drive.
If you should right-click on an ISO file you may see the option to ‘Open with Disk Image Mounter’. If the option is not present then you should try the following command (this is the same ‘gnome-disk-utilty’ from above):

Code:
sudo apt install gnome-disk-utility -y
For a Red Hat system the command is:
Code:
sudo yum install gnome-disk-utility -y
Once installed you should then see the option on a Ubuntu system. Select the option for ‘Open with Disk Image Mounter’ and it should be mounted and appear in your drive list as a CD/DVD since it is read-only. At this point you can copy files and folders from the mounted image or even use it in VirtualBox or QEMU as if it were physical media.
To unmount the ISO file you simply select to eject it as you would a USB drive.

NOTE: ISO files cannot be deleted or moved while they are mounted.

Burning an ISO File

Once an image is made of a disk or of files and folders it can be burned to optical media for use later. Once you have your ISO file you open Brasero and select the button ‘Burn image’. Select the button to ‘Click here to select a disk image’. A window will appear that will allow you to select your ISO file. Then you can select the disk to which you want to write the image. You must have a writable CD/DVD drive for this to work (as well as a blank disk). Click the ‘Properties’ button to change the write speed. Press the ‘Burn’ button to proceed with the image burn.

Extracting an ISO File to Multiple Drives

Sometimes you may want to extract an image to a USB drive or in this case multiple drives at once.
For this procedure we will use the command-line. Keep in mind that there are programs which will perform this procedure such as Etcher.
To install Etcher you can download it from https://www.balena.io/etcher/. Save the file and once the download completes you can open the folder where it was saved. The file is a compressed ZIP file. Right-click it and select to extract it using Archive Manager. A new file should appear called ‘balenaEtcher-1.5.19-x64.AppImage’. Double-click on the file to start it and you should see a window similar to Figure 5.

Figure 05.jpg

FIGURE 5


Click on ‘Select Image’ and find your ISO file. Then press the ‘Select Drive’. Choose your USB drive to which you want to burn the image. Be aware that the drive will be erased and all data on it will be lost. If the ISO is bootable then the USB drive should be bootable as well. When ready select the button ‘Flash!’ to write the ISO file to the selected drive.
If you should want to copy an ISO to multiple USB drives then you can use the following command:

Code:
sudo (dd if=/path/file.iso of=/dev/sdx) & (dd if=/path/file.iso of=/dev/sdy) & (dd if=/path/file.iso of=/dev/sdz status=progress)
More drives can be added be sure the last part of the command always includes the ‘status=progress’. If you know the size of the ISO file then you can watch the progress indicator which will show the number of bytes copied. Once done all of the drives should have an exact image as the source of the ISO. If the ISO is bootable then each USB drive should be bootable as well.
For an example, I made an image from a bootable USB drive made as a full install using Disks from above. The drives are mounted as ‘sdk’, ‘sdl’, ‘sdm’ and ‘sdn’. My ISO file is in the current folder and named ‘ChromeOSUSB32.iso’. My command would be:

Code:
sudo (dd if=ChromeOSUSB32.iso of=/dev/sdk) & (dd if=ChromeOSUSB32.iso of=/dev/sdl) & (dd if=ChromeOSUSB32.iso of=/dev/sdm) & (dd if=ChromeOSUSB32.iso of=/dev/sdn status=progress)
Check the file size before you start as well as the USB Thumb Drives. If the ISO is larger, even by a few bytes, then it must be reduced. To reduce the ISO file you can use the truncate command as follows:

Code:
truncate -s -1G ./ChromeUSB32.iso
In this case I am in the same folder as the ISO file and I am reducing the file by 1 GB. Once the image has been placed on a drive you can use ‘GParted’ to increase the partition to maximum capacity.
This information should help you with many aspects of dealing with ISO files.
 


rado84

Active Member
That's a very useful and informative post there! But I gotta add something about file-roller because I have it pre-installed in my distro and I already tried creating an ISO with it. Aaaand... it didn't work. Probably because there was a 'dosdevices' folder in the main dir (the one I was trying to make the ISO from). The directory in question is a Windows game with wine prefix which contains a folder named 'dosdevices' (I wanted to make an ISO file from it, so that the next time I wanna play that game I won't have to configure everything again). So, with such a folder inside the source directory, an ISO can't be created. Only AcetoneISO (frontend) with xorriso (backend) can make an ISO file from the source dir.
 

Jarret B

Active Member
Like everything else it seems.... there are always exceptions.
 

Members online



Top