RackNerd Billboard Banner

How to Convert an IMG File to ISO File in Linux

If you’ve ever downloaded a disk image in .img format and needed it as an .iso file, you’re not alone. While both are disk image formats, some software tools or virtual machines only accept ISO files. The good news? Linux makes it easy to convert between the two.

In this guide, we’ll walk through three simple ways to convert an IMG file to an ISO file on Linux — using the terminal.


🧩 What’s the Difference Between IMG and ISO?

Before diving in, here’s a quick breakdown:

  • .IMG: A raw disk image file, often used for USB drives or SD cards (like Raspberry Pi images).
  • .ISO: A standardized disk image format, mostly used for optical discs (CDs/DVDs) and compatible with more software tools.

Functionally, both store the same kind of data — but the formatting differs slightly. That’s why a simple rename won’t work.


🛠️ Method 1: Using dd (The Classic Way)

The dd command is a built-in Linux tool that copies and converts files at a low level. It’s simple and reliable.

Command:

dd if=input.img of=output.iso bs=4M

Explanation:

  • if= → input file (your .img)
  • of= → output file (your new .iso)
  • bs=4M → block size for faster copy (optional)

Example:

dd if=ubuntu.img of=ubuntu.iso bs=4M

That’s it — you now have an ISO version of your image file.


⚡ Method 2: Using cp (Quick Copy Trick)

If the IMG file is already in ISO format internally (which is often the case), you can simply copy it.

Command:

cp input.img output.iso

Note:
This works when the IMG file already contains an ISO9660 filesystem. If it doesn’t, the resulting file won’t function as a proper ISO.


🧰 Method 3: Using mkisofs (When You Need a True ISO Image)

If your IMG isn’t already an ISO structure, you can rebuild it properly using mkisofs.

First, mount your IMG file:

sudo mkdir /mnt/img
sudo mount -o loop input.img /mnt/img

Then, create an ISO from the mounted directory:

mkisofs -o output.iso -V "LabelName" /mnt/img

Finally, unmount the image:

sudo umount /mnt/img

This method ensures your ISO file is fully compliant and works everywhere.


✅ Verifying Your New ISO File

You can verify the conversion by checking the file type:

file output.iso

You should see something like:

output.iso: ISO 9660 CD-ROM filesystem data

If you see that line — you’re good to go.


🚀 Final Thoughts

Converting an IMG to an ISO file in Linux takes just one or two commands.
Here’s a quick recap:

MethodCommandBest For
dddd if=input.img of=output.iso bs=4MSimple, universal copy
cpcp input.img output.isoWhen IMG already contains ISO data
mkisofsmkisofs -o output.iso /mnt/imgWhen you need a fully structured ISO

Whether you’re prepping a virtual machine, a bootable disk, or archiving data, Linux gives you the flexibility to handle it with ease.


Tip: Always double-check your files with file or try mounting them before assuming the conversion worked. It saves headaches later.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
RackNerd Billboard Banner
© 2025 Computer Everywhere
Your Everyday Guide to the Digital World.
Terms of Service | Privacy Policy
Copy link