Solved

Ubuntu cannot write to windows shared folder

Posted on 2013-05-31
4
1,136 Views
Last Modified: 2013-07-08
The last couple of questions have been dealing with ubuntu being a client hosted on a windows server 2012 hyperVisor, and having a shared folder that both can access.  Hypervisor does not have this utility standard so shenanigans must ensue.  I have successfully created a shared folder on the windows server, and a user to match.  That users credentials are then used in a /etc/fstab to automount the share at bootup. Both operations work.  I can create files that the other device, can see and vice versa.  The windows user the one whose very credentials are being used to login to the share have Read&Write priviledges.

Here is the rub, I have an application that runs in the ubuntu, that needs to be able to write to the mounted share.  I get nothing but problems.  If the share is mounted then I cannot chown, when the share is unmounted I can change ownership of the directory,but as soon as I mount the share I cannot write to the share from linux side.  And the ubuntu side is the one that needs to be able to read/write to the shared folder that sits on the windows server.  

In short, I have an application that needs Read/Write access/privledges to the windows share.
How do I make this happen?
0
Comment
Question by:Illyankesh
  • 2
4 Comments
 
LVL 32

Assisted Solution

by:DrDamnit
DrDamnit earned 250 total points
ID: 39211880
On the windows share, adds the user "everybody" with full read/wrote (owner) permissions. Let me know if that works.
0
 
LVL 32

Expert Comment

by:DrDamnit
ID: 39211884
... And which Linux app needs to wrote to this share? What user does the Linux app run as?
0
 
LVL 3

Accepted Solution

by:
GhostInTheMacheen earned 250 total points
ID: 39234670
For the sake of clarity, please post the fstab line used to mount the share (fake user/pass please ;)

If we're talking a Samba mount of a Windows share, you won't be able to use chown because chown is based on your Linux install's uids / guids, where as the file permissions within the share are owned by Windows. You are going to be limited by the permissions of the mounting user.

There are projects to support ext4 partitions from windows if you want to go that route, but I'm not sure how user/group support on the Windows side works in that case. If you really need permissions control, it may be better to just go with a Samba share on the Linux guest that's accessible to the Windows host.
0
 

Author Closing Comment

by:Illyankesh
ID: 39308860
sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh stop 15 0 6 .
sudo nano /etc/fstab

//10.1.10.29/locationofmount /var/data/resin/content cifs credentials=/home/cloud/.smbcredentials,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,sec=ntlm 0 0

The above is what ended up having to happen in order to auto mount the share.  There are some additional steps.
A user has to be created in the windows host, that has at the very least ownership of the folder to be shared.  I ended up creating an admin user, creating a password, then making a shared folder on the C: drive that is then owned by the newly created user.  Read/Write etc.

The only thing that i less than awesome is that you have to edit fstab which as we know if we screw up can make the image not bootable, and then we have to revert to previous snapshot.

The above line is what I ended up using in order to get the share to automount on boot.  The additional commands are needed to change the order of boot/shutdown so that your share unmounts, and does not cause the rest of the system to hang.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question