Windows Can Read But Cannot Write to Samba Shares

A place for software, hardware and DSP-based solutions. All things code and the hardware that runs it. Time and amplitude are described in bits and pieces here. Links to interesting gizmos and software.
Post Reply
User avatar
mediatechnology
Posts: 2636
Joined: Sat Aug 11, 2007 2:34 pm
Location: Oak Cliff, Texas
Contact:

Windows Can Read But Cannot Write to Samba Shares

Post by mediatechnology » Mon Jun 26, 2017 4:18 pm

I recently decided to upgrade an older Win XPSP3 machine to dual boot Linux. I chose Ubuntu Studio and painlessly installed it from a USB .iso image. The machine has a new life. Part of the requirement is that it have file sharing to make the Linux machine share the Win XP NTFS partitions. When the machine is booted into either XP or Linux those shares are available to the home network. Setting this up was very easy except for one nagging problem: The Linux Samba shares could be browsed and opened but not written to.

One would normally think that Windows can read but cannot write to Samba shares is a file/directory or user permissions problem. I spent about 2 days trying to get writable Samba shares available to the Windows client machines. I finally found this post: https://askubuntu.com/questions/724916/ ... amba-share
After hours of searching, I discovered that the share name and the share directory cannot be the same (and it's not case-sensitive, either). See this post on serverfault. https://serverfault.com/a/557028/333627

So, if I change my share name in smb.conf from:
[Music]
to
[Tunes]

I can both read and write to the share. No other changes to my smb.conf were necessary, and no need to chmod 0777.
Here's what I found and posted at ask.ubuntu:
I've also documented that the Share name and Directory name cannot be the same or the share will be visible and read-only despite the permissions. When the Share name is modified to be different than the Directory (or Disk) name it will become writeable assuming it and the user have the correct permissions.

I found this with NTFS disks and folders mounted in Ubuntu that had been previously shared under NTFS using the same Share names in Linux that were used under Win NTFS. Win and Linux sharing tools both default to the directory or disk name for their share name during creation so the conflict is built-in by default. Simply adding a character to the Linux Share name made it writeable.

This may or may not be true if the disk or directory are not NTFS or are NTFS but have never been shared. It appears that previously-used NTFS share names are reserved when mounted in Ubuntu and Linux deals with the conflict by making the share read-only.

An NTFS directory share named \My Music simply renamed \My Muzak in Ubuntu is enough to make the directory writeable.
When the machine is booted in XP its ID is pc1. When Linux is running the machine ID is pc3. The workaround I ended up with is making the NTFS share //pc1/My documents share as //pc3/pc3 My Documents under Linux. The same share is available to the network when either OS is booted.

The key to making it work was to not reuse in Linux a share name being used and reserved by NTFS.

Having the pc3 ahead of My Documents lets me know that its sharing with Linux.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest