Saturday, 30 November 2019

How to Mount/Access ISO File Contents on CentOS 7




ISO (International Organization for Standardization) format is an archive file format which mostly used to contains the complete image of an installation software’s CD or DVD, backups etc.

This article describes How to Mount/Access an ISO File on CentOS 7 by mounting as a loop device.

[root@linuxcnf ~]# ls -ltrh
…………………….
-rw-r--r--. 1 root root 918M Nov 30 14:39 CentOS-7-x86_64-Minimal-1810.iso
[root@linuxcnf ~]#

Step 1. Create Mount Point: Run the following command to create a directory to mount ISO file. It can be any location:

[root@linuxcnf ~]# mkdir -p /mnt/iso-file
[root@linuxcnf ~]#

[root@linuxcnf ~]# ls -ld /mnt/iso-file
drwxr-xr-x. 2 root root 6 Nov 30 14:25 /mnt/iso-file
[root@linuxcnf ~]#

Step 2. Mount the ISO File: Run the following command to mount the ISO file on above created directory as a loop device:

[root@linuxcnf ~]# mount -o loop CentOS-7-x86_64-Minimal-1810.iso /mnt/iso-file/
mount: /dev/loop0 is write-protected, mounting read-only
[root@linuxcnf ~]#

Step 3. ISO File is Mount Status: Verify the ISO file mount status by executing the following commands:

[root@linuxcnf ~]# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
…………………….
/root/CentOS-7-x86_64-Minimal-1810.iso on /mnt/iso-file type iso9660 (ro,relatime)
[root@linuxcnf ~]#

[root@linuxcnf ~]# df -h
Filesystem               Size  Used Avail Use% Mounted on
…………………….
/dev/loop0               918M  918M     0 100% /mnt/iso-file
[root@linuxcnf ~]#

[root@linuxcnf ~]# cd /mnt/iso-file/
[root@linuxcnf iso-file]# ls
CentOS_BuildTag  EFI  EULA  GPL  images  isolinux  LiveOS  Packages  repodata  RPM-GPG-KEY-CentOS-7  RPM-GPG-KEY-CentOS-Testing-7  TRANS.TBL
[root@linuxcnf iso-file]#

Done!!! ISO File is mounted successfully as a loop device and all the data contains to the ISO File are listed above.

No comments:

Post a Comment