Auto-mount drives at boot

Thanks linux-aarhus, I will try that and let you know how I go. If I do it correctly I imagine it will work so once I get to that stage I’ll post it as the solution :slight_smile:

Sorry, got stuck at the very first line /etc/systemd/system/data-part1.mount - it gave the response: “No such file or directory”

I have used this for years - it works - so I reckon you have made a spelling error or a wrong uuid.

did you put the correct uuid in the respective files?

How did you try to create this file exactly?
Through terminal or your file manager?

I cannot create it in ETC (it is a system file) and not sure how to create it in terminal…do I use the nano editor perhaps?

I don’t really know Thunar as I never really played with XFCE. Dolphin in KDE, you cannot indeed perform actions in root folders.
In Cinnamon or in Gnome, you can with Nemo and Nautilus.

In terminal, you can create a file with sudo touch /etc/systemd/system/data-part1.mount then sudo nano to edit the file.
Or directly sudo nano etc/systemd/system/data-part1.mount to create and edit directly the file.

edit : obvisously as you create/edit a file in /etc, you have to use sudo

1 Like

thanks, I’ll try that now…

EDIT: Ok now we’re cooking that worked - sorry I cannot post it as the solution I think the post from linux-aarhus will be that, but thanks so much for the assist. I’ll go back to his (her?) instructions now and try again!

1 Like

ok, I think I got the first one correct, but the second one (even though I did it exactly the same) didn’t.

Second one is an NTFS drive, does that make a difference?

here is the terminal message:
Created symlink /etc/systemd/system/ → /etc/systemd/system/data-part1.mount.
Created symlink /etc/systemd/system/ → /etc/systemd/system/data-part2.mount.
Failed to start data-part2.mount: Unit data-part2.mount has a bad unit file setting.
See system logs and ‘systemctl status data-part2.mount’ for details. that then shows:
○ data-part2.mount - Data partition 1
Loaded: bad-setting (Reason: Unit data-part2.mount has a bad unit file setting.)
Active: inactive (dead)
Where: /data/part1
What: /dev/disk/by-uuid/$809A1AD69A1AC894

Oct 09 08:48:39 NUC-1 systemd[1]: data-part2.mount: Where= setting doesn’t match unit name.>

Could you paste here the content you placed in your second mount file?

I’d rather put Type=ntfs instead of auto

However, NTFS being a Windows extension, maybe that’d explain why…

1 Like

Description=Data partition 1



But I noticed in the first one, the Description is part 4 but in the Where it still has part 1 - is that the mismatch perhaps?

Try with replacing auto and launch the commands again.

Don’t forget to reload the system daemon.

1 Like

ok - it takes me a while as this is still pretty new :slight_smile: so sorry for the delay…

Ok so it was a mismatch between the where which was still set to part1 - fixed that and re-ran the ```
sudo systemctl enable --now data-part1.mount data-part2.mount

Then the terminal hung for ages then came up with this:

Defined-By: systemd
░░ Support:
░░ A start job for unit dev-disk-by\x2duuid-\x24ac007462\x2d356e\x2d4d54\x2d9bed\x2dc2f10defcd81.device has finished with a failur>
░░ The job identifier is 1851 and the job result is timeout.
Oct 09 09:17:04 NUC-1 systemd[1]: Dependency failed for Data partition 4.
░░ Subject: A start job for unit data-part1.mount has failed
░░ Defined-By: systemd
░░ Support:
░░ A start job for unit data-part1.mount has finished with a failure.
░░ The job identifier is 1847 and the job result is dependency.
Oct 09 09:17:04 NUC-1 systemd[1]: data-part1.mount: Job data-part1.mount/start failed with result 'dependency'.
Oct 09 09:17:04 NUC-1 systemd[1]: dev-disk-by\x2duuid-\x24ac007462\x2d356e\x2d4d54\x2d9bed\x2dc2f10defcd81.device: Job dev-disk-by>
Oct 09 09:17:04 NUC-1 sudo[8012]: pam_unix(sudo:session): session closed for user root
Oct 09 09:17:04 NUC-1 audit[8012]: USER_END pid=8012 uid=1000 auid=1000 ses=1 subj==unconfined msg='op=PAM:session_close grantors=>
Oct 09 09:17:04 NUC-1 audit[8012]: CRED_DISP pid=8012 uid=1000 auid=1000 ses=1 subj==unconfined msg='op=PAM:setcred grantors=pam_f>
Oct 09 09:17:04 NUC-1 kernel: kauditd_printk_skb: 18 callbacks suppressed
Oct 09 09:17:04 NUC-1 kernel: audit: type=1106 audit(1633731424.736:293): pid=8012 uid=1000 auid=1000 ses=1 subj==unconfined msg='>
Oct 09 09:17:04 NUC-1 kernel: audit: type=1104 audit(1633731424.736:294): pid=8012 uid=1000 auid=1000 ses=1 subj==unconfined msg='>
Oct 09 09:17:25 NUC-1 kernel: [UFW BLOCK] IN=eno1 OUT= MAC=01:00:5e:00:00:01:bc:30:d9:f9:72:12:08:00 SRC= DST=>
lines 1133-1155/1155 (END)

Wait wait wait. Don’t type all the commands again and again.

First as @linux-aarhus tutorial advise, reload the daemon.
Second, you already enabled with success data-part1.mount according to previous posts.

You get a failure for part1 as you can see.
Either you only type the command for the remaining mounts - here part2 I guess - or you first unmake all your actions then you relaunch all the commands. (so if you already enabled part1, disable it. If you had started it, stop it.)

1 Like

oops, sorry - haha told you I can break it!

I’ll go back and retry from the start…

I’m going to bed now, but read carefully all the topic when you have time, to really understand all the steps.

In the above examples, if you’d need to undo all the actions, undo all starting by the end.
So sudo systemctl disable data-backup.mount, then systemctl show -p ActiveState -p SubState --value data-backup.mount to check the status, and sudo systemctl stop data-backup.mount

Good luck!

1 Like

the uuid’s I just copied and pasted…I had a mismatch on the part and where lines (in part 2) so I fixed that…but apparently I had to restart the daemon?? Not sure what that means…is it I need to unmount the drives and then re-run it?

Oh and sorry for delay - I got called away…

Look, thanks guys - but I am going to delete those two from systemd and give it up…at this stage this stuff is way over my head…

If I installed the KDE desktop this function is simply ticking a box in the file manager, or whatever it’s called. I like xfce but I think it is more for experts who can do this stuff…I tried a reboot and it hung fro ages then something or other timed out and it booted to Manjaro, but that was enough of scare for me…I deleted those two files and re-booted after shutting down totally and it re-booted just fine. SO I might just leave it.

Thanks again, you really did post enough info and help, I just couldn’t fully comprehend it. I might try again at a later stage.

You were there - you just forgot to edit the where part in your second mount unit.

You just pointed the Where= to the same mountpoint as the previous unit.

Also - you didn’t remove the $ sign in the template

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