
Learn through the super-clean Baeldung Pro experience:
>> Membership and Baeldung Pro.
No ads, dark-mode and 6 months free of IntelliJ Idea Ultimate to start with.
Last updated: October 22, 2023
In this tutorial, we’ll discuss how to convert CUE, BIN, and IMG images to an ISO file. We’ll also see how to combine multiple images and create a single ISO out of them.
For this task, we’ll take a look at different utilities such as iat and bchunk.
The bchunk utility converts BIN and IMG CD images to ISO tracks. The track contains an ISO filesystem that we can mount as a loop device on Linux.
bchunk isn’t available on most Linux distributions by default. However, we can install it from our distribution’s official package repository using the name bchunk.
On Debian and Ubuntu-based distributions, we can use apt:
$ apt install bchunk
On RHEL and Fedora, we can use yum:
$ yum install bchunk
Once bchunk is installed, we can use the utility via the bchunk command.
bchunk follows a straightforward syntax:
$ bchunk myimage.img myimage.iso
Similarly, we can specify the CUE and BIN images as well. However, we should know that if our BIN image contains any CD-Audio tracks, then bchunk will fail to convert it.
The reason for this is that the CD-Audio data structure is incompatible with the ISO file system. In this scenario, we can consider using other utilities like bin2iso.
We can pass in multiple images as input to create a single ISO out of them:
$ bchunk *.cue *.img final.iso
iat is a convenient utility for analyzing and detecting the structure of popular image formats. Not only that, but it can also convert the supported images into an ISO-9660 image format.
Besides the ISO-9660 format, it also supports BIN, MDF, PDI, CDI, NRG, and B51 formats.
iat doesn’t come preinstalled on most Linux distributions. However, we can install it from our official package repository.
On Ubuntu-based distributions, we can install using the package name iat:
$ apt install iat
Similarly, on Fedora and RHEL, we can use yum:
$ yum install iat
Once installed, let’s verify it:
$ iat --version
Iso9660 Analyzer Tool v0.1.7
We can simply specify the input and output image file to iat:
$ iat --iso -i file.img -o file.iso
Let’s understand the command’s arguments:
If we’re dealing with an IMG image file, we should know that there is no fundamental difference between the ISO and IMG structure if the IMG file is uncompressed. The only difference between them is the extension.
Therefore, we can simply treat an uncompressed IMG file as an ISO file by changing its extension:
$ mv file.img file.iso
Then, we can use ISO software to access the data inside the image. For instance, we can mount the image and read data from it:
$ mount -o loop ~/file.iso /media/mount_point
In this article, we learned how we can convert CUE, BIN, and IMG image formats to the standard ISO-9660 format. First, we looked at the bchunk utility to convert single and multiple images. Then, we discussed the iat utility as an alternative to the bchunk utility.
Finally, we saw that there’s no difference between the ISO and IMG formats apart from the file extension.