HOW TO MOUNT AN ISO IMAGE IN LINUX
ISO 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 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“.
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.
So Let’s have look at steps below…..
[root@localhost ~]# cd /app/ [root@localhost app]# ls ubuntu-16.10-desktop-amd64.iso
Now let’s try to mount the .iso file by below command.
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), then mount it using below command.
[root@localhost ~]# mkdir /mnt/ubuntu # Create a Directory in /mnt [root@localhost ~]# cd /app/ # Go to the Path of .iso file [root@localhost app]# ls ubuntu-16.10-desktop-amd64.iso
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.
[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.
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.