Score:0

Linux changes mount point permissions after reboot

us flag

This is specifically on Ubuntu 20.04, but I believe the behavior is common:

Please take this fstab entry, creating a read-only mount:

/data/testDir/iso/ubuntu-20.04.4-live-server-amd64.iso /data/testDir/mnt iso9660 ro 0 0

Here is the related directory structure for that:

# ls -l /data/testDir/
drwxr-xr-x 2 root root   50 Apr  7 22:07 iso
drwxr-xr-x 1 root root 2048 Feb 23  2022 mnt

Everything mounts fine: mount /data/testDir/mnt works as expected.

However, upon a reboot, the permissions change on the mount point:

# ls -l /data/testDir/
drwxr-xr-x 2 root root   50 Apr  7 22:07 iso
dr-xr-xr-x 1 root root 2048 Feb 23  2022 mnt

This sort-of makes sense since it's a read-only mount, but it works either way, and this caused an unexpected failure in my CI/CD/Config mgmt system when the permissions changed to 0555 on that mnt directory after a reboot and that directory is managed. Ansible tried to change the permissions back to 0755 and failed since it's read-only.

Easy fix just setting 0555 from the start in config mgmt, but I have some questions about the behavior:

My questions:

  • What exact mechanism is doing this?
  • Is there a way to disable/control this behavior?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.