Configuration

When you run psd for the first time, it will create $XDG_CONFIG_HOME/psd/psd.conf (referred to hereafter as the configuration file) which contains all settings. You can run the psd command before using psd.service to create this file without starting synchronization. Note: Any edits made to this file while psd is active will be applied only after psd.service has been restarted.

Optionally enable the use of overlayfs to improve sync speed and to use a smaller memory footprint. Do this in the USE_OVERLAYFS variable. The user will require sudo rights to /usr/bin/psd-overlay-helper to use this option and the kernel must support overlayfs version 22 or higher. See #Overlayfs mode for additional details.
Optionally define which browsers are to be managed in the BROWSERS array. If none are defined, the default is all detected browsers.
Optionally disable the use of crash-recovery snapshots (not recommended). Do this in the USE_BACKUPS variable.
Optionally define the number of crash-recovery snapshots to keep. Do this in the BACKUP_LIMIT variable.

Example: Let us say that Chromium, Opera and Midori are installed but only Chromium and Opera are to be sync’ed to tmpfs since the user keeps Midori as a backup browser and it is seldom used:

BROWSERS=(chromium opera)

Beginning with version 5.54 of psd, native support for overlayfs is included. This feature requires at least a Linux kernel version of 3.18.0 or greater.

Overlayfs mode

  • Note: There are several versions of overlayfs available to the Linux kernel in production in various distributions. Versions 22 and lower have a module called ‘overlayfs’ while newer versions (23 and higher) have a module called ‘overlay’ – note the lack of the ‘fs’ in the newer version. Psd will automatically detect the overlayfs available to your kernel if it is configured to use one of them.

Overlayfs is a simple union file-system mainlined in the Linux kernel version 3.18.0. Starting with psd version 5.54, overlayfs can be used to reduce the memory footprint of psd’s tmpfs space and to speed up sync and unsync operations. The magic is in how the overlay mount only writes out data that has changed rather than the entire profile. The same recovery features psd uses in its default mode are also active when running in overlayfs mode. Overlayfs mode is enabled by uncommenting the USE_OVERLAYFS="yes" line in $XDG_CONFIG_HOME/psd/psd.conf followed by a restart of the daemon.

Since version 6.05 of psd, users wanting to take advantage of this mode MUST have sudo rights (without password prompt) to /usr/bin/psd-overlay-helper or global sudo rights. The following line in /etc/sudoers will supply a user with these rights. Add it using visudo:

username ALL=(ALL) NOPASSWD: /usr/bin/psd-overlay-helper

See the example in the PREVIEW MODE section above which shows a system using overlayfs to illustrate the memory savings that can be achieved. Note the “overlayfs size” report compared to the total “profile size” report for each profile. Be aware that these numbers will change depending on how much data is written to the profile, but in common use cases the overlayfs size will always be less than the profile size. Warning: Usage of psd in overlayfs mode (in particular, psd-overlay-helper) may lead to privilege escalation. [2]

The way overlayfs works is to mount a read-only base copy (browser-back-ovfs) of the profile, and manage the new data on top of that. In order to avoid resyncing to the read-only file system, a copy is used instead. So using overlayfs is a trade off: faster initial sync times and less memory usage vs. disk space in the home dir.