Quick answer: A minimal Linux starter routine consists of the bootloader, the kernel, init (systemd or sysvinit), and only the essential services you enable.
Many people think a Linux system must load dozens of daemons before it can be used. In reality the core routine can be reduced to four stages and a handful of services, giving a fast, low‑resource environment.
Bootloader: The First Piece of Code
The bootloader resides in the first sector of the disk and hands control to the kernel. GRUB is the most common, but a minimal setup can use syslinux or even UEFI’s built‑in loader. The loader’s job is to locate the kernel image, pass any kernel parameters, and start execution.
- Install the bootloader to the EFI system partition or MBR.
- Configure
grub.cfg(or equivalent) to load only one kernel entry. - Use the
quietandloglevel=3parameters to suppress unnecessary console output.
Keeping the configuration simple reduces boot time and avoids loading unused modules.
Kernel Loading and Early Userspace
After the bootloader, the Linux kernel decompresses itself, detects hardware, and mounts the root filesystem. Early userspace consists of initramfs tools that prepare the real root.
What belongs in initramfs for a minimal system?
Only the modules required for your storage driver (e.g., ext4 or btrfs) and any essential firmware. Excluding networking or graphics modules speeds up the handoff to the real root.
- Create a small
initramfsusingdracut --no-modules "base" --add "fsck"or the equivalent tool for your distribution. - Verify the image size is under 5 MiB; larger images often contain unnecessary tools.
When the kernel finishes, it executes the init process specified by init= on the kernel command line.
Init System: Choosing Minimal Management
Systemd dominates modern distributions, but it can be heavy if left unchecked. Sysvinit or OpenRC provide lighter alternatives. The key is to start only the services you truly need.
How to keep systemd minimal?
Systemd uses units. Disable everything except systemd‑udevd.service, systemd‑logind.service, and network.target if networking is required.
- List all enabled units with
systemctl list-unit-files --state=enabled. - Mask unwanted units:
systemctl mask cups.service,systemctl mask bluetooth.service, etc. - Set the default target to
multi-user.targetinstead ofgraphical.targetif you do not need a GUI.
If you prefer Sysvinit, edit /etc/inittab to define runlevel 3 and remove scripts from /etc/rc.d/rc3.d that are not essential.
Essential Services to Keep Running
Even a minimal system needs a few background processes to be usable. The exact list depends on your use case, but a typical minimal set includes:
systemd‑udevd– hardware device management.systemd‑logind– user session tracking.sshd– remote login (optional, enable only if you need SSH).cronorsystemd‑timers– scheduled tasks.dbus– inter‑process communication.
Each service adds a small memory footprint; disabling anything you do not use saves RAM and CPU cycles.
Which services can I safely omit?
Printing, Bluetooth, CUPS, Avahi, and graphical display managers are common candidates for removal on headless or single‑purpose machines. Use systemctl is-enabled to confirm a service is not required before disabling it.
How to Trim and Verify Your Minimal Routine
After you have edited bootloader settings, rebuilt initramfs, and disabled services, you need to confirm the system boots as expected and stays functional.
- Reboot the machine and watch the boot messages. Look for “Loading kernel…” and “Reached target Multi‑User System”.
- Run
systemd-analyze blameto see the longest‑running services. Anything above 1 second is a candidate for removal. - Check memory usage with
free -h. A minimal headless setup often stays under 150 MiB after boot. - Test required functionality: can you log in via console? Does networking work if you enabled it? Verify file system mounts are present.
If a required function fails, re‑enable the corresponding service and repeat the verification step.
What if I need a graphical environment later?
Switch the default target back to graphical.target and enable the display manager you prefer. Because the core system is already minimal, the added GUI will be the only extra load.
Can I automate the minimal configuration?
Yes. Create a script that runs the systemctl mask commands and copies a trimmed grub.cfg into /boot/grub. Run the script after each package upgrade that might re‑enable services.
Applying the Minimal Routine to Real Use Cases
Different scenarios call for slightly different selections. Below are three common cases and the services you would keep for each.
Embedded device or IoT gateway
- Bootloader: syslinux (tiny footprint).
- Kernel: built with only
ext4,netfilter, and required drivers. - Init: OpenRC or plain Sysvinit.
- Services:
udevd,sshd,cron,dbus(optional).
Development workstation without GUI
- Bootloader: GRUB (standard).
- Kernel: generic with most drivers.
- Init: systemd, default target
multi-user.target. - Services:
udevd,logind,ssh,cron,dbus,rsyslog(optional for logs).
Minimal server for container hosting
- Bootloader: GRUB.
- Kernel: include cgroup and overlayfs modules.
- Init: systemd with
container.targetas default. - Services:
udevd,networkd,docker(orpodman),cron.
By matching the service list to the intended role, you keep the system lean while preserving needed capabilities.
Related
- Build a Home Yoga Practice With Minimal Props
- Essential Minimal Kitchen Tools for Simple Cooking
- How to Slow Down Mouse Scrolling Speed on Windows, macOS, and Linux
General information for everyday wellbeing, not medical advice. If something affects your health, sleep or mood for more than a short while, talk to a qualified professional. Read more
Spotted an error? Tell us and we will correct it (corrections policy).