On 4/22/26 12:38 PM, Jonathan Grotelüschen wrote:
On 2026-04-22 16:52, Pocket wrote:
On 4/22/26 3:30 AM, Łukasz Michalski wrote:
A good practice is to set chattr +i on directories that are mount
points for filesystems.
Why would/should I want to do that?
What would be the advantage for doing so?
I ask this because I have not done so since running Linux since 1995.
This is the first time I have seen this recommendation.
A look into `man chattr` will tell you what it does: disallowing changes
to the directory or to files in it, but it doesn’t apply to the mounted
filesystem. Though in this case Lucie mounted a wrong partition, so it
wouldn’t have helped here.
I have read the manual page and I do known what it does.
What I am trying to ask here is why you would want to use chattr +i to
make mount points immutable?
Here is the top level of my current desktop mounted at /mnt
ls /mnt
Cache Home System
[root@alarm ~]# cat /etc/fstab
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
UUID=9514386f-6ba0-42b6-942a-939e87857591 / btrfs
rw,relatime,compress=lzo,discard=async,space_cache=v2,subvol=/System 0 0
UUID=9514386f-6ba0-42b6-942a-939e87857591 /home btrfs
rw,relatime,compress=lzo,discard=async,space_cache=v2,subvol=/Home 0 0
UUID=9514386f-6ba0-42b6-942a-939e87857591 /var/cache/pacman/pkg btrfs
rw,relatime,compress=lzo,discard=async,space_cache=v2,subvol=/Cache 0 0
UUID=97BB-2AFA /boot vfat
rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro
0 2
UUID=4d995c91-fee4-4289-bade-85496d49e572 none swap defaults 0 0
UUID=9514386f-6ba0-42b6-942a-939e87857591 /mnt btrfs
noauto,rw,relatime,compress=lzo,discard=async,space_cache=v2 0 0
So how would chattr +i help my installation?
--
Hindi madali ang maging ako