Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 27/06/2020, à 21:05

iznobe

[ RESOLU ] partage NFS

Bonjour suite a ne nombreuses reinstallations dues a un changement de carte mere + processeur et memoire , j ' esaie de remettre tout ce que j ' avais en place avant .

je n  ' arrive plus a faire partager mes sous repertoires en NFS , je n ' accede qu ' a un dossier , les sous dossiers restent inacessibles .

j ' ai fait un chmod -R 777 des repertoires en partages et sudo chown iznobe:iznobe .
voici mon fichier /etc/exports :

iznobe@iznobe-Pc:~$ cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/mnt/montages/Seagate_1T/PartageS1T 192.168.1.0/24(all_squash,anonuid=1000,anongid=1000,sync)
/mnt/montages/Seagate_4T/perso/PartageS4T 192.168.1.0/24(all_squash,anonuid=1000,anongid=1000,sync)
/mnt/montages/Toshiba_3T/PartageT3T 192.168.1.0/24(all_squash,anonuid=1000,anongid=1000,sync)
iznobe@iznobe-Pc:~$ 

l ' aroborescence de montages des disques :

iznobe@iznobe-Pc:~$ ls -l /mnt/montages
total 40
drwxr-xr-x 2 root root 4096 juin  27 15:46 LMDE2
drwxr-xr-x 2 root root 4096 juin  27 15:46 Maxtor_500
drwxr-xr-x 3 root root 4096 juin  27 15:46 partages
drwxr-xr-x 2 root root 4096 juin  27 15:46 Sauvegardes
drwxr-xr-x 2 root root 4096 juin  27 15:46 Seagate_1T
drwxr-xr-x 2 root root 4096 juin  27 15:46 Seagate_4T
drwxr-xr-x 2 root root 4096 juin  27 15:46 Seagate_4T2
drwxr-xr-x 2 root root 4096 juin  27 15:46 Seagate_500
drwxr-xr-x 2 root root 4096 juin  27 15:46 Toshiba_3T
drwxr-xr-x 2 root root 4096 juin  27 15:46 windows_10
iznobe@iznobe-Pc:~$

et mon fstab :

iznobe@iznobe-Pc:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=2753fdd6-0931-485e-bb92-d2a8cd929831 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=AFB9-EAA3  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sdd1 during installation
UUID=6dd3be64-2092-4e06-817a-ecc5f1463bda /home           ext4    defaults        0       2
# swap was on /dev/sdb2 during installation
UUID=ef33e5d4-25c2-4637-8b5f-6f0bf10963c9 none            swap    sw              0       0


/dev/disk/by-uuid/4f8cc284-cd84-4eeb-b412-7539f81664c4 /mnt/montages/Seagate_4T auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=Seagate_4T 0 0
/dev/disk/by-uuid/6f5e5ed1-b1b5-4bf1-97aa-94495d5fb140 /mnt/montages/Toshiba_3T auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=Toshiba_3T 0 0
/dev/disk/by-uuid/97875de6-3981-4e4e-8819-3bf6cad2b147 /mnt/montages/Seagate_1T auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=Seagate_1T 0 0

# SDD = Maxtor_500 = Windows 10
/dev/disk/by-label/windows_10                           /mnt/montages/windows_10        auto    nosuid,nodev,nofail,x-gvfs-show         0       0
# montage partition Sauvegardes SDC3
/dev/disk/by-label/Sauvegardes                          /mnt/montages/Sauvegardes       ext4    nosuid,nodev,nofail,x-gvfs-show         0       0

# limitation ecritures disques SSD ###
#######################################
tmpfs                                                   /tmp                                                            tmpfs   defaults,size=1g        0       0
tmpfs                                                   /var/log                                                        tmpfs   defaults,nosuid,nodev,noatime,mode=0755,size=1g
#tmpfs                                                  /var/cache/apt/archives                                         tmpfs   defaults,size=2g        0       0
tmpfs                                                   /home/iznobe/.cache                                             tmpfs   defaults,size=1g        0       0

#ramdisk
tmpfs                                                   /mnt/ramdisk                    tmpfs   rw,noatime,x-gvfs-show,size=28G 0       0
##########################################
# FIN limitation ecritures disques SSD ###
iznobe@iznobe-Pc:~$

des idées sur le souci ?

Dernière modification par iznobe (Le 15/07/2020, à 18:41)


retour utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .

Hors ligne

#2 Le 27/06/2020, à 23:57

strike07

Re : [ RESOLU ] partage NFS

Bonjour,

Moi j'ai comme option pour mes exports :

rw,async,no_subtree_check,insecure

peut-être que le no_subtree_check est la solution neutral

Hors ligne

