Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4906

Networking and servers • Re: Rpi4 with Samba - Shutting down HDDs that are not working

$
0
0
IIRC systemd can do this for you but probably only if you are mounting the drives from /etc/fstab. If you're using the desktop's automounter, A. you should really switch to using /etc/fstab (Samba starts before the desktop and things won't get mounted if a user never logs in), and B. it may be possible but I have no idea how.

Your requirement to "automatically putting the device in the folder I am sharing back into read-only mode" seems an odd one and implies that the mountpoint will be writeable over Samba when the partition is not mounted. Easiest way to make something read only for clients is to set that in the share definition. Other methods include setting permissions on the empty mount point and the mounted partition's contents; and mounting the partition read only.

The mount options you need to investigate are x-systemd.automount and x-systemd.idle-timeout=T where T is the time in seconds after which an idel device is unmounted.

[shameless self promotion]
You might find the following to be of interest:
Using fstab A Beginner's Guide
Building A Pi Based NAS
[/shameless self promotion]

Statistics: Posted by thagrol — Sun Mar 10, 2024 4:58 pm



Viewing all articles
Browse latest Browse all 4906

Trending Articles