User avatar
Mortimer
Posts: 925
Joined: Sun Jun 10, 2012 3:57 pm

Mounting and Umounting CIFS Shares

Tue Jul 03, 2012 11:27 am

I have a small IOMega Network drive, that I thought would be useful to transfer stuff to and from the RPi.

The network drive is on IP address 192.168.1.250 and amongst the several shares on it, there is one called "General".

I made a directory in /media called General and did the following:
sudo mount -t cifs //192.168.1.250/General /media/General

Lo and behold I was able to list the files on the network drive.

Ok, now to unmount the share, I tried:
sudo umount /media/General

Only to be told:
umount: /media/General: device is busy.
(In some cases useful info about process that use
the device is found by lsof(8) or fuser(1))

fuser -m /media/General
returns
/media/General: 1503c

ps | grep 1503
tells me that the process using the share is the current terminal session. Only to be expected, but all I have done is list files in the share, not opened any files or anything like that.

How do I get the current session to release its hold on the shared volume? Do I have to exit session and log back in? Surely not?
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

User avatar
Mortimer
Posts: 925
Joined: Sun Jun 10, 2012 3:57 pm

Re: Mounting and Umounting CIFS Shares

Tue Jul 03, 2012 11:33 am

It's OK I sussed it...

The terminal session had the current working directory set to the shared folder. Just CD'd to home, and the umount command worked after that.

Doh!! :oops:
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Mounting and Umounting CIFS Shares

Tue Jul 03, 2012 11:48 am

Yes. Note that the "c" in the fuser output indicates "current directory".
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
Mortimer
Posts: 925
Joined: Sun Jun 10, 2012 3:57 pm

Re: Mounting and Umounting CIFS Shares

Tue Jul 03, 2012 11:52 am

Thanks, useful to remember.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

User avatar
Mortimer
Posts: 925
Joined: Sun Jun 10, 2012 3:57 pm

Re: Mounting and Umounting CIFS Shares

Tue Jul 03, 2012 1:01 pm

OK, I might as well see if I can learn some more from this...

Is there a way in Debian to see what shares are available on a given IP address?

For example I know that my IOMega has several shared folders, but supposing I didn't know, could I find out using my RPi as a terminal?
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Mounting and Umounting CIFS Shares

Tue Jul 03, 2012 2:21 pm

When you say "RPi as a terminal", I assume you mean from the command line ?

I don't know anything for sure, but you could try these packages which I've just looked up
smb2www <-- browse samba shares via a web browser.
smbc <-- that looks promising. samba-commander - a ncurses based samba client
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

User avatar
Mortimer
Posts: 925
Joined: Sun Jun 10, 2012 3:57 pm

Re: Mounting and Umounting CIFS Shares

Tue Jul 03, 2012 2:49 pm

I installed smbc and typed in smbc [return], and nothing.

The prompt doesn't return, and doing 'top' in another terminal shows smbc consuming 68% CPU.

I don't want a GUI solution so haven't looked at smb2www.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

Hiro
Posts: 78
Joined: Fri Dec 30, 2011 11:09 am

Re: Mounting and Umounting CIFS Shares

Sat Jul 07, 2012 4:12 pm

I wanted to see all the shares on my network from the cli a while ago and i used "smbtree -N" Would this do for you?

Return to “Beginners”