Talk:Fstab

From postmarketOS Wiki

With regards to the statement: "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" and with reference to https://linux.die.net/man/8/mount :

  • defaults (NB: not default) equates to: rw,suid,dev,exec,auto,nouser,async,relatime
  • user/users (NB: the latter includes the former) implies: noexec,nosuid,nodev
  • all of the above can overridden by explicitly setting options after using defaults/user/users
  • specifying the users option near the end of your option list 'undoes' the suid,dev,exec earlier in the list

So, a better suggestion for mount options might be just:

defaults,user

which evaluates to: rw,suid,dev,exec,auto,nouser,async,relatime,user,noexec,nosuid,nodev

You may wish to use the more permissive users instead of user, depending on your requirements.

You may then wish to append some/all of the following, depending on your requirements: suid,dev,exec,nofail,nolock (look up what they mean before switching them on!)

Mounting encrypted partitions

Find below some slight modifications to the archwiki on mounting LUKS encrypted partitions at boot:

    - Followed the wiki to create and format a Luks partition on the eMMC (or a location of your choice)
    - Created a keyfile, saved it in the /root folder, modified file permissions, and added to a keyslot
    - Added relevent entries to /etc/conf.d/dmcrypt for target/source/keyfile
    - rc-update add dmcrypt boot
    - Added relevent entries to /etc/fstab following the recommendations for user mounting privilages 
    - rc-update add localmount default

This successfully automounts the luks partition at boot. This can be used to setup the eMMC as a common encrypted /home partition, shared across multiple SD cards each with their own distribution installed.