Add an option in dietpi-drive_manager to customize mount options like relatime or strictatime to enable accurate atime tracking

Hello DietPi Team,

First, thank you for your continued efforts in developing and maintaining DietPi. It’s an excellent lightweight distribution that I’ve found incredibly useful.

I would like to request a feature enhancement for the dietpi-drive_manager utility. Currently, it appears that custom mount options, such as relatime or strictatime, cannot be set through the Drive Manager interface. Moreover, manual edits to /etc/fstab are often overwritten when using dietpi-drive_manager, which makes it challenging to maintain custom configurations.

This limitation affects use cases where accurate file access time (atime) tracking is essential. For instance, I have automation scripts that rely on atime to identify and manage files that haven’t been accessed in a specified number of days. Without the ability to set relatime, these scripts cannot function as intended.

Therefore, I propose the following enhancement:

Allow Custom Mount Options: Introduce an option within dietpi-drive_manager to set custom mount options, enabling users to specify parameters like relatime, strictatime, or others as needed.

Implementing this feature would greatly enhance the flexibility and usability of DietPi for users with specialized requirements.

Thank you for considering this request. I appreciate your time and look forward to any updates on this matter.

Best regards

Since we use sytemd we can work around this problem. You could create a systemd mount unit, which is not affected by fstab changes.

In this example we mount /dev/sdb1 to /mnt/example.

First create the mount point mkdir /mnt/example.
The mount point for this path needs to be named mnt-example.mount, so we create this file:

sudo nano /etc/systemd/system/mnt-example.mount

Add this content (adjust to your needs):

[Unit]
Description=Mount /mnt/example with options
DefaultDependencies=no
After=local-fs.target

[Mount]
What=/dev/sdb1
Where=/mnt/example
Type=ext4
Options=strictatime

[Install]
WantedBy=multi-user.target

Save and close the file and run:

sudo systemctl daemon-reload
sudo systemctl enable --now mnt-example.mount

You can also mount and unmount like you would (re)start and stop a sytemd service:

sudo systemctl stop mnt-example.mount
sudo systemctl start mnt-example.mount