i forget: sometime my pc is off (in this case i don’t go to shared repertory with OSMC. Will it be ok to shutdown my PC with autofs ?
Yes, that is the “auto” part
Pas certain de bien comprendre ce qu’il faut faire… je fais un sudo autofs et ensuite ? c un script ou une fois pour toute ? mon partage est SMB (repertoire partagé sur le PC)
Merci
This is an English speaking forum please only write in English. If you need translation there are enough tools out there
Not sure I understand what to do… I run a sudo autofs and then what? Is it a script or is it a one-time thing? My share is SMB (shared directory on the PC).
Thanks
Yes, it’s a one time thing to configure it and then your shared directory will be available on the Vero as a local folder
I read the documentation you provide but i dont’ understand what i have to do… Sorry my skiils are very low… Is it a graphical or simple way to do it ? (i have always latency to connect on first time SMB shared repertory on my PC) … kr
There is no GUI way to do it but it should be just a handful of CLI commands. If you want to try it we can try to talk you through it.
Thanks you Fzinken,
I did:
“Sudo apt-get install autofs”
I don’t undersand how mounted a shared repertory on my pc.
I have the local IP of my PC (192.168.x.y), a user name (zzz), a password (yyy)
My repertory can be see on shared workgroup by others PC and OSMC when i mount SMB.
I would like to mount this shared PC repertory on my OSMC to avoid the latency when i first connect to it.
What is the name of the share?
“avoir” is the name of the repository on my pc
Ok here is what to do
sudo nano /etc/auto.master
and add to the end of the file:
/- /etc/auto.smb.shares --timeout 15 browse
(Don’t forget to save the file: CTRL-O ENTER CTRL-X)
Next you need to create a map to the share:
sudo nano /etc/auto.smb.shares
and add
/mnt/avoir -fstype=cifs,username=your_username,password=your_password,iocharset=utf8,uid=osmc,gid=osmc ://192.168.x.y/avoir
Ensure to replace x.y
with correct IP and your_username
and your_password
with your respective username/password (I hope they don’t contain a space).
(Don’t forget to save the file: CTRL-O ENTER CTRL-X)
After that sudo systemctl restart autofs
Now you should see your PC files via
ls -lah /mnt/avoir
Thanks, i did exacly and i have
drwxr-xr-x 3 root root 4.0K Apr 15 16:17 .
drwxr-xr-x 21 root root 4.0K Apr 5 15:46 …
drwxr-xr-x 2 root root 0 Apr 15 16:17 avoir
osmc@osmcvero5:~$ ls -lah /mnt/avoir
ls: cannot open directory ‘/mnt/avoir’: No such file or directory
the directory existe in mnt but it’s empty
if i trey to open it in GUI (winscp) i have :
Fichier ou répertoire inexistant
Code d’erreur : 2
Message d’erreur du serveur : No such file
/mnt/avoir -fstype=cifs,username=user,password=pdw,iocharset=utf8,uid=osmc,gid=osmc ://192.168.yy.zz/avoir
i change user and pdw by real one (also yy and zz
osmc@osmcvero5:~$ sudo service autofs stop
osmc@osmcvero5:~$ sudo automount -f -v -d
Starting automounter version 5.1.7, master map /etc/auto.master
using kernel protocol version 5.02
lookup_nss_read_master: reading master file /etc/auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry +dir:/etc/auto.master.d
lookup_nss_read_master: reading master dir /etc/auto.master.d
lookup_read_master: lookup(dir): scandir: /etc/auto.master.d
lookup_read_master: lookup(file): read entry +auto.master
lookup_nss_read_master: reading master files auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry /-
master_do_mount: mounting /-
automount_path_to_fifo: fifo name /var/run/autofs.fifo–
lookup_nss_read_map: reading map file /etc/auto.smb.shares
do_init: parse(sun): init gathered global options: (null)
mounted direct on /mnt/avoir with timeout 15, freq 4 seconds
do_mount_autofs_direct: mounted trigger /mnt/avoir
st_ready: st_ready(): state = 0 path /-
When you run the debug command did you tried ls -lah /mnt/avoir
from second window?
When you try to run ls in the another window you should see something like
do_mount_autofs_direct: mounted trigger /mnt/avoir
st_ready: st_ready(): state = 0 path /-
handle_packet: type = 5
handle_packet_missing_direct: token 54, name /mnt/avoir, request pid 9347
attempting to mount entry /mnt/avoir
lookup_mount: lookup(file): looking up /mnt/avoir
lookup_mount: lookup(file): /mnt/avoir -> -fstype=cifs,r
i’m not sure to undestand.
When i launch :
osmc@osmcvero5:~$ sudo service autofs stop
osmc@osmcvero5:~$ sudo automount -f -v -d
I have :
Starting automounter version 5.1.7, master map /etc/auto.master
using kernel protocol version 5.02
lookup_nss_read_master: reading master file /etc/auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry +dir:/etc/auto.master.d
lookup_nss_read_master: reading master dir /etc/auto.master.d
lookup_read_master: lookup(dir): scandir: /etc/auto.master.d
lookup_read_master: lookup(file): read entry +auto.master
lookup_nss_read_master: reading master files auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry /-
master_do_mount: mounting /-
automount_path_to_fifo: fifo name /var/run/autofs.fifo–
lookup_nss_read_map: reading map file /etc/auto.smb.shares
do_init: parse(sun): init gathered global options: (null)
mounted direct on /mnt/avoir with timeout 15, freq 4 seconds
do_mount_autofs_direct: mounted trigger /mnt/avoir
st_ready: st_ready(): state = 0 path /-
And it is blocked, i have to run a CTRL-C to stop. After i have :
master_do_mount: mounting /-
automount_path_to_fifo: fifo name /var/run/autofs.fifo–
lookup_nss_read_map: reading map file /etc/auto.smb.shares
do_init: parse(sun): init gathered global options: (null)
mounted direct on /mnt/AVOIR with timeout 15, freq 4 seconds
do_mount_autofs_direct: mounted trigger /mnt/AVOIR
st_ready: st_ready(): state = 0 path /-
^Cdo_notify_state: signal 2
master_notify_state_change: sig 2 switching /- from 1 to 5
st_prepare_shutdown: state 1 path /-
expire_proc: exp_proc = 4093637680 path /-
expire_cleanup: got thid 4093637680 path /- stat 0
expire_cleanup: sigchld: exp 4093637680 finished, switching from 5 to 7
st_shutdown: state 5 path /-
umount_multi: path /mnt/AVOIR incl 0
umounted direct mount /mnt/AVOIR
automount_path_to_fifo: fifo name /var/run/autofs.fifo–
shut down path /-
autofs stopped
osmc@osmcvero5:~$
Before having the prompt again
Open a second window/ssh session and run ls /mnt/avoir
in that window while the first one is “blocked”
During the first SSH windows is blocket on a seco,d i have launched a ls /mnt/avoir and i have the same ::
osmc@osmcvero5:~$ ls /mnt/avoir
ls: cannot access ‘/mnt/avoir’: No such file or directory
osmc@osmcvero5:~$
And what do you have in first window?
There should be additional lines when you do the ls