The Filesystem & Access Control
Deconstructing inodes, the Filesystem Hierarchy Standard (FHS), and resolving permission faults.
The Filesystem Hierarchy Standard (FHS)
Unlike Windows, which assigns individual drive letters (C:, D:), Linux unifies all physical storage devices into a single, contiguous directory tree starting at the root (/). The Filesystem Hierarchy Standard (FHS) dictates exactly where specific types of data must reside:
/binand/usr/bin: Essential user binaries (executables likels,cat)./etc: Host-specific system configuration files (no binary executables belong here)./var: Variable data that changes during system operation (logs, databases, spool files)./home: User-specific data and personal configuration files./dev: Device files representing attached physical and pseudo-hardware.
Inodes vs. File Names
The most fundamental concept in Linux storage is that a file name and the file data are two completely separate entities.
When you save data to a disk, the filesystem creates an inode (Index Node). The inode is a metadata structure containing the file’s permissions, ownership, timestamps, and pointers to the actual physical data blocks on the disk. The inode does not contain the file name.
A “directory” in Linux is simply a special type of file that contains a mapped list of file names to their corresponding inode numbers (called directory entries or “dentries”).
Owner: root
Size: 2KB] end subgraph Disk Blocks Data[(Physical Data Blocks)] end Name -->|Points to| INode INode --- Meta INode -->|Points to| Data
This architecture explains why a single file can have multiple names (Hard Links)—they are simply multiple directory entries pointing to the exact same inode.
Access Control: User, Group, Others (UGO)
Linux permissions are evaluated using a strict triad of identity: User (the owner), Group (the assigned user group), and Others (everyone else).
Each of these identities is assigned three specific permissions: Read (r), Write (w), and Execute (x). When viewing a file with ls -l, this is represented as a 10-character string (e.g., -rwxr-xr--).
These permissions translate to an octal numeric system, which is standard in configuration management and automation:
Read (r) = 4Write (w) = 2Execute (x) = 1
A permission of 755 (common for web directories) breaks down as:
- User (7): 4 (read) + 2 (write) + 1 (execute) = Can do everything.
- Group (5): 4 (read) + 1 (execute) = Can read and enter the directory.
- Others (4): 4 (read) = Can only read files.
chmod 777 grants universal read, write, and execute permissions to every process on the system. It is a catastrophic security failure and should never be used to bypass a “Permission Denied” error. You must identify the correct user or group and assign precise ownership using chown or chmod.Directory Execute Permissions
A common source of confusion is the “Execute” (x) bit on a directory. You cannot “execute” a folder like a script. Instead, on a directory, the x bit grants traversal rights. It gives the user permission to enter the directory (via cd) and access the inodes inside it, provided they know the file names.
Test Your Understanding
Q:You are logged in as a standard user. You attempt to delete a log file owned by the `root` user, expecting a permission denied error. Instead, the file is successfully deleted. How is this possible? Reveal ▾
w) on the parent directory, you can delete any file inside it, regardless of who owns the file or what the file’s specific permissions are.