Jump to content

Fstab

From postmarketOS Wiki
Revision as of 08:33, 1 December 2021 by Samuelnorbury (talk | contribs)

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 from default to something like rw,user,suid,dev,exec,auto,users,async which is the equivalent of the options in default and also allows non-root mounts.

Related issue: pmaports#1168