2.2.3. RAID, Mounted Storage, and Network Filesystems
💡 First Principle: RAID (Redundant Array of Independent Disks) distributes data across multiple disks to achieve redundancy, performance, or both. Software RAID in Linux is managed by the kernel's md (multiple devices) driver — it works independently of the hardware, meaning the RAID survives disk controller replacement.
Common RAID Levels:
| RAID Level | Disks Required | Redundancy | Performance | Use Case |
|---|---|---|---|---|
| RAID 0 | 2+ | None | Read/write boost | Temp data, speed critical |
| RAID 1 | 2 | 1 disk failure | Read boost | Boot drives, critical data |
| RAID 5 | 3+ | 1 disk failure | Good read | General file servers |
| RAID 6 | 4+ | 2 disk failures | Good read | Large arrays, archive |
| RAID 10 | 4+ | 1 per mirror | Excellent | Databases, high I/O |
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc
mdadm --detail /dev/md0 # Status and member disk health
cat /proc/mdstat # Quick status of all MD arrays
mdadm --manage /dev/md0 --add /dev/sdd # Add a hot spare or replacement
mdadm --assemble --scan # Auto-assemble all arrays at boot
Mount Operations and /etc/fstab:
Mounting makes a filesystem accessible at a directory (the mount point). Persistent mounts are configured in /etc/fstab — the system reads this file at boot to mount all configured filesystems.
mount /dev/sdb1 /mnt/data # Temporary mount
umount /mnt/data # Unmount (or umount /dev/sdb1)
mount -a # Mount all entries in /etc/fstab
findmnt # Show mounted filesystems as tree
fstab Format: device mountpoint fstype options dump pass
# /etc/fstab entries
UUID=abc123 /data ext4 defaults 0 2
/dev/vg_data/lv_home /home xfs defaults,noatime 0 0
192.168.1.10:/export/share /mnt/nfs nfs defaults,_netdev 0 0
//server/share /mnt/smb cifs credentials=/etc/samba/creds,uid=1000 0 0
Key fstab Mount Options:
| Option | Effect |
|---|---|
noatime | Don't update access time on reads — significant performance boost |
noexec | Prevent executing binaries from this filesystem |
nosuid | Ignore setuid/setgid bits — security hardening |
nodev | Ignore device files — security hardening |
nofail | Continue booting even if this mount fails |
_netdev | Wait for network before mounting (NFS, CIFS) |
ro / rw | Read-only or read-write |
remount | Change options on an already-mounted filesystem |
autofs: Mounts filesystems on-demand when accessed, unmounts them after idle. Useful for NFS home directories — the mount only appears when a user logs in.
# /etc/auto.master
/home /etc/auto.home
# /etc/auto.home
* -rw,soft,intr nfsserver:/home/&
Network Filesystems:
- NFS (Network File System): Linux-native network filesystem. Client-side:
mount -t nfs server:/path /mnt/point. Server-side: configured via/etc/exports. Uses TCP/UDP port 2049. - SMB/CIFS (Samba): Windows-compatible file sharing. Mount with
-t cifs. Requirescifs-utilspackage. Samba provides both SMB server and AD integration on Linux.
⚠️ Exam Trap: Entries in /etc/fstab without the _netdev option for network filesystems (NFS, CIFS) will cause boot failures when the network is unavailable — the system will hang waiting for the mount. Always use _netdev for network-backed storage.
Reflection Question: A server boots slowly and eventually drops to emergency mode with "Failed to mount /mnt/nfs." The NFS server was unreachable during boot. What two fstab options would prevent this behavior while keeping the mount configured?