Operating System - HP-UX
1752749 Members
5013 Online
108789 Solutions
New Discussion юеВ

How to view NFS and SAMBA shares accessibility.

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How to view NFS and SAMBA shares accessibility.

Hi All,

I am using HP Unix (10.20, 11.00, 11.11).

I am running NFS and SAMBA services.

1)NFS shares:

One server's (Ex: serverA) NFS shares are mounted with some hpux servers (serverB, serverC and serverD).

I would like to find that which NFS shares of serversA is mounted with which servers (serverB, serverC and serverD) and what is the mount point.


Is it possible that we can see the above details.


2)SAMBA shares:

Some samba shares are configured in one hpux server.

I dont know whether they are being used or not, but configured.

So i want to view what are the samba shares are being used and what are the samba shares are not being used.

And i want to find what are the users are accessing samba shares from which system / servers.


8 REPLIES 8
Sunny123_1
Esteemed Contributor

Re: How to view NFS and SAMBA shares accessibility.

Hi Senthil

Look out for nfs entry in fstab.

grep - i nfs /etc/fstab | awk '{print $2}'


Regards
Sunny
Doug O'Leary
Honored Contributor
Solution

Re: How to view NFS and SAMBA shares accessibility.

Hey;

1) showmount -a ${host}. You don't have to be on the system that's nfs exporting filesystems either:

$ showmount -a usilapp3 | tail
usildb12:/exports/usr/data/fdi-svp
usildb12:/exports/usr/data/finmrgps
usildb12:/exports/usr/data/lries
usildb13:/exports/usr/data/fdi-svp
usildb13:/exports/usr/data/finmrgps
usildb17:/exports/usr/data/lries
usildb17:/exports/usr/vertex/V1P
usildb9:/exports/usr/data/finmrgps
usr3db17:/exports/usr/sap/global_trans
usr3db19:/exports/usr/sap/global_trans

2. /opt/samba/bin/smbstatus

$ sudo /opt/samba/bin/smbstatus

Samba version 3.0.22 based HP CIFS Server A.02.03.03
PID Username Group Machine
-------------------------------------------------------------------
26041 oleary users oleary-c1 (135.244.5.207)

Service pid machine Connected at
-------------------------------------------------------
IPC$ 26041 oleary-c1 Wed Jul 8 08:52:49 2009
oleary 26041 oleary-c1 Wed Jul 8 08:52:07 2009
IPC$ 26041 oleary-c1 Wed Jul 8 08:52:33 2009

Locked files:
Pid DenyMode Access R/W Oplock SharePath Name
----------------------------------------------------------------------------------------
26041 DENY_NONE 0x100001 RDONLY NONE /home/oleary working/projects Wed Jul 8 08:52:20 2009
26041 DENY_NONE 0x2019f RDWR NONE /home/oleary working/projects/SAP_2009_Plan.mpp Wed Jul 8 08:52:36 2009
26041 DENY_NONE 0x100001 RDONLY NONE /home/oleary . Wed Jul 8 08:52:09 2009

The displayed output is *very* wide...

HTH;

Doug O'Leary

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Sharma Sanjeev
Respected Contributor

Re: How to view NFS and SAMBA shares accessibility.

Hi Senthil

If its a permanent NFS Share you can fine it in /etc/fstab

But you can always use showmount -e

For Samba share you can look into samba.conf file.

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE
Doug O'Leary
Honored Contributor

Re: How to view NFS and SAMBA shares accessibility.

Hey;

Examining the /etc/fstab file for nfs shares doesn't satisfy the original request. The OP is looking for active mounts. The /etc/fstab tells you what *can* be mounted using a simple mount command, not what *is* mounted. Additionally, if the environment uses the automounter, no nfs mounts will be listed in /etc/fstab.

Same logic for the smb.conf file. It shows what *can* be mounted, not what *is* mounted.

Doug O'Leary

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Sharma Sanjeev
Respected Contributor

Re: How to view NFS and SAMBA shares accessibility.

Hi

It will read smb.conf only for what to mount.
If Samba is running

Regards
Sanjeev
Everything is Possible as " IMPOSSIBLE" word itself says I M POSSIBLE
Doug O'Leary
Honored Contributor

Re: How to view NFS and SAMBA shares accessibility.

Hey;

>>It will read smb.conf only for what to mount.

for what to mount if requested. The original poster wanted to know about active shares. Parsing the smb.conf will only tell you *configured* shared; it does not tell you anything about whether or not they're active.

For example: I exited out of the share listed above.

$ sudo /opt/samba/bin/smbstatus

Samba version 3.0.22 based HP CIFS Server A.02.03.03
PID Username Group Machine
-------------------------------------------------------------------
26041 oleary users oleary-c1 (135.244.5.207)

Service pid machine Connected at
-------------------------------------------------------
oleary 26041 oleary-c1 Wed Jul 8 08:52:07 2009
IPC$ 26041 oleary-c1 Wed Jul 8 09:56:17 2009

No locked files

Now there are no active shares. When I reopen the share, I get the following:

$ sudo /opt/samba/bin/smbstatus

Samba version 3.0.22 based HP CIFS Server A.02.03.03
PID Username Group Machine
-------------------------------------------------------------------
26041 oleary users oleary-c1 (135.244.5.207)

Service pid machine Connected at
-------------------------------------------------------
oleary 26041 oleary-c1 Wed Jul 8 08:52:07 2009
IPC$ 26041 oleary-c1 Wed Jul 8 09:56:17 2009

Locked files:
Pid DenyMode Access R/W Oplock SharePath Name
----------------------------------------------------------------------------------------
26041 DENY_NONE 0x100001 RDONLY NONE /home/oleary . Wed Jul 8 09:56:17 2009
26041 DENY_NONE 0x100001 RDONLY NONE /home/oleary . Wed Jul 8 09:56:17 2009

Close it again and we're back to this:

$ sudo /opt/samba/bin/smbstatus

Samba version 3.0.22 based HP CIFS Server A.02.03.03
PID Username Group Machine
-------------------------------------------------------------------
26041 oleary users oleary-c1 (135.244.5.207)

Service pid machine Connected at
-------------------------------------------------------
oleary 26041 oleary-c1 Wed Jul 8 08:52:07 2009
IPC$ 26041 oleary-c1 Wed Jul 8 09:56:17 2009

No locked files

In only one of those three cases was the share active which, I reiterate, is what the original poster is looking for. Reading the smb.conf in any of those three cases would show the configured share - not the active share.

Doug O'Leary

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Steven E. Protter
Exalted Contributor

Re: How to view NFS and SAMBA shares accessibility.

Shalom,

I use showmount -e to show NFS mounts available.

smbstatus is a good way to see what is going on with Samba shares.

It may be cifsstatus on HP-UX, my machines are still turned off at the moment.

Couple of threads with more goodness:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1121001

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=102508

Moderator Edit: Above links are no longer valid. Please visit the HPE Support Center: https://support.hpe.com

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ganesan R
Honored Contributor

Re: How to view NFS and SAMBA shares accessibility.

Hi Senthil,

#showmount -e -> To know the filesystem exported by that server and to whom.

#showmount -a -> To list the clients currently mounted the exported filesystem.

For samba shares use the below commands:

#/opt/samba/bin/testparm -> will check the syntax errors and dump the current configuration including samba shares and user access details.

You can also use cifslist command.
Best wishes,

Ganesh.