Best way to automount ext4 SSD

I just added a new SSD to my system (for games) and created a ext4 Filesystem on it. I now wonder what is the best way to automount the drive. Should i use discard? On the Arch-Wiki i read it could cause Issues? Any recommendation?

Highly recommended read –

1 Like
sudo blkid

Then use the UUID to add to your /etc/fstab file at your desired mount point, like so:

UUID=d2f4d267-7412-4279-868d-f00742e1ff25      /data      ext4      defaults      0 2
1 Like

Oh PLEASE stop with the advise with fstab

If you read carefully, I can’t quote cause its been a while since i read that page, it should tell you what file systems can cause problems with discard…

Example: for the OP how easy it is:

$ sc-cat mnt-LutrisGames.{,auto}mount | xc

# /etc/systemd/system/mnt-LutrisGames.mount


# /etc/systemd/system/mnt-LutrisGames.automount


# Autostarted by Gameing-Mounts.service
# [Install]

The above uses Filesystem LABEL but you can use UUID’s also ofcourse.
Plus the above is started using a service that pulls in other automount units also, just to make it easy to start/stop related mounts for gaming in my example…

As for the options (regardless of if you choose fstab or systemd to mount), from all have read,


makes not much difference most of the time, makes things slower in some cases, and even breaks things in some very rare cases.
So for me it is a clear decision against it.
Which is the default. Also, by default, trimming is done once a week. You can change the timer, or run

sudo fstrim -v /dev/nvme0

Manually after deletion of many gigabytes at once.

I’ll use the topic to ask something myself: at the beginning of the ssd times, i thought


Is a must. But i do not see it in the defaults in the manjaro fstab? Should i add it to reduce writes or nowadays it is somewhere else.

I use noatime as option in my systemd.mount units for SSD, yes.
It reduces writes due to reads and thus makes the live span longer…


Convention and systemd docs, etc, still consider fstab the ‘proper’ way.

configuring mount points through /etc/fstab is the preferred approach

I know that post calls the statement ‘contradictory’ … but I’m not entirely sure I agree.


What…? That’s what I do. Well, except I use GNOME Disks to make the fiddly stuff easier. :grin:


Please don’t assume everyone uses BTRFS. They don’t.


Examples are examples for a reason…

The should burn that line, and im sure they will in due time…

Noatime Is a must. But i do not see it in the defaults in the manjaro fstab?

Sorry, it is actually the default. I just checked my fstab

UUID=....................  /              ext4    defaults,noatime 0 1

That is done automatically by manjaro Calamares installer, i did not touch anything. Calamares detected it was a nvme drive.

Sure, examples are just that.

Don’t get me wrong, both the tutorial linked twice above and your advice are helpful.

1 Like

OK … but still … whats your reasoning?

Personally I find adding a single intelligible line to a single file a whole lot easier than fiddling with multiple systemd units (especially for an internal drive that isnt going anywhere).


Getting rid of advise using fstab is like getting rid of advise using cron
Sure they both work, but you know what the future is and whats better by now don’t you?
Reason why systemd “still” supports fstab, which is actually translated by it self into units, is because of prehistoric ppl still hanging to old stuff :stuck_out_tongue:

Where is the future where fstab disappears?
Is it some time in 2030 and you have seen it in your crystal ball?
I havent heard one iota about such a thing.
Maybe I missed it. But still … wheres such an adamant position coming from?

It is not fair to compare to cron …
cron is legacy software one must install and attempt to use instead of systemd units.
This is the opposite.
/etc/fstab exists in the filesystem, is expected, and used, by default. You must go out of your way to use systemd units to mount otherwise.


Uhmmm sorry, yes it is actually super secret and top secret info to tell you, which means i have to kill you 30s after you reading this:
“I am from the future yes”
:woman_facepalming: :rofl:

One of my ancestors was named “ChatGPT” :stuck_out_tongue_winking_eye:

Ok … so no evidence or support … just something you started saying for some reason. Got it.

EDIT: you can facepalm/emoji me … but its a pretty simple proposition.
You make a claim … I ask for evidence … you do not produce it … I discount claim.

1 Like

…it will self-destruct…

Self-destruction sequence paused…

Hey, we’re here to help out a user who asked a question, remember?

No fighting, no biting.

1 Like

Sorry you’re absolutely right, please just delete all thos off-topic replies :wink:

It’s a little late for that.

Unless you want me to delete everything after @cscs’s first reply here? I don’t think that would be fair, because then it would bulldozer @Teo’s reply as well.

Answering the question

fstab example

UUID=some-long-uuid    /ext4    /data/games    defaults,rw,noatime    0 0
mkdir -p /data/games
sudo mount -a

unit example
naming convention: data-games.mount (mountpoint-path converted to filename)
file location: /etc/systemd/system

Description=Games partition


sudo systemctl enable --now data-games.mount

In both cases you need to set permissions and/or ownership to be able to actually use it.

sudo chown $USER:$USER /data/games -R

That is just my logic that doesn’t compute fstab is preferred and converting to units into a logical meaning.

I completely agree that for internal devices - always on - fstab is the best documented method - no doubt about that - but making a system mount unit for it is just as simple.

Many systemd unit flags for network and automount can be added to fstab - making it extremely confusing for those new to Linux and then it gets error prone.

When you need network mounts and removable device mount - the extra work put into the mount units is well paid off.