HOW TO MOUNT AN ISO IMAGE IN LINUX
ISO Image file is like Container which contains all required materials or in simple word its an Screw Driver box which contains all different shape of bit’s for different Screws, Like that ISO Image file is an archive of files and directories like tar in Linux, which may contains video/Audio files, Operating System Supporting files and directories, May be games and so on…ISO file can be identified by a file with extension “.iso“.
Example : ubuntu-16.10-desktop-amd64.iso
As we can see in Example ubuntu-16.10-desktop-amd64.iso is an iso file with extension “.iso” which contains all required supported file and directories of Ubuntu Operation System.
There are so many Third party applications are available to create or extract .iso files, But Today in this topic we are going to discuss how to mount an iso file in Linux.
Follow the Steps to Mount ISO Image in Linux
To Mount iso image, first we need a .iso file, I have one iso file as shown below.
# cd /app/ # ls ubuntu-16.10-desktop-amd64.iso
Step: 1 Create a mount point
Create a Directory in /mnt or any where else where you want to mount the .iso file, Now go to the path where you have your .iso file (For Example i have my .iso file under /app directory).
# mkdir /mnt/ubuntu # Create a Directory in /mnt # cd /app/ # Go to the Path of .iso file # ls ubuntu-16.10-desktop-amd64.iso
Step: 2 Mount the .iso File
The command to mount the .iso file would look like this :
mount -t iso9660 -o loop <Path of the .iso file><Path of the Mount Point >
Follow the command below.
# Use the below command to mount the .iso file [root@localhost app]# mount -t iso9660 -o loop /app/ubuntu-16.10-desktop-amd64.iso /mnt/ubuntu/
-t : Used to Indicate the File System Type.
iso9660 : It is an Standard by International Organisation Standardiztion (ISO) for Medias (CD/DVD).
-o : Options are specified with a -o flag followed by a comma separated string of options.
loop : It is a pseudo-device or a fake device that is allow you to mount a file and makes a file accessible as a block device. Loop devices are often used for ISO images. We can check the mounted devices by below command.
Step: 3 Check mounted .iso File
We can check mounted device by df -h command as shown below.
[root@localhost ubuntu]# df -h # Check mounted Devices /app/ubuntu-16.10-desktop-amd64.iso 1.5G 1.5G 0 100% /mnt/ubuntu
Now we can go to “/mnt/ubuntu” where we mounted the .iso file to check the content of the file.
[root@localhost ~]# cd /mnt/ubuntu/ [root@localhost ubuntu]# ls boot casper dists EFI install isolinux md5sum.txt pics pool preseed README.diskdefines ubuntu
So we are able to mount the .iso file successfully by following above steps but this is Temporary Mounting means once we restart the system the mount point will gone and we have to remount it if we need that.
Step: 4 Permanently Mount the .iso File
But if you want to mount the .iso file permanently then we have to mount it on “/etc/fstab” file, So let’s have look on steps below.
The Pattern to enter the .iso permanent mount would look like this :
<Path of the .iso File> <Mount Point> <iso9660> <loop> 0 0
So As per our Secnario :
/app/ubuntu-16.04.1-desktop-amd64.iso /mnt/ubuntu iso9660 loop 0 0
Then refresh the mount table by mount -a Command.
You can Unmount the ISO image by below command.
[root@localhost ~]# umount /mnt/ubuntu
So this is how we can mount the ISO image file in Linux, For any Query Please feel free to comment on comment box below.