===== Mount networkshares ===== ==== Clientpackages to mount shares ==== CIFS:\\ apt-get install cifs-utils NFS:\\ apt-get install nfs-common ==== Temp. mount ==== === CIFS / SAMBA === mount -t cifs //// /mnt// or with connection parameters mount -t cifs //// /mnt// -o username=user,password=pass,domain=dom Make sure you can access it and that you can see files. If you already have files at "%%//%%//" you can use ls -al /mnt// Also create a file with touch /mnt//test and check if it has been created. === NFS === mount -t nfs :// / or with additional parameters mount -t nfs :// / -o rw,bg,hard,intr,rsize=32768,wsize=32768,tcp,vers=3,suid,timeo=600 Make sure you can access it and that you can see files. If you already have files at "%%/%%/" you can use ls -al / Also create a file with touch //test and check if it has been created. ==== Perm. mount ==== === CIFS / SAMBA === Insert in "/etc/fstab" /// / cifs credentials=,iocharset=utf8,sec=ntlm 0 0 Insert in username= password= domain= Execute mount -a === NFS === Insert in "/etc/fstab" :/share / nfs rw,bg,hard,vers=4.0,suid,timeo=600,noatime,rsize=65536,wsize=65536,sec=sys 0 Execute mount -a ===== Versions ===== ==== CIFS ==== ^ Version ^ Description ^ | %%vers=3.0%% | SMB3 i.e. Windows 8 and up, Windows Server 2012 and up | | %%vers=2.1%% | SMB2_10 i.e. Windows 7, Windows Server 2008 R2 | | %%vers=2.0%% | SMB2_02 i.e. Vista SP1, Windows Server 2008 | | %%vers=1.0%% | NT1 i.e. Windows 95, NT 4.0 | ===== Commands ===== ^ Command ^ Function ^ | %%showmount -e %% | show available nfs shares | | %%mount -t nfs :/ /%% | mount a nfs share | | %%mount -t cifs //// /%% | mount a cifs share | ===== Troubleshooting ===== ==== Cant mount Windowsshares (CIFS) on Linux ==== === Description === Mounting your share leads to the following error mount error(9): Bad file descriptor === Reason === Microsoft released an Update (January 8, 2019 (Monthly Rollup)) which broke smb2.0 and 2.1 connections.\\ The issue affect Windows 7 and Windows Server 2008 (R2). [[https://www.theregister.co.uk/2019/01/09/windows_7_network_broken/|https://www.theregister.co.uk/2019/01/09/windows_7_network_broken/]] [[https://serverfault.com/questions/948263/kb-4480970-and-or-kb-4480960-breaks-smb2-connections-to-windows-7-shares|https://serverfault.com/questions/948263/kb-4480970-and-or-kb-4480960-breaks-smb2-connections-to-windows-7-shares]] === Fix === Microsoft released a fix to fix their update... m( This update resolves the issue where local users who are part of the local “Administrators“ group may not be able to remotely access shares on Windows 7 SP1 and Windows Server 2008 R2 machines after installing the January 8th, 2019 security updates. This does not affect domain accounts in the local "Administrators" group. Download KB4487345 and install the fix: [[http://www.catalog.update.microsoft.com/Search.aspx?q=KB4487345|KB4487345]] ==== CIFS share is mounted but permission is denied ==== === Description === Listing the files doesnt work because of missing permission ll / ls: reading directory //: Permission denied total 0 === Reason === Wrong CIFS version === Fix === Add the correct version (vers=1.0/2.0/2.1/3.0) as an option # in /etc/fstab as perm. mount /// / cifs credentials=,iocharset=utf8,sec=ntlm,vers=3.0 0 0 # temp. mount mount -t cifs /// / -o vers=3.0 \\ \\ ~~DISCUSSION:closed~~