Operations 4 min read

Network-Based Read-Only Root Filesystem with High Availability

The article outlines a Linux server architecture that mounts a read‑only root filesystem over the network from a centrally managed, DRBD‑replicated control node with Heartbeat failover, providing real‑time updates, high security (even root cannot modify), and automatic migration via virtual IP.

Baidu Tech Salon
Baidu Tech Salon
Baidu Tech Salon
Network-Based Read-Only Root Filesystem with High Availability

This article describes a Linux server system with a read-only root partition that provides enhanced security, making it impossible even for the root user to modify the system. This read-only root filesystem (or customized operating system) is actually a client-server system where the OS image is mounted from a central control node over the network.

Core Single Point: The central control node is a single point of failure that stores one or more customized operating system images and provides various services. If this node fails, the entire cluster would collapse. To avoid this single point of failure, the system uses DRBD (Distributed Replicated Block Device) for real-time data synchronization and Heartbeat from the Linux-HA project for automatic failover. The system achieves second-level automatic migration with virtual IP support.

Key Features:

Centralized management - only one operating system needs to be maintained

Real-time updates - any modifications take effect immediately

High security - even root user cannot compromise the system

Exception handling - allows specific files to exist on client servers

Use Cases:

MMORPG servers - providing only computation and database services

High security environments - root user cannot perform malicious actions

Other scenarios requiring enhanced system integrity

Setup Steps:

Deploy DRBD and Heartbeat

Recompile Linux kernel

Customize the operating system

Configure TFTP service

Configure DHCP service

Configure NFS service

PXE network boot

Key Technical Points:

I. Kernel Compilation: Module parameters only work after kernel boots, so NFS must be compiled directly into the kernel (not as a module) to support Root file system on NFS. The system uses Ramdisk to place /var/tmp in memory for proper operation of system services.

II. System Boot Process:

Client boots via network card (PXE) and automatically discovers DHCP service

Downloads customized kernel via DHCP and TFTP

Obtains IP address and starts the operating system

Moves /var and /tmp to memory (tmpfs)

Logs into the operating system

Verifies NFS root mounting

Even attempting "rm -rf /" fails due to read-only nature

High AvailabilityLinuxheartbeatPXENFSDRBDnetwork bootread-only-rootfs
Baidu Tech Salon
Written by

Baidu Tech Salon

Baidu Tech Salon, organized by Baidu's Technology Management Department, is a monthly offline event that shares cutting‑edge tech trends from Baidu and the industry, providing a free platform for mid‑to‑senior engineers to exchange ideas.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.