Fstab

From postmarketOS Wiki

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