Image

Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

How is the filesystem bootstrapped, given that we start on a different partition?

+2
−0

Typically, one has /boot or /boot/efi on a separate partition, using some simple filesystem like FAT32 that the bootloader can handle. At startup, Linux needs to be able to set up the entire / filesystem, across multiple partitions.

Of course, booting can use a temporary in-memory filesystem (the "initramfs") and doesn't need to care about the fact that the partition it's running from is not where the eventual filesystem root will be. But the rules for mounting partitions are in /etc/fstab, which generally will be on a different partition.

During the boot sequence, how does Linux find /etc/fstab in order to be able to set up the filesystem?

History

0 comment threads

1 answer

+2
−0

The root partition is noted explicitly in the configuration of the boot loader.

For example, grub on an Ubuntu machine (/boot/grub/grub.cfg):

[...]
linux   /vmlinuz-6.5.0-44-generic root=/dev/mapper/system-root ro cgroup_enable=memory swapaccount=1 systemd.unified_cgroup_hierarchy=false
[...]

The boot loader now knows how to find the kernel to boot on the boot partition, and which partition (or logical volume in this case) holds the root partition. The kernel contains all modules needed to mount the other partitions, so it mounts the root partition temporarily (and read-only ro in this example). From there the system can read /etc/fstab and use this information to set up the directory tree.

History

0 comment threads

Sign up to answer this question »