Linux Internals
Linux Directories,
Inodes & LVM
What's in /bin vs /sbin? What is /etc? What's an inode? And how does Linux expand disk space without shutting down? All explained.
Sections
6
Read time
20 min
Level
Beginner
Linux filesystem
/bin and /sbin
User Binaries
Everyone can use these
- /bin/ls → list files
- /bin/cp → copy files
- /bin/mv → move files
- /bin/cat → read files
- /bin/rm → delete files
System Binaries
Admin / root only
- /sbin/reboot → restart system
- /sbin/fsck → check filesystem
- /sbin/ip → network config
- /sbin/useradd → create users
- /sbin/iptables → firewall rules
/sbin = mechanic's tools — for admin work under the hood
/etc = car settings and configuration
/var = dashboard logs and usage data
Key Takeaway
When you type ls, Linux actually runs /bin/ls. When you sudo reboot, it runs /sbin/reboot. $PATH connects the short command name to the full path.
/etc — The Settings Folder
/etc stores configuration files for the entire system and installed programs. Think of it as the "settings folder" of Linux.
These files are mostly plain text — you can open, read, and edit them with a text editor. When you change a setting (SSH port, DNS server, user account), it happens in /etc.
/etc/passwdAll user accounts on the system
/etc/ssh/sshd_configSSH server settings — ports, auth methods
/etc/resolv.confWhich DNS servers to use
/etc/hostsLocal DNS overrides — map hostnames to IPs
/etc/crontabSystem-wide scheduled tasks
/etc/fstabWhich disks to mount at boot and where
Did You Know?
/etc in Practice
/etc/passwd — User Accounts
Every user on the system has an entry in this file. Run cat /etc/passwd to see it:
charith:x:1000:1000:Charith:/home/charith:/bin/bash
/etc/ssh/sshd_config — SSH Server Config
Click the Play button above to start!
Watch the commands execute step by step
/etc/resolv.conf — DNS Servers
Click the Play button above to start!
Watch the commands execute step by step
Key Takeaway
Almost every program you install on Linux has its config in /etc. Learning to read and edit these files is a core sysadmin skill.
Inodes — A File's Identity Card
Every file on Linux has two things stored on disk: the actual data (the content) and an inode (the identity card).
INODE — Metadata (identity card)
- ✅ File size
- ✅ Owner (charith)
- ✅ Permissions (rw-r--r--)
- ✅ Created / Modified / Accessed timestamps
- ✅ WHERE on disk the data is stored
- ❌ The filename (NOT here!)
DIRECTORY — Name lookup
"notes.txt" → inode #4521
"backup.sh" → inode #4522
"config.yml" → inode #4523
The directory maps name → inode number. The inode holds everything else.
The actual patient = the file's data (the real content)
Hospital reception = directory ("John Smith is in room 204" — maps name to location)
See it yourself
Click the Play button above to start!
Watch the commands execute step by step
Did You Know?
LVM — Flexible Storage
LVM (Logical Volume Manager) solves one of the most painful problems in Linux administration: running out of disk space on a live server.
The Problem with Normal Partitions
YOUR HARD DISK (60GB) — fixed partitions:
┌─────────────┬────────────────┬────────┐
│ /boot (2GB)│ / Linux (30GB)│ ??? │
└─────────────┴────────────────┴────────┘
If / fills up → shut down → hours of work → data risk 😱
What LVM Does — The Pool System
WITH LVM — flexible pool:
┌─────────────────────────────────────┐
│ POOL OF STORAGE (60GB) │
│ ┌──────────────┐ ┌─────────────┐ │
│ │ Bucket A │ │ Bucket B │ │
│ │ / (Linux) │ │ /backups │ │
│ │ 30GB │ │ 10GB │ │
│ └──────────────┘ └─────────────┘ │
│ ~20GB FREE │
└─────────────────────────────────────┘
Bucket A getting full? Two commands, 10 seconds. ✓
The 3 LVM Terms
PV
Physical Volume
Your actual hard disk. The water source.
VG
Volume Group
The combined pool of storage. All disks merged together.
LV
Logical Volume
A bucket carved from the pool. What Linux mounts and uses.
Hard Disk (PV) → Pool (VG) → Buckets (LV)
LVM Commands
On your Ubuntu VM, half the disk is sitting unused in the LVM pool — ready whenever you need more space. Here's how to check and use it:
Click the Play button above to start!
Watch the commands execute step by step
Expanding your disk — 2 commands, zero downtime
Click the Play button above to start!
Watch the commands execute step by step
Key Takeaway
Every production Linux server uses LVM. When you're working as a DevOps or sysadmin engineer, you will use these commands. This is why they matter.
Key Concepts Flashcards
Click any card to flip and reveal the definition.