DSA, Database System & Operating System β Memory Management, File Systems & Administration, NEC licence examination syllabus (Nepal Engineering Council).
System Administration
Keeping a running system healthy β users, permissions, backups, monitoring and the operational discipline behind them.
π Where this lives: the single most important idea here is that a backup you have never restored is a hypothesis, not a backup. Organisations discover their backups were broken at the moment they need them, which is the worst possible time. GitLab lost 6 hours of production data in 2017 and found that five separate backup mechanisms had all silently failed β the incident report is public and is the best reading in this topic. Everything else on this page is ordinary craft; that one lesson is the expensive one. Search "GitLab database incident postmortem 2017".
The administrator's responsibilities
USER MANAGEMENT accounts, groups, passwords, quotas
SOFTWARE installation, patching, dependency
management
FILE SYSTEM mounting, quotas, monitoring free space
and INODES
BACKUP & RECOVERY scheduling, verification, retention,
restore drills
SECURITY permissions, firewalls, auditing,
vulnerability patching
MONITORING CPU, memory, disk, network, logs, alerts
PERFORMANCE TUNING identify the bottleneck, then fix THAT
BOOT & SERVICES what starts at boot and in what order
DOCUMENTATION the part everyone skips and later needs
THE PRINCIPLE OF LEAST PRIVILEGE runs through all of it: every
user, process and service should have exactly the permissions it
needs and no more. Concretely:
Β· do not run services as root β give each its own account
Β· use `sudo` for specific commands rather than a root shell
Β· use CAPABILITIES rather than setuid where possible
(`ping` needs CAP_NET_RAW, not full root)
Β· grant group membership rather than individual permissions,
so access can be revoked in one place
Users, groups and permissions
USER IDENTITY:
UID numeric user id; UID 0 is root, and root is defined
BY the number, not the name β any account with UID 0
is root
GID primary group id
/etc/passwd username, uid, gid, home, shell (world
readable)
/etc/shadow the password HASH (root-readable only)
/etc/group group memberships
WHY THE SPLIT: /etc/passwd must be readable so that `ls -l`
can map UIDs to names, but password hashes must not be, or
they could be attacked offline. Hence shadow files.
MEASURED ON THIS MACHINE: the earlier `ps` output showed
PID 1 PPID 0 /sbin/launchd
running as UID 0. Everything else descends from it, inheriting
or dropping privilege.
COMMON OPERATIONS:
useradd / adduser create an account
usermod -aG group user add to a supplementary group
passwd user set a password
chown user:group file change ownership
chmod 640 file change permissions
umask 022 default permission mask for new
files
THE UMASK IS SUBTRACTIVE and this is examined:
new file default 666 (rw-rw-rw-)
umask 022
result 644 (rw-r--r--)
new directory 777
umask 022
result 755 (rwxr-xr-x)
Files never get execute permission by default β only
directories do, because x on a directory means traverse.
DISK QUOTAS limit per-user consumption, in two dimensions:
BLOCK quota how much space
INODE quota how many FILES β needed because a user can
exhaust the inode table without using space
Each has a SOFT limit (warn, with a grace period) and a HARD
limit (refuse).
Backup strategy
BACKUP TYPES:
FULL everything, every time
β simplest restore β one archive
β slowest, largest
INCREMENTAL only what changed since the LAST backup of any
kind
β fastest, smallest
β restore needs the full PLUS EVERY
incremental in order β and one missing link
breaks the chain
DIFFERENTIAL only what changed since the last FULL backup
β restore needs only the full plus ONE
differential
β grows steadily until the next full
WORKED COMPARISON β full on Sunday, daily thereafter, 100 GB
of data changing 5 GB per day:
day INCREMENTAL DIFFERENTIAL
Sun 100 GB (full) 100 GB (full)
Mon 5 GB 5 GB
Tue 5 GB 10 GB
Wed 5 GB 15 GB
Thu 5 GB 20 GB
Fri 5 GB 25 GB
Sat 5 GB 30 GB
total 135 GB 205 GB
restore on Saturday:
incremental β 1 full + 6 increments = 7 archives, all
required, in order
differential β 1 full + 1 differential = 2 archives
The trade is storage and backup time against restore
complexity and risk. Incremental is cheaper to take and more
fragile to restore.
THE 3-2-1 RULE β the industry standard:
3 copies of the data
2 different media types
1 copy OFF-SITE
The off-site copy is what survives fire, theft and
ransomware. A backup on the same machine is not a backup; a
backup on a network share the ransomware can also encrypt is
not a backup either β hence the modern addition of an
IMMUTABLE or air-gapped copy.
THE TWO NUMBERS THAT DEFINE A BACKUP STRATEGY:
RPO Recovery Point Objective β how much data you can
afford to LOSE. Determined by backup FREQUENCY.
RTO Recovery Time Objective β how long you can be DOWN.
Determined by restore SPEED.
Both are business decisions, not technical ones, and both must
be set BEFORE the incident. A nightly backup means an RPO of
up to 24 hours; if the business cannot accept that, the answer
is continuous archiving (the WAL archiving of ACtE0704), not
a faster nightly job.
VERIFICATION β the step that is always skipped:
Β· RESTORE from the backup, on a regular schedule, to a
separate machine
Β· verify checksums
Β· confirm the restored system actually WORKS, not merely that
files exist
A backup job that reports success proves only that the job
ran.
RAID IS NOT A BACKUP. RAID protects against DISK FAILURE. It
does not protect against deletion, corruption, ransomware or
fire β all of which are faithfully mirrored to every disk
instantly. This is the most common misconception in the topic.
The incremental-versus-differential comparison is really about where you want the risk. Incremental minimises the cost of taking a backup and maximises the cost β and fragility β of restoring one. Since you take backups constantly and restore rarely but urgently, optimising the rare-but-urgent path is usually the better engineering choice.
Monitoring, tuning and boot
THE ESSENTIAL COMMANDS, and what each tells you:
CPU top, htop, uptime (load average), vmstat, mpstat
MEMORY free, vm_stat, vmstat, /proc/meminfo
DISK SPACE df -h (blocks)
df -i (INODES β the failure `df -h` cannot show)
du -sh (per-directory usage)
DISK I/O iostat, iotop
PROCESSES ps, pgrep, lsof
NETWORK netstat, ss, tcpdump, ip
LOGS journalctl (systemd), /var/log, dmesg (kernel)
LOAD AVERAGE, which is routinely misread:
the 1, 5 and 15-minute averages of runnable + uninterruptible
processes.
Β· on a 10-CORE machine (as measured here), a load of 10 means
fully busy, not overloaded
Β· load 4 on 1 core is a crisis; load 4 on 16 cores is idle
Β· ALWAYS divide by the core count before interpreting
Β· a high load with low CPU usage means processes blocked in
uninterruptible I/O β a disk problem, not a CPU problem
THE TUNING DISCIPLINE β measure, do not guess:
1. identify the BOTTLENECK (CPU? memory? disk? network?)
2. measure it, with a number
3. change ONE thing
4. measure again
5. keep it only if the number improved
Changing several settings at once means you cannot attribute
the result β which is how systems accumulate configuration
nobody can justify.
BOOT SEQUENCE:
1. FIRMWARE (BIOS/UEFI) β POST, find a boot device
2. BOOTLOADER (GRUB, systemd-boot) β load the kernel
3. KERNEL β initialise hardware, mount the root filesystem
4. INIT (PID 1) β start services
SysV init sequential scripts, runlevels
systemd parallel, dependency-based (Linux)
launchd macOS β MEASURED: PID 1 on this machine
5. LOGIN
systemd essentials:
systemctl status/start/stop/enable <service>
journalctl -u <service> -f
systemd-analyze blame β what is slowing the boot
SECURITY HYGIENE, briefly:
Β· patch promptly; most breaches exploit known, fixed bugs
Β· SSH keys, not passwords; disable root SSH login
Β· a firewall that DENIES by default
Β· audit logs, kept somewhere the attacker cannot edit
Β· least privilege, everywhere
π Go further: this discipline has largely become Infrastructure as Code. Rather than logging in and configuring a machine, you describe the desired state in a file (Ansible, Terraform, Kubernetes manifests) and a tool converges the system to it. The payoff is that the configuration is version-controlled, reviewable and reproducible β and the machine becomes disposable, which is the immutable infrastructure idea: never patch a server, replace it with a newly built one. That inverts the traditional admin's job from maintaining pets to managing cattle. Search "immutable infrastructure pets vs cattle".
π‘ Exam angle: list the administrator's responsibilities and state the principle of least privilege. Know /etc/passwd versus /etc/shadow and why they are split, and the umask calculation (666 β umask for files, 777 β umask for directories). The backup types comparison is a guaranteed question β full, incremental and differential, with the storage-versus-restore trade and a worked weekly table. Quote the 3-2-1 rule, define RPO and RTO, and state plainly that RAID is not a backup and that an unverified backup is worthless. Interpret load average relative to core count.
Syllabus points
Administration tasks
User account management
Start-up & shutdown procedures
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.
Related topics in Memory Management, File Systems & Administration