Fstab: Difference between revisions
describe why /etc/fstab won't have / and /boot entries |
m rollbackEdits.php mass rollback Tag: Rollback |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 2: | Line 2: | ||
=== Usage in the boot process === | === Usage in the boot process === | ||
We used to rely on <code>/etc/fstab</code> to find the postmarketOS [[Partition_Layout|boot and root partitions]] by their label. We have to find partitions by their label, because we do not always know the exact location or UUID of the partition in advance. However, by just relying on the label, we get unpredictable behavior if installing postmarketOS on both the eMMC and the SD card ({{issue|664|pmaports}}). | |||
The initramfs accepts paths to the boot and root partitions as kernel parameters and falls back to searching by label, therefore it covers all use cases we have. Nowadays, we [[Boot_process#postmarketOS_initramfs|let the initramfs mount root and boot]], and do not have any entries for them in <code>/etc/fstab</code>. | |||
[[Category:Technical Reference]] | |||
=== Enabling localmount service === | |||
If you want to add custom entries to your <code>/etc/fstab</code> (e.g. to mount your SD card) and want OpenRC to process the file during boot, enable the <code>localmount</code> service: | |||
<syntaxhighlight lang="shell-session"> | |||
$ sudo rc-update add localmount default | |||
</syntaxhighlight> | |||
=== Allowing non-superuser mounting === | |||
If you see the following error message in your tinydm log after start-up, you must allow non-root users to mount volumes: | |||
<code> | |||
(phosh:6215): phosh-mount-manager-WARNING **: 20:23:17.968: Failed to mount volume 'X': mount: /home/user/X: must be superuser to use mount. | |||
</code> | |||
To allow that, change the mount-options of the <code>/etc/fstab</code> entry to <code>defaults,user</code> (which is the equivalent of <code>rw,<del>suid</del>,<del>dev</del>,<del>exec</del>,auto,<del>nouser</del>,async,relatime,user,noexec,nosuid,nodev</code>). | |||
You may wish to re-enable <code>exec</code>, etc. (e.g. by making your mount-options <code>defaults,user,exec</code>, which reinstates the <code>exec</code> option after it was disabled by the preceding <code>user</code> option), but please read [https://linux.die.net/man/8/mount mount(8) - Linux man page] to understand why they default to 'no' when the <code>user</code> (or <code>users</code>) option is specified. | |||
Related issue: {{issue|1168|pmaports}} |
Latest revision as of 14:31, 23 April 2023
This article is about /etc/fstab
in postmarketOS.
Usage in the boot process
We used to rely on /etc/fstab
to find the postmarketOS boot and root partitions by their label. We have to find partitions by their label, because we do not always know the exact location or UUID of the partition in advance. However, by just relying on the label, we get unpredictable behavior if installing postmarketOS on both the eMMC and the SD card (pmaports#664).
The initramfs accepts paths to the boot and root partitions as kernel parameters and falls back to searching by label, therefore it covers all use cases we have. Nowadays, we let the initramfs mount root and boot, and do not have any entries for them in /etc/fstab
.
Enabling localmount service
If you want to add custom entries to your /etc/fstab
(e.g. to mount your SD card) and want OpenRC to process the file during boot, enable the localmount
service:
$ sudo rc-update add localmount default
Allowing non-superuser mounting
If you see the following error message in your tinydm log after start-up, you must allow non-root users to mount volumes:
(phosh:6215): phosh-mount-manager-WARNING **: 20:23:17.968: Failed to mount volume 'X': mount: /home/user/X: must be superuser to use mount.
To allow that, change the mount-options of the /etc/fstab
entry to defaults,user
(which is the equivalent of rw,
).
suid,dev,exec,auto,nouser,async,relatime,user,noexec,nosuid,nodev
You may wish to re-enable exec
, etc. (e.g. by making your mount-options defaults,user,exec
, which reinstates the exec
option after it was disabled by the preceding user
option), but please read mount(8) - Linux man page to understand why they default to 'no' when the user
(or users
) option is specified.
Related issue: pmaports#1168