LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-11-2010, 03:08 PM   #1
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Rep: Reputation: 30
Cannot write to mounted windows share


I have mounted a windows share to my Ubuntu 9.10 system by doing the following:

Code:
//wollemi/shared	/wShared	smbfs username=name,password=password	0	0
I also tried:
Code:
sudo mount -t cifs //wollemi/shared/imageTest -o username=name,password=password /images
Each time I have view access but not write access. If I browse to the windows share via 'Places' > 'Network' > 'Windows Network' etc. then I do have write access, as soon as I mount it to /images, I loose write access. I also did a ls -la before the mount and the permissions were rwx-rwx-rwx and owned by me, after the mount it was rwx-r_x-r_x and owned by root. When I unmount it, /images reverts back to my ownership.

In order to access this share via DigiKam I need to mount it to the filesystem, but as soon as I do I loose write access.

Any thoughts?

Thanks
 
Old 01-11-2010, 06:13 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
You could try adding 'rw' to the mount options and see if it makes a difference..

Code:
//wollemi/shared	/wShared	smbfs rw,username=name,password=password	0	0
cheers
 
Old 01-11-2010, 07:47 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
Microsoft does not support all of the CIFS extentions. Use the "uid=", "gid=", "umask" & "fmask" options to change the ownership and permissions of the share after it is mounted. Also check the how the windows share is setup. If it is a read-only share, you won't be able to mount it rw.

Also make sure that the windows user is an samba user with smbpasswd. Another thing I would recommend is creating a credentials file in your home directory and using a "cred=" option pointing to this file. The /etc/fstab file is world readable so you shouldn't have passwords in it.

Last edited by jschiwal; 01-11-2010 at 07:57 PM.
 
Old 01-12-2010, 07:10 AM   #4
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Original Poster
Rep: Reputation: 30
I tried to do what kbp said (adding rw):
Code:
//wollemi/shared	/wShared	smbfs rw,username=name,password=password	0	0
but the result was the same.

I am not sure what you mean by:
Quote:
Use the "uid=", "gid=", "umask" & "fmask" options to change the ownership and permissions of the share after it is mounted.
I did this:
Code:
tparks@d600:/$ id
uid=1000(tparks) gid=1000(tparks) groups=4(adm),20(dialout),24(cdrom),46(plugdev),104(lpadmin),115(admin),120(sambashare),1000(tparks)
Not really sure what to do with that info, could you please explain?

I appreciate the help, thanks.
 
Old 01-12-2010, 07:16 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
Here is an example. I just mounted the users share on my desktop:
Code:
sudo mount -t cifs //elite/users /mnt/elite/users/ -o rw,uid=jschiwal,gid=jschiwal,file_mode=0117,dir_mode=0117,cred=/home/jschiwal/.credentials,nls=utf8
jschiwal@qosmio:~/hd2/podcasts/GoingLinux> ls -ld /mnt/elite/users/
drwxr-xr-x 4 jschiwal jschiwal 0 2009-12-16 09:31 /mnt/elite/users/
 
1 members found this post helpful.
Old 01-12-2010, 07:32 AM   #6
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Original Poster
Rep: Reputation: 30
That worked!

I only used the first line and I put my username and password in as I do not yet know how to create a credentials file, but I assume that there is enough in your post for me to figure it out. I am, for now, simply happy that I have write access. I am not sure what the 2nd and 3rd lines do, but I will look into them and figure it out.

I am going to put that in my fstab file for now while I figure the rest out. Thanks again!
 
Old 01-12-2010, 07:47 AM   #7
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Original Poster
Rep: Reputation: 30
I seem to be having an issue putting the line in /etc/fstab. I tried using:
Code:
//wollemi/shared /wShared cifs  -o rw,uid=tparks,gid=tparks,file_mode=0777,dir_mode=0777,username=name,password=password	0	0
But I get the error:
Quote:
tparks@d600:/$ sudo mount -a
[mntent]: line 23 in /etc/fstab is bad
Could you tell me what I might be doing wrong with that?
 
Old 01-12-2010, 08:51 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
The fstab file has it's own manpage. You were very close however. You have an -o before the options which you would use when entering a mount command.

Also, check your file_mode & dir_mode values.

For the credentials file, create a text file in your home directory with at least the first 2 lines:
username=<your username>
password=<your password>
domain=<windows domain or workgroup name>

I used the name .credentials so it would be hidden. In /etc/fstab or mount command options, use the full path to the file.

Last edited by jschiwal; 01-12-2010 at 08:54 AM.
 
1 members found this post helpful.
Old 01-12-2010, 07:42 PM   #9
leupi
Member
 
Registered: Mar 2004
Location: Annapolis, Maryland, USA
Distribution: Ubuntu 11.04, Mint 11.11, Xubuntu 11.11
Posts: 458

Original Poster
Rep: Reputation: 30
I did as you said and everything is working great. I added this to /etc/fstab:
Code:
//wollemi/shared /wShared cifs	rw,uid=tparks,gid=tparks,file_mode=0700,dir_mode=0700,cred=/home/tparks/.credentials	0	0
I appreciate all of your help, this has made things much easier at work and I am not able to use Linux for pretty much everything now.

Thanks again
 
Old 04-08-2010, 07:56 PM   #10
roystonlodge
Member
 
Registered: Jun 2008
Posts: 161

Rep: Reputation: 32
I realized you already found a solution to your problem, but I still thought my method for mounting my most frequently used windows shares might be useful to you:

(FYI: I'm using Debian Squeeze with LXDE as my desktop environment.)

This example is for mounting my samba NAS.
  1. I installed smbfs.
  2. I created the following directories /home/username/mnt and /home/username/mnt/nas
  3. I saved the following script as /usr/bin/nas
    Code:
    #!/bin/bash
    smbmount //path/to/windows/share /home/username/mnt/nas -o rw,guest
    ln -s /home/username/mnt/nas /home/username/Desktop/nas
  4. I created a "start menu" item for the nas script labelled Mount NAS

So now, when I want to mount my nas, I select the Mount NAS menu item, which then mounts the share AND conveniently creates a shortcut on my desktop.

I also have the following script called /usr/bin/unas for when I want to unmount the share:
Code:
#!/bin/bash
sudo umount /home/username/mnt/nas
rm -f /home/username/Desktop/nas
If I don't unmount it before I shut down the computer then the shutdown process freezes up on me.

Hope you find this useful!
 
  


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 is fmask & dmask required to write to a WinXP share mounted on Mdrake SMB client ruscook_oz Linux - Networking 1 02-08-2007 05:50 PM
mounted NT Samba share write access problems dm215 Linux - Software 1 01-08-2007 11:40 AM
samba: linux mounted share = choppy playback, windows mounted share = smooth kleptophobiac Linux - Software 2 04-10-2005 08:23 AM
One Windows share getting mounted read-only - why? rparkes Linux - Networking 5 01-31-2004 02:07 PM
mounted network share gets write-protected! Falafel Linux - Networking 1 10-23-2003 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:54 PM.

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