Mount options for external SSD used for backups (BackinTime and general data storage)

Hi!

I have a brand new SSD (my first time dealing with one), with two separate partitions, /dev/sdb1 formatted as ext4 for the BackinTime snapshots and /dev/sdb3 formatted as exfat for data storage (I partitioned the disk with Gnome Disks) and transfer between different systems (Linux and Windows).

Upon reading wikis, FAQs and forums, I realized that I might need to add the mount option noatime for the SSD in order to preserve its lifespan.

Currently, the SSD is mounted automatically whenever plugged in and Gnome Disks shows this:

Whenever the partitions are mounted, they show up in /proc/mounts like this:

/dev/sdb1 /run/media/username/backup ext4 rw,nosuid,nodev,relatime,errors=remount-ro,stripe=256 0 0

/dev/sdb3 /run/media/username/DATA exfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro 0 0

My /etc/fstab contents are:

# <file system> <mount point> <type> <options> <dump> <pass>

UUID=D47-C	/boot/efi	vfat	umask=0077	0	2

UUID=b53-6f35-4728-b430-8467       /       ext4    defaults,noatime        0       1

UUID=78f-399b-4233-82a6-09eef       /home   ext4    defaults,noatime        0       2

UUID=1f9f-d13b-41ac-bf80-3f29       swap    swap    defaults,noatime        0       0

I realize that if I add a new line in /etc/fstab for an external drive that is not going to be constantly plugged in, I might run into trouble at boot time. To avoid that, I read that I might need to add the mount option noauto and the options nofail and x-systemd.device-timeout=1ms too.

Now for those who can offer me their advice, I have the following questions:

  1. Will BackinTime work correctly and without problems if I replace the default relatime with noatime?

  2. If yes, how should I best go about adding this mount option? By modifying the Mount Options in Gnome Disks (I want to maintain the same behavior whenever I plug in the SSD, which is automatically mounted and labeled)? Or by adding a new line in /etc/fstab? Do I have to get systemd involved?

  3. What about the option x-systemd.automount? Would I need it so that the drive is automatically mounted whenever plugged in?

  4. Is there a way to make those mount options permanent for whenever I switch between different systems (Linux or Windows) or different machines? Will modifying the Mount Options on Gnome Disks do this?

  5. What should the mount options be in my case? Would the following changes do the trick and which should I keep?

For /dev/sdb1

rw,nosuid,nodev,noatime,noauto,x-systemd.automount,nofail,x-systemd.device-timeout=1ms,errors=remount-ro,stripe=256 0 0

For /dev/sdb3

rw,nosuid,nodev,noatime,noauto,x-systemd.automount,nofail,x-systemd.device-timeout=1ms,uid=1000,gid=1000,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro 0 0

You may want to have a look at this post: Mount a external hard drive with execute permissions

What I have found that works best for is to disable User Sessions Defaults and enable Mount at startup.
Then select Identity As < By UUID> then select your mount path to be in /run/media/<your_username>/<your_mount_directory_name/

1 Like

Adding nofail alone is enough for not preventing your system from booting when the drive is absent, and still allows it to automatically mount at boot when present.


:man_shrugging:


gnome-disks acts as a frontend for /etc/fstab, so using the former to change mount options effectively applies in the latter.
For mounting using systemd, see: [root tip] Use systemd to mount ANY device


See my first quote reply.
Alternatively, you can use systemd instead of /etc/fstab for mounting your optional drive, so that it will naturally skip it when absent. See my previous quote reply.


That would be very tricky between Linux systems, if possible at all, because that would imply those options must be shared and accessible at boot time from all your systems.
That seems impossible to share between Linux and Windows systems as they don’t share mount setting format: AFAIK Linux uses files whereas Windows uses registry.


See my previous quote replies.

1 Like

Thank you both!

You sure did help me understand a lot of the questions I had after reading wiki pages!

I’ve made the decision to try Gnome Disks first.

A few last clarifications and I’ll be good to go and test this:

@DeLinuxCo In Gnome Disks,

  1. About the “Mount Options” line, do I have to keep all the other mount options (apart from relatime which I will change to noatime and the nofail option that I will add) as I see them now in /proc/mounts?

  2. Since <dump> = 0 and <pass> = 0 are not <options>, I won’t specify them anywhere in Gnome Disks, right?

Okay. I went ahead and made the changes as I said in my last post. After creating the directories for the mount points, everything works and the device is auto-mounted just like before.

Also, editing /etc/fstab apparently is the fastest method, because Gnome Disks automatically selects and reselects strings of characters and numbers for the path to the mount point (which are not useful for the user) and keeps the mount option x-gvfs-show, even though it is redundant if the mount point is under /run/media or /home. Of course, you delete those and add your own, but that’s what you do in fstab as well.

Anyway, thanks guys!

However, after rebooting, during the fs check screen, I see a message like

[ TIME ] Timed out waiting for device dev-disk-by\...
[DEPEND] Dependency failed for /run/media/username/...

After that, the booting process continued. But it took a considerably longer time to boot.

Is that a standard message when I have nofail mount option enabled?

Can I make it go away?

I don’t recall this part taking longer with a missing partition, though last time it happened to me was a long time ago. What options have you ended up with for your fstab mounts?


I think it is standard for whenever a defined mount is missing. nofail merely allows you to continue.
Mounting through systemd might produce different messages.

1 Like

Mount options in /etc/fstab are

for the ext4 partition:

rw,nosuid,nodev,noatime,nofail,x-systemd.device-timeout=1ms,errors=remount-ro,stripe=256

for the exfat partition:

rw,nosuid,nodev,noatime,nofail,x-systemd.device-timeout=1ms,uid=1000,gid=1000,fmask=0022,dmask=0022,iocharset=utf8,errors=remount-ro

Well, it took long enough for me to actually read the messages, remember and understand the gist of them. I thought that with the mount option x-systemd.device-timeout=1ms, this whole process would have taken a millisecond and wouldn’t be noticeable.

Maybe it is something else taking longer during bootup in the fsck screen and it is just the message that hangs there, not the actual process. I think I need to read a little bit more about entropy or something, but that’s another topic.

I can’t help much with debugging boot time besides linking you that:
https://wiki.archlinux.org/title/Improving_performance/Boot_process

Thanks.
I should also mention that the [TIME] out and [DEPEND] failure message is parsed 3 times, consecutively.
I really don’t understand why.
I’ll test with noauto instead of nofail too.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.