Where is a file actually located in case of bind mounts
0
votes
0
answers
190
views
I have a rooted phone with Magisk 20.1 running on it. Inspired by this answer on Unix SE , I successfully created a bind mount using Termux. It was between a folder on external SD card and one in the internal storage. The commands executed are as below:
>su
>mount -o bind /storage/6333-6461/Books /storage/emulated/0/Books
The original folder in SD card is about 9GB, and my phone memory had only 1.2GB free. Needless to say, thanks to the Linux architecture, there was no problem because the folder in internal storage was just pointing to the one in SD card.
Now, I placed a test file in
/storage/emulated/0/Books
, and it was instantly visible in the original folder in SD card.
Then I removed the bind mount using the command >umount /storage/emulated/0/Books
. I found that the test file was still there in the original folder in SD card.
My question is: When I placed the test file in the bind mount before unmounting, where was it _actually_ located: in internal storage or external SD card? If I place a large file in the bind mount (i.e. in /storage/emulated/0/Books
), where will the file take up space: in the internal storage or the SD card?
Asked by Wrichik Basu
(967 rep)
Nov 17, 2019, 02:23 PM