Thursday, December 23, 2010

Checking NFS and SAMBA shares

NFS

How to check the NFS shares available from a NFS Client ?
#  showmount -e <NFS Server IP>

Example
[root@hostxyz /]# showmount -e nfsserver.domain.com
Export list for nfsserver.domain.com:
/VOL0           stoash01-d3,staat01-d3,rdbash01,10.20.23.16,10.20.64.31,10.100.14.96 ,10.100.16.12 
/VOL1           (everyone)
/ORAAPPS        (everyone)
/ret_vol3       (everyone)
/nas_server_bkp (everyone)
/testnfs        (everyone)
[root@hostxyz /]#


From NFS server, how to find the list of NFS clients accessing the NFS share currently ?

Execute the following script:
for i in `cat /var/lib/nfs/rmtab | awk -F":" '{print $1}' | sort -u`; do nslookup $i | tail -2 | awk '{print $4}'; done

---------------------------------------------------------------------------------------------------------------------------------------------------------
SAMBA

How to find the list of Samba shares available from a Windows Server?

# smbclient -L Samba server IP –Uusername
Password:


[root@hostxyz /]# smbclient -L windows.tcprod.com -Uadevaraju
Password:
Domain=[TCPROD] OS=[Windows Server 2003 R2 3790 Service Pack 2] Server=[Windows Server 2003 R2 5.2]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       Remote IPC
        sqldb_htk       Disk
        webash01-dev    Disk
        C$              Disk      Default share
        VOL3            Disk
        testsmb         Disk
        SMBSYSENG       Disk
        HPUniver.3      Printer   HP Universal Printing PS
        HPUniver.2      Printer   HP Universal Printing PCL 5
        ADMIN$          Disk      Remote Admin
        HPUniver        Printer   HP Universal Printing PCL 6
        print$          Disk      Printer Drivers
        F$              Disk      Default share
        nas_server_bkp  Disk
        SMBVOL1         Disk
        windowsprodbackup Disk
        SMBVOL0         Disk
        Report_server_bkp Disk
        E$              Disk      Default share
        exchange_db     Disk
        sysengdata      Disk


How to mount a Windows Share on to a Linux mount point:


Syntax: 
Put this entry in /etc/fstab and do 'mount -a'
//Windows server IP/Sambashare  /Linux_mount cifs username=XXX,password=XXXX 0 0


Example:
//Windows_server/sambashare      /linux_mnt cifs username=ashok,password=XXXX  0 0

No comments:

Post a Comment