Editing fstab to include 2 extra drives

Hi!. I’m a noob, so sorry if I explain something wrong.
I’ve got 3 drives on my PC, 1TB for boot, home etc, then 1TB for Games and 256GB for downloads.

Main drive, with home, boot etc loads on start of the PC, but others needs to be manually mounted. I usually just click on them in Dolphin (KDE file explorer) and they just mount. I tried adding them to auto mount in “Device Auto Mount” in KDE, but they require password to be put when starting the PC which results in Steam not detecting library. So I thought about changing fstab. I’ve tried to read on Arch Wiki how to do it, but I think in current point in time, it’s a bit too much to understand for someone with such low level of knowledge.
Could someone please make sure that my fstab seems fine? Something tells me that I messed something up here.



I do have a backup made before I edit it, but rather not to have to use it.
Will it still require password on start before mounting?
I’ve read about genfstab yet some people said it might brick the system as it’s not used right after installing the system (?).

Thanks for help!

If your external drives are formatted as ext4 (or another Linux-native filesystem), then they abide by UNIX permissions.

Therefore, on a single-user installation, it is better to mount them to directories under your user’s home directory, because then the mountpoint will be owned by your user, as opposed to if you mount them under /run/media/, which is a temporary filesystem that ceases to exist once the machine shuts down or reboots. And if you want to mount them to directories in the root directory, then you ought to know that only the root account has write access there.

Please read through the following two elaborate tutorials, and you will understand… :point_down:

:wink:

2 Likes

So, they’re not external, they’re internal, connected through SATA inside my PC, they just didn’t mounted on start. I took the bite, saved my settings and it works. I’m going to read through what you sent so thanks for that. My main issue was that I wasn’t sure if I should add the path /run/media/ etc with UUID or not. But yeah, everything works, so thanks!

That is a transient directory, if I recall correctly, that gets created at boot.

And indeed, it is a tmpfs, it only exists in RAM:

$ mount | grep run
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64)
[...]

Which makes it unsuitable for permanent mounts.

A useful command for checking your fstab file:
sudo findmnt --verify --verbose
This will warn you of any “gotchas”. It’s also worth adding nofail to the options for any new filesystems you add. Otherwise, if for any reason those filesystems aren’t available at boot, systemd will simply hang, giving you no clue what’s wrong.

2 Likes

Then my advice is to not bother editing fstab.

This GUI is very friendly and you can get all your answers as you use it…

Here you can see mount options for my T3 storage disk:

You can install gnome-disks. It won’t make any typos and your system won’t end up bricked.

Just to add a few points.

Your screenshot cut off the last 2 columns, because the paths for your mountpoints are incredibly long. Why use the UUID in the mountpoint?

Here’s one of mine to compare.

UUID=10675c07-3ca7-46ce-af31-9de273422505  /media/dev  ext4  relatime,nofail  0 2

You can label your partitions to keep track of them.

$ lsblk -f
...
nvme0n1p1 ext4        1.0   dev       10675c07-3ca7-46ce-af31-9de273422505   59.7G    88% /media/dev
...

But whatever floats ya boat. :smile:

You can unlock encrypted devices using /etc/crypttab if you want.

https://wiki.archlinux.org/title/Dm-crypt/System_configuration#crypttab
https://man.archlinux.org/man/crypttab.5

By deafult, but that can be changed using chown or chmod depending on the use case.

Also, you can make sure it works using mount.

sudo mount -a  # mounts everything in fstab that isn't already mounted
lsblk          # check everything mounted ok

Please don’t post pictures of text, just copy and paste the text inside three backticks like this:

```
text
```

which gives you this:

text

Or select the text and click </>

2 Likes

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