On 7/17/17 @bingbomboom asked this question about creating a permanent /etc/fstab
entry for an external drive. My head spun thinking about this next question. Instead of hijacking its thread, I'm starting fresh. I'm not focusing on re-establishing connectivity for the external drive—I'm wondering about what happens to existing files on the internal drive.
Suppose I have an internal drive on an iMac for my Documents
with a file int.txt.
I have an external drive with a file ext.txt,
at its root. Both files are accessible.
If I mount the external drive's root at my internal drive's Documents
location, what happens to int.txt
? It's an interesting grey area to me that makes my head spin. The file int.txt
used to be in the Documents
folder, but if I point to Documents
to see what's there, MacOS now logically points to the root of the external drive and my brain tells me int.txt
will disappear and I'll only be able to see ext.txt
.
Meanwhile, I can't imagine int.txt
quietly disappears as in it gets deleted, so it has to be safe, somewhere, but… where?
Does it go into some form of digital limbo? How do I access it now?
Then, when I unmount the directory, will int.txt
still be there?
Something tells me that a particular instance of the ls
or cp
or mv
commands invoke the file's physical location and not its logical location, and that that logical vs. physical difference is the additional awareness that will stop my head from spinning.
I'm just looking for someone smarter than me to set me straight. Thanks.
rm
or mount over the directory).int.txt
depends on whether theunion
option is specified when mounting. When I tested with theunion
option using APFS volumes, I was able to read and removeint.txt
, but was not able to write toint.txt
. Attempting a write resulted in the creation of a newint.txt
file on the external drive. This new file then masked theint.txt
file on the internal drive.