LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-11-2006, 02:32 AM   #1
taiwf
Member
 
Registered: Jun 2005
Distribution: debian, ubuntu, redhat,knoppix
Posts: 194

Rep: Reputation: 31
test if smbfs is used for mount?


HI,

I use mount -t smbfs and my bash script require me to know if a drive is maped as smbfs. I know i can do ps -ef |grep smbfs then use if output is 2(or more lines , then consider some drive is using smbfs. But that doesn't seem to be the most effective way to do it.

Can anyone suggest me a better way to write this line of bash?

thx



chris
 
Old 04-11-2006, 03:23 AM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,545

Rep: Reputation: 57
You can use the output of /proc/mounts or mount (<- more x-platform) to see what filesystem was used for each mount. Just parse that with sh or your language of choice
Code:
mount | grep /sys | awk '{print $5}'

Last edited by cs-cam; 04-11-2006 at 03:24 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why fstab doesn't mount smbfs rjkfsm Linux - Newbie 3 12-16-2011 01:23 PM
problems with smbfs mount-point in /etc/fstab - "mount -a" works, but not at boottime MarkSide Linux - Software 4 11-20-2005 04:30 PM
cannot mount smbfs flipboi Linux - Security 2 08-12-2004 10:18 AM
mount -t smbfs loganwva Linux - Networking 1 10-21-2003 12:02 PM
smbfs mount failure MPowell Linux - Networking 0 04-05-2002 03:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration