Thursday, December 23, 2010

Checking NFS and SAMBA shares


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

[root@hostxyz /]# showmount -e
Export list for
/VOL0           stoash01-d3,staat01-d3,rdbash01,,, , 
/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


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

# smbclient -L Samba server IP –Uusername

[root@hostxyz /]# smbclient -L -Uadevaraju
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:

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

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

No comments:

Post a Comment