I have a 256Gb USB drive that I am using as a second “hard drive.” It has an entry in fstab so it mounts on boot.
UUID=38cb1d9c-477a-422f-8995-a9f8da4ca66d /media/SanDisk3.2Gen1 ext4 defaults,noatime 0 2
However, when the system is put to sleep, by closing lid or power > suspend, the USB drive unmounts and doesn’t automatically remount on system resume. Currently what I do is just open the terminal and run
sudo mount -a
I did some researching online and learned I could put bash scripts in the directory /usr/lib/systemd/system-sleep that could run terminal commands upon system resume.
Here is the script I have:
#!/bin/sh #mount-Sandisk-on-remsume.sh case $1 in pre) ;; post) mount -a ;; esac
But it doesn’t seem to work, the drive is still not mounted on system resume. Here is the error code from journalctl:
Sep 15 22:51:12 Yoga13ManjaroGnome : /usr/lib/system-sleep/mount-Sandisk-on-resume failed with exit status 32
I can’t find anywhere what exit status 32 means or how I might get this to work properly. Am I even using the best approach? Any advice to make the script work or even how to achieve my goal using a different method would be greatly appreciated. Also let me know if you want more information I’ll do my best to provide it.