Tuesday, April 12, 2016

RHEL7 - How to mount RHEL7 OS ISO Image file

How to mount RHEL7 OS image file

1. Create a mountpoint
# mkdir /rhel7

2. For temporarily mounting
# mount -o loop /opt/OS_Image/rhel-server-7.2-x86_64-dvd.iso /rhel7
mount: /dev/loop0 is write-protected, mounting read-only

3. Verify your mount
# df -h /rhel7
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0      3.8G  3.8G     0 100% /rhel7

4. Unmount
# umount /rhel7

5. To survive reboots, add entry to fstab
# cp -p /etc/fstab /etc/fstab.bk-up
# cat >>/etc/fstab
/opt/OS_Image/rhel-server-7.2-x86_64-dvd.iso    /rhel7  iso9660 defaults,loop   0 0

6. Mount the mountpoint. Since you have entry to fstab, you can just mount with mountpoint.
# mount /rhel7
mount: /dev/loop0 is write-protected, mounting read-only

7. Verify the mount
# df -h /rhel7
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0      3.8G  3.8G     0 100% /rhel7



No comments:

Post a Comment