Auto mounting of a share fails on boot?

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
peter_964rs
Posts: 1
Joined: Tue Aug 06, 2019 8:06 pm

Auto mounting of a share fails on boot?

Post by peter_964rs » Tue Aug 06, 2019 8:25 pm

Hi All

My first post but I've haunted for a while. I now have x10 Pis doing various things around the place, some in different states of development, and all but two run DietPi. Time to donate, perhaps?

Anyways, my problem is that I have one RPi4 sharing a hard drive that is USB-attached for storing CCTV captures generated using MotionEye, and a second RPi4 on which I am also running MotionEye that should connect to the first using Samba so that all media files created by either Pi are on the same hard drive. The idea is that, with x5 IP cameras, I need to load-balance across Pis, so the first manages x2 cams, and runs Samba, and the second manages x3 cams.

I have successfully created a Samba share on the first and it is available and mountable after reboot from either the second Pi or my MacBook.

I can mount the share manually. However, I can't seem to get the share to auto-mount after rebooting and can't fathom why.

I have checked /etc/fstab and the entry for my Rpi server is there but on reboot it isn't mounted. If I do 'mount -a' then it is mounted; I check using 'df -h'. Just not after reboot.

Is there another config file I should edit? A log file I can inspect (I'm not sure where to look)

Any ideas welcome :)

ghettopi
Posts: 39
Joined: Tue Jul 30, 2019 8:17 pm

Re: Auto mounting of a share fails on boot?

Post by ghettopi » Tue Aug 06, 2019 9:59 pm

You definitely shouldn't have to edit any other file except fstab. What type of drive is it? i.e. what is it formatted as? Are you sure that your fstab entry is correctly formatted?

I recently started having issues with mounting myself actually. Funny it was fine when using exfat but as soon as I formatted to ext4, I couldn't get write access to the mounted partition in samba no matter what I did. I tried all manner of entries in samba and fstab. Nothing made the drive writeable so I reverted back to exfat.

User avatar
MichaIng
Site Admin
Posts: 1894
Joined: Sat Nov 18, 2017 5:21 pm

Re: Auto mounting of a share fails on boot?

Post by MichaIng » Sat Aug 10, 2019 6:47 pm

journalctl -u mnt-point.mount
journalctl -u mnt-point.automount

Could be used to check mount logs for a drive with /mnt/point as mount point.
Otherwise journalctl itself going through boot messages and the parts where external drives should be mounted, might give a hint.

What is a bid strange is that even dietpi-boot calls mount -a after network wait loop (if enabled) :?.

About ext4 + samba it should be definitely a permissions issue. The samba user requires R/W access while by default drives are mounted with root:root 755 permissions which means only root user has write permissions to the drives root dir. This could be adjusted by fstab entry or better you create a sub dir, run chmod -R 777 on it and share/mount this via Samba to rule out any permission issues. But all this is only relevant server-side. Samba does not transfer unix permission, so client-side it is only a question of the mount options.

h_media
Posts: 2
Joined: Thu Aug 15, 2019 12:49 pm

Re: Auto mounting of a share fails on boot?

Post by h_media » Thu Aug 15, 2019 1:13 pm

I'm having troubles with Samba shares not mounting on boot with a new RPi4 also. The same setup was working perfectly on a RPi3.

I have three Samba shares setup, and on reboot they're still listed in /etc/fstab, but the first Samba share listed doesn't mount or appear in DietPi-Drive_Manager until running the refresh option.

h_media
Posts: 2
Joined: Thu Aug 15, 2019 12:49 pm

Re: Auto mounting of a share fails on boot?

Post by h_media » Fri Aug 16, 2019 1:56 am

Update: I've added x-systemd.automount to each Samba mount in /etc/fstab which appears to solve this issue, as noted here:

https://wiki.debian.org/SAMBAClientSetup
Note: If you're on Buster, you'll need to add the option x-systemd.automount to mount the share on startup.

Post Reply