The use of mount -- bind often encounters the following situation during Firmware Development: to test a new function, you must modify a system file. This file is stored in a read-only File System (you cannot refresh the firmware for a small test), or although the file can be written, you are not sure about the change and do not want to modify it directly. In this case, mount -- bind is your helper. Assume that the file we want to change is/etc/hosts. perform the following steps: 1. Put the new hosts file under/tmp. Of course, it can also be placed on a hard disk or a USB flash disk. 2. mount -- bind/tmp/hosts/etc/hosts test is complete. Run umount/etc/hosts to disconnect the binding. What if I need to add an exports file under/etc? This file does not exist and cannot be directly bind. We have two methods: Method 1: bind the entire/etc directory, copy/etc # cp-a/etc/tmp # mount -- bind/tmp/etc before binding. At this time, the/etc directory is writable, the modification will not be applied to the original/etc directory, so you can test it with confidence. Method 2: mount ramfs to/etc. Also, copy/etc to mount ramfs # mkdir/tmp/etc # mount-t ramfs none/tmp/etc to copy/etc, we cannot use cp-a here. Instead, use tar # cd/etc # tar cf -. | (cd/tmp/etc; tar xf-) # cd/overwrite/etc # mount -- move/tmp/etc after testing, remember umount/etc