Quote:
Originally Posted by sharadchhetri
Here I am mounting one .iso file .
This is a brief step by step. (/opt/test = old_dir and /opt/newtest = new_dir)
root@tuxworld:/# ls -l /opt/test/
total 0
root@tuxworld:/# ls -ld /opt/test/
drwxr-xr-x 2 root root 4096 Jul 15 17:15 /opt/test/
root@tuxworld:/#
root@tuxworld:/# mkdir /opt/newtest
root@tuxworld:/#
root@tuxworld:/# mount -o loop /root/CentOS6.3.iso /opt/test/
mount: warning: /opt/test/ seems to be mounted read-only.
root@tuxworld:/# ls /opt/test/
CentOS_BuildTag Packages RPM-GPG-KEY-CentOS-Security-6
EULA RELEASE-NOTES-en-US.html RPM-GPG-KEY-CentOS-Testing-6
GPL repodata TRANS.TBL
images RPM-GPG-KEY-CentOS-6
isolinux RPM-GPG-KEY-CentOS-Debug-6
root@tuxworld:/#
root@tuxworld:/# mount --bind /opt/test/ /opt/newtest
mount: warning: /opt/newtest seems to be mounted read-only.
root@tuxworld:/#
root@tuxworld:/# ls /opt/newtest
CentOS_BuildTag Packages RPM-GPG-KEY-CentOS-Security-6
EULA RELEASE-NOTES-en-US.html RPM-GPG-KEY-CentOS-Testing-6
GPL repodata TRANS.TBL
images RPM-GPG-KEY-CentOS-6
isolinux RPM-GPG-KEY-CentOS-Debug-6
root@tuxworld:/#
root@tuxworld:/#
root@tuxworld:/# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 28G 25G 2.2G 93% /
udev 2.0G 4.0K 2.0G 1% /dev
tmpfs 794M 884K 793M 1% /run
none 5.0M 4.0K 5.0M 1% /run/lock
none 2.0G 332K 2.0G 1% /run/shm
/dev/sda7 9.3G 1.2G 7.7G 14% /partition7
/dev/loop0 3.5G 3.5G 0 100% /opt/test
root@tuxworld:/#
|
Match the last output. You can understand what actually --bind do.
root@tuxworld:/# ls -l /opt/test/
total 528
-r--r--r-- 2 root root 14 Jul 7 14:11 CentOS_BuildTag
-r--r--r-- 2 root root 212 Jul 2 01:51 EULA
-r--r--r-- 2 root root 18009 Jul 2 01:51 GPL
dr-xr-xr-x 3 root root 2048 Jul 6 01:27 images
dr-xr-xr-x 2 root root 2048 Jul 6 01:26 isolinux
dr-xr-xr-x 2 root root 499712 Jul 7 14:13 Packages
-r--r--r-- 2 root root 1354 Jul 2 01:51 RELEASE-NOTES-en-US.html
dr-xr-xr-x 2 root root 4096 Jul 7 14:15 repodata
-r--r--r-- 2 root root 1706 Jul 2 01:51 RPM-GPG-KEY-CentOS-6
-r--r--r-- 2 root root 1730 Jul 2 01:51 RPM-GPG-KEY-CentOS-Debug-6
-r--r--r-- 2 root root 1730 Jul 2 01:51 RPM-GPG-KEY-CentOS-Security-6
-r--r--r-- 2 root root 1734 Jul 2 01:51 RPM-GPG-KEY-CentOS-Testing-6
-r--r--r-- 1 root root 3165 Jul 7 14:15 TRANS.TBL
root@tuxworld:/#
root@tuxworld:/# ls -l /opt/newtest/
total 528
-r--r--r-- 2 root root 14 Jul 7 14:11 CentOS_BuildTag
-r--r--r-- 2 root root 212 Jul 2 01:51 EULA
-r--r--r-- 2 root root 18009 Jul 2 01:51 GPL
dr-xr-xr-x 3 root root 2048 Jul 6 01:27 images
dr-xr-xr-x 2 root root 2048 Jul 6 01:26 isolinux
dr-xr-xr-x 2 root root 499712 Jul 7 14:13 Packages
-r--r--r-- 2 root root 1354 Jul 2 01:51 RELEASE-NOTES-en-US.html
dr-xr-xr-x 2 root root 4096 Jul 7 14:15 repodata
-r--r--r-- 2 root root 1706 Jul 2 01:51 RPM-GPG-KEY-CentOS-6
-r--r--r-- 2 root root 1730 Jul 2 01:51 RPM-GPG-KEY-CentOS-Debug-6
-r--r--r-- 2 root root 1730 Jul 2 01:51 RPM-GPG-KEY-CentOS-Security-6
-r--r--r-- 2 root root 1734 Jul 2 01:51 RPM-GPG-KEY-CentOS-Testing-6
-r--r--r-- 1 root root 3165 Jul 7 14:15 TRANS.TBL
root@tuxworld:/#