Site Tools


linux:general:mount

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:general:mount [2015/06/05 14:58] – created lunetikklinux:general:mount [2020/01/09 16:36] (current) lunetikk
Line 1: Line 1:
 ===== Mount networkshares ===== ===== Mount networkshares =====
  
 +==== Clientpackages to mount shares ====
 +
 +CIFS:\\
 +<code>apt-get install cifs-utils</code>
 +
 +NFS:\\
 +<code>apt-get install nfs-common</code>
 +
 +==== Temp. mount ====
 +
 +=== CIFS / SAMBA ===
 <code> <code>
-mount -t cifs //192.168.178.xxx/PATH/ /media/nasdir/+mount -t cifs //<SRV>/<SHARE>/ /mnt/<POINT>/ 
 +</code> 
 +or with connection parameters 
 +<code> 
 +mount -t cifs //<SRV>/<SHARE>/ /mnt/<POINT>/ -o username=user,password=pass,domain=dom 
 +</code> 
 + 
 +Make sure you can access it and that you can see filesIf you already have files at "%%//%%<SRV>/<SHARE>/" you can use <code>ls -al /mnt/<POINT>/</code> 
 +Also create a file with <code>touch /mnt/<POINT>/test</code> and check if it has been created. 
 + 
 +=== NFS === 
 +<code> 
 +mount -t nfs <server>:/<share>/ /<mountpoint> 
 +</code> 
 +or with additional parameters 
 +<code> 
 +mount -t nfs <server>:/<share>/ /<mountpoint> -o rw,bg,hard,intr,rsize=32768,wsize=32768,tcp,vers=3,suid,timeo=600 
 +</code> 
 + 
 +Make sure you can access it and that you can see filesIf you already have files at "%%/%%<share>/" you can use <code>ls -al /<mountpoint></code> 
 +Also create a file with <code>touch /<mountpoint>/test</code> and check if it has been created. 
 + 
 +==== Perm. mount ==== 
 + 
 +=== CIFS / SAMBA === 
 + 
 +Insert in "/etc/fstab" 
 +<code>//<SRV>/<SHARE> /<MNTPOINT> cifs credentials=</root/.smbcreds>,iocharset=utf8,sec=ntlm 0 0</code> 
 + 
 +Insert in </root/.smbcreds> 
 +<code> 
 +username=<username> 
 +password=<password> 
 +domain=<domain> 
 +</code> 
 + 
 +Execute 
 +<code>mount -a</code> 
 + 
 +=== NFS === 
 + 
 +Insert in "/etc/fstab" 
 +<code><server>:/share /<mountpoint> nfs rw,bg,hard,vers=4.0,suid,timeo=600,noatime,rsize=65536,wsize=65536,sec=sys 0</code> 
 + 
 +Execute 
 +<code>mount -a</code> 
 + 
 +===== 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 <nfsserver>%%  |  show available nfs shares 
 +|  %%mount -t nfs <server>:/<share> /<mountpoint>%%  |  mount a nfs share  | 
 +|  %%mount -t cifs //<server>/<share>/ /<mountpoint>%%  |  mount a cifs share  | 
 + 
 +===== Troubleshooting ===== 
 + 
 +==== Cant mount Windowsshares (CIFS) on Linux ==== 
 + 
 +=== Description === 
 + 
 +Mounting your share leads to the following error 
 + 
 +<code> 
 +mount error(9): Bad file descriptor 
 +</code> 
 + 
 +=== 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( 
 +<code> 
 +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. 
 +</code> 
 + 
 +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 
 +<code> 
 +ll /<mount> 
 +ls: reading directory /<mount>/: Permission denied 
 +total 0 
 +</code> 
 + 
 +=== Reason ===  
 + 
 +Wrong CIFS version 
 + 
 +=== Fix ===  
 + 
 +Add the correct version (vers=1.0/2.0/2.1/3.0) as an option 
 +<code> 
 +# in /etc/fstab as perm. mount 
 +//<server>/<share> /<mountpoint> cifs credentials=</root/.smbcreds>,iocharset=utf8,sec=ntlm,vers=3.0 0 0 
 + 
 +# temp. mount 
 +mount -t cifs //<server>/<share> /<mountpoint> -o vers=3.0  
 </code> </code>
  
-Make sure you can access it and that you can see files. If you already have files at "%%//%%192.168.178.xxx/PATH/" you can use <code>ls -al /media/nasdir/</code> 
-Also create a file with <code>touch /media/nasdir/test</code> and check if it has been created. 
  
 +\\
 +\\
 +~~DISCUSSION:closed~~
linux/general/mount.1433509135.txt.gz · Last modified: 2017/03/01 12:50 (external edit)