51 articles
Knowledge Base
Linux
51 articles in the Linux category · page 1 of 3.
- Linux cgroup v2: set CPU, memory and I/O limits cgroup v2 is the Linux kernel feature that caps the CPU, memory and disk I/O a process can use. Read those limits and set them with systemd.
- Configure static IPs, VLANs and an LACP bond with Netplan on Ubuntu Learn how to set a static IP, VLANs and an LACP bond with Netplan on Ubuntu, using the current routes syntax instead of the deprecated gateway4 key. You will also use netplan try, which rolls back a bad change automatically so you never lock yourself out of a remote server.
- The find command: expression order, tests and safe deletion Learn how to use the Linux find command safely on a server to locate large files, recent changes and loose permissions, and to clean up old files. You will see why the order of the words matters, so a delete removes only what you meant.
- Set up zram compressed swap on a memory-constrained Linux server Learn how to set up zram, a compressed swap device kept in RAM, on a Linux server that is short on memory. This guide shows you how to size it, pick a compression algorithm, tune the kernel for it, and measure whether it actually helped.
- Fix systemd status=203/EXEC and the exit codes around it Learn how to diagnose a systemd service that fails with status=203/EXEC before your program even starts. You will read the Failed at step line and check the usual causes in order, from a wrong path or missing execute permission to a broken script header or a sandbox setting. You will also decode related exit codes such as 200/CHDIR, 217/USER and 226/NAMESPACE.
- SSD TRIM on Linux: fstrim.timer versus the discard mount option Learn how to enable SSD TRIM on Linux with fstrim.timer, and how to check with lsblk --discard that your discards still reach the drive through LUKS, LVM, mdraid and virtio. You will also see why the continuous discard mount option is rarely the right default.
- systemd socket activation: writing a .socket unit paired with a .service Set up systemd socket activation so PID 1 owns the listening socket and hands it to your daemon over the LISTEN_FDS protocol, keeping connections queued in the kernel accept queue across a service restart.
- Configure kdump so a kernel panic leaves you a vmcore Set up kdump end to end so the next Linux kernel panic writes a vmcore instead of vanishing: reserve crashkernel memory, enable the service on RHEL-family or Debian/Ubuntu, pick a dump target, shrink the dump with makedumpfile, test it with sysrq, and read the result with crash.
- Sandboxing a systemd service — score it, harden it, decode the denials Use systemd-analyze security to score a unit, then harden it in waves through a drop-in override — ProtectSystem, CapabilityBoundingSet, SystemCallFilter — and read the exact sandbox denial out of the journal when the service stops starting.
- Recover a Linux server that will not boot: GRUB, initramfs and emergency mode Triage a Linux server that will not boot by the stage where it stopped: the grub rescue prompt, the (initramfs) BusyBox shell, systemd emergency mode, or a VFS kernel panic — with the chroot repair for when there is no shell at all.
- bpftrace one-liners that answer production questions without a restart Practical bpftrace one-liners for finding which files are opened, which syscalls are slow, which process issues the disk I/O, and how to read a bpftrace latency histogram — plus the kernel and BTF prerequisites that decide whether they run at all.
- Fix ENOSPC: System limit for number of file watchers reached Why Linux runs out of inotify watches, how to find the process burning them through /proc fdinfo, and how to raise fs.inotify.max_user_watches temporarily and persist it in /etc/sysctl.d without pretending the limit is free.
- POSIX file ACLs on Linux: grant per-user access with setfacl and getfacl Use setfacl and getfacl to give several users and services different access to one directory tree — including POSIX ACL default entries, the mask, and which copy tools preserve ACLs.
- Set up a Linux software RAID1 mirror with mdadm and replace a failed disk Build an mdadm RAID1 mirror on Linux, make it assemble at every boot, monitor it by email, and replace a failed RAID disk — with the exact commands and the output you should see.
- SSH connection multiplexing with ControlMaster — one session for every command Set up SSH connection multiplexing with ControlMaster, a hashed ControlPath and ControlPersist so repeated ssh, scp, rsync, git and Ansible runs reuse one authenticated session instead of re-handshaking every time.
- Transparent huge pages and database latency — diagnose THP, then disable it properly Why transparent huge pages cause p99 latency spikes and resident-memory bloat under Redis, MongoDB, PostgreSQL and MySQL, how to read the kernel counters that prove it, and how to disable THP so it survives a reboot.
- Prevent overlapping cron jobs with flock so a slow run never stacks A practitioner guide to flock cron: exclusive vs non-blocking locks, the -w timeout, exit codes, and how to wrap a cron entry so a slow run never overlaps the next scheduled one.
- Crontab syntax explained — the five time fields and how to write a schedule A practical guide to crontab syntax: what the five time fields mean, the operators (* , - /), special strings like @reboot and @daily, real-world examples, and the crontab commands and environment gotchas that trip people up.
- Linux load average explained — and how to triage a high-load server What the 1/5/15-minute load average numbers actually measure on Linux, why load can be high while the CPU sits idle, how to normalize by core count, and a step-by-step triage to tell a CPU hog from I/O wait or a D-state pileup.
- Make systemd-journald logs persistent across reboots (and cap the disk) Enable persistent systemd-journald storage so logs survive reboots, then bound disk usage with SystemMaxUse and retention limits — with real commands and expected output on systemd 255+.
- systemd-oomd memory pressure tuning — kill the right cgroup before the kernel does How systemd-oomd uses PSI to evict a cgroup under sustained memory pressure: ManagedOOMMemoryPressure, oomd.conf limits, ManagedOOMPreference, why it kills whole cgroups, and where it stops helping.
- Run Podman containers as systemd services with Quadlet Write .container, .network and .volume Quadlet units for Podman 5.x, generate real systemd services with daemon-reload, keep rootless containers alive after logout with linger, and retire the deprecated podman generate systemd.
- Hardening a systemd service unit — sandbox a long-running daemon Wrap a long-running Linux daemon in systemd's sandboxing directives — ProtectSystem, PrivateTmp, NoNewPrivileges, SystemCallFilter, DynamicUser — and audit the result with systemd-analyze security.
- Tuning Linux swap and swappiness for servers What vm.swappiness actually controls (reclaim preference, not a threshold), how to size and add a swap file safely, set swappiness persistently, and read memory pressure with vmstat, free, and PSI.