this post was submitted on 12 Nov 2023
674 points (94.6% liked)
linuxmemes
20686 readers
1420 users here now
I use Arch btw
Sister communities:
- LemmyMemes: Memes
- LemmyShitpost: Anything and everything goes.
- RISA: Star Trek memes and shitposts
Community rules
- Follow the site-wide rules and code of conduct
- Be civil
- Post Linux-related content
- No recent reposts
Please report posts and comments that break these rules!
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
• systemd is an init system commonly used in distros like Linux Mint, Arch, Manjaro, Ubuntu, Debian, etc.
• init systems have a process id of 1 and manage services like a login manager, network, firewall service, etc.
• a process id is assigned to every process in a linux system.
the average user usually doesn't worry about the init system, although more experienced/techy users may care about it.
Thank you, Callyral. I didn't know either. But now I'm trying to learn Linux again after 30 years of not touching it, so this is helpful.
If I may ask an additional possibly stupid question (coming from Windows/Mac): as an init system in Linux, after you get past BIOS and POST at power up, is systemd also responsible for the initial OS software boot process (the "bootstrap" or Boot Manager in DOS/Windows) or is that another process altogether?
Or, asked another way, does systemd load the Linux kernel, and if not, what does?
Just so you know, I have no real skin in this game yet; I'm just trying to figure out where systemd starts and stops so that I can follow the [endless] debate, lol.
Immediately after the BIOS/POST, the first thing that starts is the boot loader. This is usually a piece of software called GRUB. There's a part of GRUB in the Master Boot Record on the drive, that the loads the rest of GRUB from /boot. /boot has to be a basic partition so that the MBR code can mount it, so for example if you use something a bit fancier (like LVM) then you'll usually have a separate small ext2 or FAT partition just for /boot.
GRUB shows a list of available kernels, and other operating systems (if any are installed), based on a config in /boot.
Once you select a kernel to boot (or wait a few seconds for it to automatically choose the default option), it starts loading the kernel. There is a small disk image called the "initial ramdisk" in /boot, usually with a name like
initrd
orinitramfs
. This is a small ramdisk that contains all the drivers needed to mount your root partition - for example, drive drivers (NVMe, SATA, etc), file system drivers (ext4, ZFS, XFS, etc), LVM, RAID drivers if needed, and so on. If the root disk is on an NFS network share (not as common any more, but still doable), it also needs to contain network drivers for your network card. It also contains a few basic utilities, usually provided by BusyBox.Some Linux distros (such as Debian) build a custom initramfs, whereas others (like Fedora) have a generic one containing all possible drivers.
The initial ramdisk then mounts the root partition and hands control over to the Linux kernel, which starts actually booting the OS. The very first process the kernel starts running is the init process, which these days is usually systemd but can be a different one like sysvinit or runit.
Hope that helps :)
Okay, yeah. This makes much more sense now. I really appreciate it. I've been seeing the GRUB menu in LiveUSB boots but didn't understand that it was part of the initial boot process for general Linux systems (for whatever reason I had it stuck in my head that it was just for USB booting). And you've placed systemd exactly where it makes sense to me as the init process for that OS.
That is extremely helpful. Thank you so much for taking the time to write the entire boot order, because it just got crystal clear for me. Much appreciated!