ISO images are digital copies of optical discs, like CDs, DVDs, or Blu-ray Discs, commonly used for archiving purposes. These image files typically have the extensions .iso or .img and follow the ISO 9660 filesystem format.
In Linux, you can view and copy the contents of an ISO image without burning it to an optical disc by mounting the image file to a directory. This can be done from the terminal.
Steps to mount ISO image file in Linux:
- Create a temporary directory to mount the ISO file.
$ mkdir temp
- Verify that the ISO image file is in the correct format.
$ file ubuntu-19.10-live-server-amd64.iso ubuntu-19.10-live-server-amd64.iso: DOS/MBR boot sector; partition 2 : ID=0xef, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 1391610, 7936 sectors
- Mount the ISO image file to the temporary folder using the iso9660 filesystem type.
$ sudo mount -t iso9660 ubuntu-19.10-live-server-amd64.iso temp/ [sudo] password for user: mount: /home/user/temp: WARNING: device write-protected, mounted read-only.
The ISO image is mounted as read-only, thus the content could only be viewed or copied over to different location.
- Explore the contents of the ISO image file.
$ ls -l temp/ total 76 dr-xr-xr-x 1 root root 2048 Oct 17 13:33 boot dr-xr-xr-x 1 root root 2048 Oct 17 13:34 casper dr-xr-xr-x 1 root root 2048 Oct 17 13:33 dists dr-xr-xr-x 1 root root 2048 Oct 17 13:33 EFI dr-xr-xr-x 1 root root 2048 Oct 17 13:33 install dr-xr-xr-x 1 root root 34816 Oct 17 13:33 isolinux -r--r--r-- 1 root root 25363 Oct 17 13:34 md5sum.txt dr-xr-xr-x 1 root root 2048 Oct 17 13:33 pics dr-xr-xr-x 1 root root 2048 Oct 17 13:33 pool dr-xr-xr-x 1 root root 2048 Oct 17 13:33 preseed -r--r--r-- 1 root root 232 Oct 17 13:33 README.diskdefines lr-xr-xr-x 1 root root 1 Oct 17 13:33 ubuntu -> .
- Copy or view the desired contents from the ISO image file.
$ head temp/dists/stable/Release Origin: Ubuntu Label: Ubuntu Suite: eoan Version: 19.10 Codename: eoan Date: Thu, 17 Oct 2019 12:37:49 UTC Architectures: amd64 i386 Components: main restricted Description: Ubuntu Eoan 19.10 Acquire-By-Hash: yes
- Leave the mount directory.
$ cd
- Unmount the ISO file from the mount directory.
$ sudo umount temp/
- Delete the temporary mount directory.
$ rmdir temp/
Author: Mohd
Shakir Zakaria
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Discuss the article:
Comment anonymously. Login not required.