Help - Search - Members - Calendar
Full Version: New Problem: Can Mount Smbshares, Can't Unmount
Linuxhelp > Support > Technical Support
Ok, so thanks to some help here I can get back into my operating systems. biggrin.gif

Anyway, for today I decided that I would attempt to get shares mounted in Linux and I got halfway there.

I su'd and created a folder /mnt/leviathan as root. Permissions are:
drwxr-xr-x 2 root root 4096 Feb 11 21:13 leviathan

Those are the same permissions settings as the default /floppy and /cdrom folders.

Then I set smbmnt (not smbmount) chmod g+s.

Then I went into /etc/fstab and added this line:
//leviathan/data /mnt/leviathan smb user,owner,username=user,password=pass 1 2

Now initially I could not do: mount /mnt/leviathan. I would get the following error message:
cannot mount on /mnt/leviathan: Operation not permitted
smbmnt failed: 1

But if I do chown brandon:brandon /mnt/leviathan as root and then exit out of su and do the same command it works! So that's the first kind of problem I have.

The second is that I can unmount the drive as me, but only by doing smbumount /mnt/leviathan (I did chmod g+s for smbumount). I cannot get the same effect for the umount command if I give it chmod g+s.

Basically what I can/can't do and what I want changed:
folder a share is mounted in must be chown me:me (bad, would rather have same as floppy/CD-ROM)
mount command: mount /mnt/leviathan (good)
unmount command smbumount /mnt/leviathan (bad, prefer umount /mnt/leviathan)

My assumption is that because I have to do do the chown for me and it becomes inconsistent w/ the permissions on the floppy/cd-rom folders that I must be doing something wrong. Same goes for the umount command.

Any ideas?
I don't normally mount smb shares in fstab .... but create mount scripts instead...although either way should work. (I never put usernames and passwords in major system files like fstab ... that is the first place people who break into your computer look to see if they can harvest passwords. It is a little harder to look for passwords in other scripts).

Anyway, the command to mount smb shares in fstab is (i think) this:

//leviathan/data /mnt/leviathan smbfs users,owner,username=user%pass 1 2

but a command line that would work is this:

mount -t smbfs -o username=user,password=pass //leviathan/data /mnt/leviathan

the unmount command should be:

umount /mnt/leviathan

if you can't unmount, you can figure out the process that is open on that partiton with this command:

fuser -m /mnt/leviathan
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.