Help getting extra hard-drives automatically mounted on login

Hello again, I have another newbie questions that I’m struggling with. I tried googling and found some answers, but not sure I have understood it enough to feel safe actually trying it.

I have two extra built-in hard-drives and on external one for backups. Something I have been struggling with is how make these auto-mount on login.

I have read I need to add things to my systemmd, but I’m not sure how and if of there is a way (like with showing the password in terminal where I created a new file, see forum post) to do this.

Help would be greatly appreciated.

Thanks,
AtBios

I would mount them using their UUIDs via fstab.
https://wiki.archlinux.org/index.php/Fstab

1 Like

…I must say I haven’t had a problem with this using a modern DE and a modern file manager. I have one internal SSD and one internal HDD and one external HDD.

The SSD is split up in one 512Mb EFI partition, one 80Gb W10 partition and one 39.5 Gb / partition for EOS.

The HDD has one 512 Gb partition for Windows data, one 512Gb partiton for /home (for EOS).

The external drive has a 2Tb extra space for Windows, and one 2Tb backup / extra storage for Linux.

All of these are mounted automatically; I never have to do anything.

When I’m serious I use the terminal as everyone here will probably suggest.
However sometimes I like using GUI tools and enjoy the simplicity of it.
I recommend you use Disks. If you don’t already have it, you would need to install gnome-disk-utility like this:

yay -S gnome-disk-utility

You will then find Disks in your applications menu:
capture-200604-135500

Then you
A. Select the disk you are interested in by clicking on it
B. Select the partition by clicking on it
C. Click Additional partition options

Then select Edit mount options

capture-200604-135921
And finally select all the mount options:
a. Uncheck so you can select your custom options
b. This is the main thing, you would want to check that to automount on system startup
c. Checking this will display the partition in your File Manager Devices panel (see last pic). There could be cases where you would want to automount a partition but not clutter your file manager devices panel (like you can see in my last pic there’s a partition called 128GB volume. I would probably uncheck b and c for that because that is a foreign OS that I don’t want to accidentally mess around, so I’d probably better not have it automount, nor show in my File manager.
d. This is the name you want to show in File Manager (again see last pic)
e. These are the mount parameters. I’d leave them as is if you don’t really know what you are doing.
f. Where you want the partition to be mounted

After pressing OK the mount parameters are automatically written to /etc/fstab. Editing them in /etc/fstab, or changing them here does the same thing. Here’s the line that the options in the screen above translate to in my fstab:

Here’s how it would look in File Manager:
capture-200604-141441

As always remember that when you are working with drives there is a danger of ruining data. For example if in the first pic you were to press the minus sign instead of the “Additional mount options” you would effectively delete the partition with everything on it (there would be a prompt asking to confirm before doing so, but hey…).

10 Likes

The internal drives, I would use a traditional mount in /etc/fstab. It will be the most reliable and they will be always available.

For the external drive, I would use a systemd-automount. The reason for this is that automounts are mounted on access and won’t interrupt your boot process or cause problems if the drive is temporarily disconnected.

If you share the output of

lsblk -o NAME,FSTYPE,UUID,PARTUUID,MOUNTPOINT

we can help you build the fstab entries.

5 Likes