There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Sonotsugipaa ,
@Sonotsugipaa@lemmy.dbzer0.com avatar

No, directories without anything mounted on them are normal directories - which checks out, since you can mount anything anywhere; unlike Windows volume letters, which only exist when volumes are mounted or detected by the OS.

When you mount a filesystem onto a directory, the OS “replaces” its contents AND permissions with that of the filesystem’s root.

Here’s an example with my setup (hopefully you’re somewhat familiar with Bash and the output of ls -l).

Imagine some random filesystem in /dev/sda1 owned by “user” which only contains a file named “/Hello World.txt”:


<span style="color:#323232;">$ # List permissions of files in /mnt:
</span><span style="color:#323232;">$ # note that none of the directories have read, write nor execute permissions
</span><span style="color:#323232;">$ ls -la /mnt
</span><span style="color:#323232;">drwxr-xr-x   1 root root          168 May 31 23:13 .
</span><span style="color:#323232;">drwxr-xr-x   1 root root          128 May 31 23:14 ..
</span><span style="color:#323232;">d---------   1 root root            0 Aug  1  2020 a/
</span><span style="color:#323232;">d---------   1 root root            0 Feb 11  2022 b/
</span><span style="color:#323232;">d---------   1 root root            0 Aug 11  2021 vdisks/
</span><span style="color:#323232;">
</span><span style="color:#323232;">$ # No read permission on a directory => directory entries cannot be listed
</span><span style="color:#323232;">$ ls /mnt/a
</span><span style="color:#323232;">cannot open directory '/mnt/a': Permission denied
</span><span style="color:#323232;">
</span><span style="color:#323232;">$ sudo mount /dev/sda1 /mnt/a
</span><span style="color:#323232;">
</span><span style="color:#323232;">$ # List again the permissions in /mnt: the root of /dev/sda1
</span><span style="color:#323232;">$ # has rwxr-xr-x (or 755) permissions, which override the 000 of /mnt/a ...
</span><span style="color:#323232;">$ ls -la /mnt
</span><span style="color:#323232;">drwxr-xr-x   1 root root          168 May 31 23:13 .
</span><span style="color:#323232;">drwxr-xr-x   1 root root          128 May 31 23:14 ..
</span><span style="color:#323232;">drwxr-xr-x   1 root root            0 Aug  1  2020 a/
</span><span style="color:#323232;">d---------   1 root root            0 Feb 11  2022 b/
</span><span style="color:#323232;">d---------   1 root root            0 Aug 11  2021 vdisks/
</span><span style="color:#323232;">
</span><span style="color:#323232;">$ # ... and its contents can be accessed by the mounted filesystem's owner:
</span><span style="color:#323232;">$ ls -la /mnt/a
</span><span style="color:#323232;">drwxr-xr-x   1 user user          168 May 31 23:13 .
</span><span style="color:#323232;">drwxr-xr-x   1 root root          168 May 31 23:13 ..
</span><span style="color:#323232;">-rw-r--r-- 1 user user   0 Jul  4 22:13 'Hello World.txt'
</span><span style="color:#323232;">
</span><span style="color:#323232;">$ find /mnt
</span><span style="color:#323232;">/mnt
</span><span style="color:#323232;">/mnt/a
</span><span style="color:#323232;">/mnt/a/Hello World.txt
</span><span style="color:#323232;">find: ‘/mnt/b Permission denied
</span><span style="color:#323232;">find: ‘/mnt/vdisks’: Permission denied
</span>

Please note that me setting permissions is just extreme pedantry, it’s not necessary at all and barely changes anything and if you’re still getting familiar with how the Linux VFS and its permissions work you can just ignore all of this.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines