Skip to content

Is the fstab entry for mounting / ignored?

I'm asking this because in the grub config /boot/grub/grub.cfg it is also specified how to mount /.

Example:

In my fstab it says something like this:

UUID=f252...	/	btrfs	rw,noatime,subvol=/@,subvol=@	0 0

But the package grub-btrfs has created a grub.cfg-entry with this in it:

linux "/vmlinuz-linux" root=UUID=f252... rw rootflags=subvol="@snapshots/4/snapshot" cryptdevice=UUID=22f...d3:cryptroot quiet processor.max_cstate=1

Notice the rootflags=subvol="@snapshots/4/snapshot" which specifies another subvolume than the one specified in fstab to be mounted. And it works perfectly fine, so to me it seems like fstab is just getting ignored.

13 points8 comments
Open on Reddit
About this post
Posted
Archived
Score
13 · 100% up
Kind
Text
ID
fda3vs

Author

8
posts
43
comments
0
media
View profile

8 comments

It's not getting ignored, certain options just can't get changed with a simple remount. Imagine what would happen if the system would remount a different subvolume to / while the system is running. Boom!, madness ensues, flames everywhere!

19 points

If it is used then it is bootloader dependend. I am quite sure that in my setup, with systemd-boot, it is unused.

3 points

This has nothing to do with any particular bootloader, the behavior is the same.

If you don't need to remount the /-fs with different options after switch_root then you shouldn't have an entry for it in fstab, it's redundant.

3 points

Ok, so it is not getting completely ignored, it's just that the kernel flags precedence over the fstab entry. So the noatime in my fstab is still being used.

Did I understand that correctly?

1 points

Imagine what would happen if the system would remount a different subvolume to / while the system is running. Boom!, madness ensues, flames everywhere!

Not really, what's already running will continue to run as it did. Why should it change? We're not on Windows here.
Programs you call out of your $PATH and contents of your home dir will obviously be different depending on what the other subvol contains but I can't think of much that'd break.

0 points

Yeah, your bootloader is passing kernel flags to the initramfs, telling it which partition the root partition is (so that it can boot).

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.