Initramfs and fstab... How to AutoMounting Windows Shares on Vero 4k?

Hi, I’am using Transmission for downloading movies on my WDMyCloud system. To ease the job, I am use (on Raspberry Pi3) to:

  1. Create the following folder /mnt/wdmycloud/Public in /mnt
  2. Add the following line in /etc/fstab
    //WDMYCLOUD/Public /mnt/wdmycloud/Public cifs guest,iocharset=utf8,gid=100,uid=1000,_netdev 0 0
  3. Create some symbolic links in /home/osmc/Downloads to ease path entering on the Transmission web page
    e.g. ln -s /mnt/wdmycloud/Public Public
    e.g. ln -s “/mnt/wdmycloud/Public/Shared Movies” Movies
    e.g. ln -s “/mnt/wdmycloud/Public/Shared Movies/Thriller” Thriller
    With my new Vero 4K, I did not manage to get AutoMounting throught the above line instruction in fstab. It seems that there is a conflict with initramfs and the sequence…
    Any idea ?
    Best regards,
    Olivier

Try adding the noauto,x-systemd.automount options in your fstab line.

Did you really mean gid=100?

1 Like

Line change as follows:
/WDMYCLOUD/Public /mnt/wdmycloud/Public cifs guest,iocharset=utf8,gid=1000,uid=1000,_netdev 0 0,noauto,x-systemd.automount
But no automount. See below.

osmc@osmc:~$ df -h
Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
/dev/vero-nand/root 14G 1.2G 13G 9% /
devtmpfs 804M 0 804M 0% /dev
tmpfs 906M 8.6M 897M 1% /run
tmpfs 906M 0 906M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 906M 0 906M 0% /sys/fs/cgroup
tmpfs 182M 0 182M 0% /run/user/1000

Yes

Try to access, it should mount on access.

Th “0 0” should be at the end of the line, after the mount options.

Line changes as follows but no improvement.
//WDMYCLOUD/Public /mnt/wdmycloud/Public cifs noauto,x-systemd.automount,guest,iocharset=utf8,gid=1000,uid=1000,_netdev 0 0

Use the IP address of the mycloud instead of by name.

Nothng better with the IP Address

Just to be clear… So now, my fstab file looks like that:

rootfs is not mounted in fstab as we do it via initramfs. Uncomment for remount (slower boot) #/dev/vero-nand/root / ext4 defaults,noatime 0 0

//192.168.1.104/Public /mnt/wdmycloud/Public cifs guest,noauto,x-systemd.automount,iocharset=utf8,gid=100,uid=1000,_netdev 0 0

If there any way to chek if my fstab is correct? e.g. through sudo mount -a ?

To summarie the situation, no automount at boot.
After a “sudo mount -a” everything is fine (in other words, fstab instructions are correct)
So, how to make sure that fstab file is proceesed during boot process?

A look around suggests that this is a common issue. The general consensus seems to be that, even with the _netdev option, systemd is running the mount before the network is up.

The above thread offers a number of workarounds.

I think it might be down to a quirk of systemd. I’ll see if I can find out more.

Update: This command is probably worth trying:

sudo systemctl enable systemd-networkd-wait-online.service

Then reboot.

Try changing gid=100 to gid=1000

So just to ensure once more, the automount is not designed to mount on boot but only when you access the folder.
So have you tried a ls /mnt/wdmycloud/Public after booting?
Also to make reading and verifying your fstab easier please use the “preformatted” text button when you post it

Here is what works on my setup without an issue
//<IP of Server>/media /mnt/server_media cifs x-systemd.automount,noauto,iocharset=utf8,user,username=<user on server>,password=<your server password>,uid=osmc,gid=osmc,iocharset=utf8,file_mode=0770,dir_mode=0770 0 0