#3 Le 28/06/2020, à 17:23

iznobe

Re : [ RESOLU ] partage NFS

Bonjour et merci .

Je vais tester cela desuite .


retour utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .

Hors ligne

#4 Le 28/06/2020, à 17:40

iznobe

Re : [ RESOLU ] partage NFS

Apres tests , aucun changement , malheureusement .

peut etre une piste , mais je ne saurais l' exploiter :

znobe@iznobe-Pc:~$ journalctl -b | grep nfs
juin 28 21:02:36 iznobe-Pc blkmapd[578]: open pipe file /run/rpc_pipefs/nfs/blocklayout failed: No such file or directory
juin 28 21:02:36 iznobe-Pc kernel: Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
juin 28 21:02:37 iznobe-Pc exportfs[1136]:   NOTE: this default has changed since nfs-utils version 1.0.x
juin 28 21:02:38 iznobe-Pc exportfs[1136]:   NOTE: this default has changed since nfs-utils version 1.0.x
juin 28 21:02:38 iznobe-Pc exportfs[1136]:   NOTE: this default has changed since nfs-utils version 1.0.x
iznobe@iznobe-Pc:~$

Dernière modification par iznobe (Le 28/06/2020, à 20:10)


retour utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .

Hors ligne

#5 Le 29/06/2020, à 20:42

iznobe

Re : [ RESOLU ] partage NFS

Bonjour , maintenant j ' obtiens ca :

iznobe@iznobe-Pc:~$ exportfs -rav
exporting 192.168.1.0/24:/mnt/montages/Toshiba_3T/PartageT3T
exportfs: could not open /var/lib/nfs/.etab.lock for locking: errno 13 (Permission denied)
exportfs: can't lock /var/lib/nfs/etab for writing
iznobe@iznobe-Pc:~$

quel peut bien etre le probleme ?

et si je fais :

iznobe@iznobe-Pc:~$ showmount -e
Export list for iznobe-Pc:
/mnt/montages/Toshiba_3T/PartageT3T 192.168.1.0/24
iznobe@iznobe-Pc:~$ sudo exportfs -v
/mnt/montages/Toshiba_3T/PartageT3T
		192.168.1.0/24(ro,async,wdelay,insecure,root_squash,no_subtree_check,sec=sys,ro,insecure,root_squash,no_all_squash)
iznobe@iznobe-Pc:~$ sudo ufw status numbered
État : inactif
iznobe@iznobe-Pc:~$

alors que mon fichier /etc/exports est le suivant :

iznobe@iznobe-Pc:~$ cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/mnt/montages/Toshiba_3T/PartageT3T/ 192.168.1.0/24(ro,async,no_subtree_check,insecure)
iznobe@iznobe-Pc:~$ 

le demarrage du serveur NFS:

iznobe@iznobe-Pc:~$ sudo sh -x /etc/init.d/nfs-kernel-server start
+ DESC=NFS kernel daemon
+ PREFIX=/usr
+ [ -x /usr/sbin/rpc.nfsd ]
+ [ -x /usr/sbin/rpc.mountd ]
+ [ -x /usr/sbin/exportfs ]
+ DEFAULTFILE=/etc/default/nfs-kernel-server
+ RPCNFSDCOUNT=8
+ RPCNFSDPRIORITY=0
+ RPCMOUNTDOPTS=
+ NEED_SVCGSSD=no
+ RPCSVCGSSDOPTS=
+ PROCNFSD_MOUNTPOINT=/proc/fs/nfsd
+ [ -f /etc/default/nfs-kernel-server ]
+ . /etc/default/nfs-kernel-server
+ RPCNFSDCOUNT=8
+ RPCNFSDPRIORITY=0
+ RPCMOUNTDOPTS=--manage-gids
+ NEED_SVCGSSD=
+ RPCSVCGSSDOPTS=
+ . /lib/lsb/init-functions
+ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
+ [ -r /lib/lsb/init-functions.d/20-left-info-blocks ]
+ . /lib/lsb/init-functions.d/20-left-info-blocks
+ [ -r /lib/lsb/init-functions.d/40-systemd ]
+ . /lib/lsb/init-functions.d/40-systemd
+ _use_systemctl=0
+ [ -d /run/systemd/system ]
+ prog=nfs-kernel-server
+ service=nfs-kernel-server.service
+ systemctl -p LoadState --value show nfs-kernel-server.service
+ state=loaded
+ [ loaded = masked ]
+ [ 4388 -ne 1 ]
+ [ -z  ]
+ readlink -f /etc/init.d/nfs-kernel-server
+ [ loaded != not-found ]
+ _use_systemctl=1
+ systemctl -p CanReload --value show nfs-kernel-server.service
+ [ yes = no ]
+ [ 1 = 1 ]
+ set +e
+ set +u
+ [ xstart = xstart -o xstart = xstop -o xstart = xrestart -o xstart = xreload -o xstart = xforce-reload -o xstart = xtry-restart -o xstart = xstatus ]
+ systemctl_redirect /etc/init.d/nfs-kernel-server start
+ local s
+ local rc
+ local prog=nfs-kernel-server
+ local command=start
+ s=Starting nfs-kernel-server (via systemctl)
+ service=nfs-kernel-server.service
+ systemctl is-system-running
+ OUT=running
+ [ start = status ]
+ log_daemon_msg Starting nfs-kernel-server (via systemctl) nfs-kernel-server.service
+ [ -z Starting nfs-kernel-server (via systemctl) ]
+ log_daemon_msg_pre Starting nfs-kernel-server (via systemctl) nfs-kernel-server.service
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xxterm-256color != x ]
+ [ xxterm-256color != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ [ -z ]
+ FANCYTTY=1
+ true
+ echo -n [....] 
[....] + [ -z nfs-kernel-server.service ]
+ echo -n Starting nfs-kernel-server (via systemctl): nfs-kernel-server.service
Starting nfs-kernel-server (via systemctl): nfs-kernel-server.service+ log_daemon_msg_post Starting nfs-kernel-server (via systemctl) nfs-kernel-server.service
+ :
+ /bin/systemctl --no-pager start nfs-kernel-server.service
+ rc=0
+ [ start = status ]
+ log_end_msg 0
+ [ -z 0 ]
+ local retval
+ retval=0
+ log_end_msg_pre 0
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xxterm-256color != x ]
+ [ xxterm-256color != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ [ -z 1 ]
+ true
+ true
+ /usr/bin/tput setaf 1
+ RED=
+ /usr/bin/tput setaf 2
+ GREEN=
+ /usr/bin/tput setaf 3
+ YELLOW=
+ /usr/bin/tput op
+ NORMAL=
+ /usr/bin/tput civis
+ /usr/bin/tput sc
+ /usr/bin/tput hpa 0
+ [ 0 -eq 0 ]
+ /bin/echo -ne [ ok 
[ ok + /usr/bin/tput rc
+ /usr/bin/tput cnorm
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ [ -t 1 ]
+ [ xxterm-256color != x ]
+ [ xxterm-256color != xdumb ]
+ [ -x /usr/bin/tput ]
+ [ -x /usr/bin/expr ]
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ [ -z 1 ]
+ true
+ true
+ /usr/bin/tput setaf 1
+ RED=
+ /usr/bin/tput setaf 3
+ YELLOW=
+ /usr/bin/tput op
+ NORMAL=
+ [ 0 -eq 0 ]
+ echo .
.
+ log_end_msg_post 0
+ :
+ return 0
+ return 0
+ exit 0
iznobe@iznobe-Pc:~$

Dernière modification par iznobe (Le 29/06/2020, à 20:58)


retour utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .

Hors ligne

#6 Le 01/07/2020, à 00:21

strike07

Re : [ RESOLU ] partage NFS

Bonjour,

que donne la commande :

sudo showmount -e "ip-serveur"

Sinon,est-ce normal que dans votre export, le partage soit en lecture seule (option ro) ?

Hors ligne

#7 Le 01/07/2020, à 18:18

iznobe

Re : [ RESOLU ] partage NFS

Bonjour ,

oui c ' est normal , pour ces partages là qu ' ils soient en lecture seule , c ' est pour disposer sur la TV .

voici le retour de la commande demandée :

iznobe@iznobe-Pc:~$ sudo showmount -e "192.168.1.2"
Export list for 192.168.1.2:
/mnt/montages/Toshiba_3T/PartageT3T       192.168.1.0/24
/mnt/montages/Seagate_4T/perso/PartageS4T 192.168.1.0/24
/mnt/montages/Seagate_1T/PartageS1T       192.168.1.0/24
iznobe@iznobe-Pc:~$

A priori je pencherais pour une question de droits et / ou de proprietaire et / ou d' options , car maintenant j ' arrive a monter les partages sur un autre ordi , mais pas sur la TV , mais bon pure supposition .

Dernière modification par iznobe (Le 01/07/2020, à 18:20)


retour utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .

Hors ligne

#8 Le 01/07/2020, à 21:06

strike07

Re : [ RESOLU ] partage NFS

Bonjour,

avec quel lecteur vous lisez vos vidéos sur votre TV ? Si c'est KODI le problème est connu, il semblerait que l'option "all_squash" doit être ajouté aux exports pour autoriser nobody, voir cette rubrique.

Dernière modification par strike07 (Le 01/07/2020, à 21:07)

Hors ligne

#9 Le 04/07/2020, à 07:41

iznobe

Re : [ RESOLU ] partage NFS

Bonjour ,

Effectivement je lis bien avec kodi , merci pour l ' info et le lien que je vais voir de ce pas .

Ok apres lecture de la partie anglaise concernée par le partage NFS et la configuration des options du fichier /etc/exports , je vois tout de meme plusieurs manieres de configurer la chose :

By changing some of the options of that line, we can use any of three different approaches for getting the access rights configured as we want:

1. The option all_squash (most insecure) - all UIDs connected to the NFS server are mapped to UID 65534 (user nobody)

            In this case all files which shall be accessed on the NFS exported path should have the correct rights for the user "nobody".

2. Using the option "all_squash" in conjunction with the option "anonuid" and "anongid"

            By adding the options "anonuid=501" and "anongid=501" all accesses would be mapped to the user with UID 501 (user "mobile" on iOS or user "memphis" in my example above)

3. Removing the "all_squash" option the accesses will be done with the UID given from the user which is running Kodi

            So if Kodi is started with username foobar (which has UID 1000) all accesses to the NFS export path will be made with UID 1000.

du coup , j ' aimerais assortir les permissions / proprietaires a mes besoins , mais je ne suis pas certain de ce qui est le plus securisé , bien qu ' en reseau local , il y ait moins de risque .

Actuellement je suis en chmod 777 et iznobe:iznobe .
pour le partage nfs ; j ' ai mis :

iznobe@iznobe-Pc:~$ cat /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#		to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/mnt/montages/Seagate_1T/PartageS1T/		192.168.1.0/24(ro,sync,insecure)
/mnt/montages/Seagate_4T/perso/PartageS4T/	192.168.1.0/24(ro,sync,insecure)
/mnt/montages/Toshiba_3T/PartageT3T/		192.168.1.0/24(ro,sync,insecure)
iznobe@iznobe-Pc:~$ 

comment reorganiser cela au mieux , de façon a avoir quelquechose d' un peu plus secure ?

quel est l' ID utilisateur kodi ? ( sur la tv android ) ou comment le trouver ? comment ajouter un utilisateur si besoin ?

Dernière modification par iznobe (Le 04/07/2020, à 08:03)


retour utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .

Hors ligne

#10 Le 04/07/2020, à 14:15

strike07

Re : [ RESOLU ] partage NFS

je viens de tester kodi pour android, ça fonctionne avec les options suivantes pour mon export :

/media/disques/media-2to 192.168.1.0/24(rw,async,no_subtree_check,insecure)

mon disque :

ls -l /media/disques
total 12
...
drwxr-xr-x  6 strike07 strike07 4096 juin   1 03:43 media-2to
...

essayez déjà de voir si ça fonctionne sans sécurités particulières.
à la limite vous pouvez autoriser le partage pas sécurisé uniquement pour l'IP (ou le nom d'hôte) de la box android TV

Hors ligne

#11 Le 15/07/2020, à 18:40

iznobe

Re : [ RESOLU ] partage NFS

Bonjour , finalement ca marche enfin !

voici mon fichier /etc/exports :

iznobe@iznobe-Pc:~$ cat /etc/exports
/mnt/montages/Seagate_1T/PartageS1T/		192.168.1.0/24(ro,sync,insecure)
/mnt/montages/Seagate_4T/perso/PartageS4T/	192.168.1.0/24(ro,sync,insecure)
/mnt/montages/Toshiba_3T/PartageT3T/		192.168.1.0/24(ro,sync,insecure)
iznobe@iznobe-Pc:~$

et les permissions d ' un des partages :

iznobe@iznobe-Pc:~$ ls -l /mnt/montages/Seagate_1T
drwxrw-r-- 3 iznobe iznobe  4096 juin   4 19:11 PartageS1T
iznobe@iznobe-Pc:~$

Merci encore pour votre aide !
Je trouve tout de meme etonnant qu ' il faille mettre 765 , soit lire et executer a autres pour que kodi puisse lire les photos et videos de familles ...

juste une question , maintenant que ca marche , existe t il un moyen de partager un seul dossier , dans lequel je pourrais par exemple mettre les 3 autres partages  tout en conservant le montage automatique des disques ?
avec des liens symboliques ? en passant par fstab et en montant les dossiers de partages de chaque disque dans un dossier /partages/S1T , S4T , T3T , autrement ?

Dernière modification par iznobe (Le 15/07/2020, à 19:26)


retour utilisable de commande
MSI Z490A-pro , i7 10700 , 32 GB RAM .

Hors ligne