Unable to write to Samba NTFS share from Windows7
8,555
Simply renaming the share to something else seemed to have fixed the issue. Got the idea from this serverfault answer.
Related videos on Youtube
Author by
mogelbrod
Updated on September 18, 2022Comments
-
mogelbrod over 1 year
I've been trying to enable writing from Windows 7 to a samba share mapped to a NTFS-formatted USB Disk for the last 3 hours without any success.
I can access the mount point without any issues from the Ubuntu server itself, but no matter how I mount it I always get "You need permission to perform this action" when attempting to create/modify/delete files/folders from my Windows 7 computer.
I'm now out of ideas, so help is very much appreciated!
Samba configuration:
[global] server string = serv netbios name = serv workgroup = WORKGROUP wins support = yes guest account = nobody security = user map to guest = bad user encrypt passwords = true passdb backend = tdbsam obey pam restrictions = yes unix password sync = no pam password change = no ; lanman auth = yes ntlm auth = no lanman auth = no client ntlmv2 auth = yes socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192 load printers = no printable = no log file = /var/log/samba/log log level = 3 max log size = 1024 syslog only = no syslog = 0 [external] comment = "External USB Drive" path = /media/usb0 browseable = Yes force user = media force group = media read only = No public = yes guest ok = yes create mask = 0666 directory mask = 0777 hide dot files = false
Directory permissions:
drwxr-xr-x 11 root root 4096 Nov 28 17:51 /media/ drwxrwxrwx 2 media media 4096 Nov 28 17:51 /media/usb0/ # (media gid=1001 uid=1001)
Attempted mount options:
sudo mount -t ntfs-3g -o uid=1001,gid=1001 /dev/sdb1 /media/usb0 sudo mount -t ntfs -o uid=1001,gid=1001 /dev/sdb1 /media/usb0 sudo mount -t ntfs -o uid=1001,gid=1001,umask=000 /dev/sdb1 /media/usb0 sudo mount -t ntfs -o uid=1001,gid=1001,umask=000,defaults,users,locale=en_US.UTF-8 /dev/sdb1 /media/usb0
-
koullislp over 8 yearsWhy do you have user & group 'media'? Do you have the same user account on Windows that maps to that? Also what's the output on the server in the log in /var/log/samba/__ip__? Check the permissions that are shown there by the samba service.
-
mogelbrod over 8 years
media
is just a user I'm using as an owner of all samba/ftp/etc. shares for simplicity. I've got another samba user (that also belongs to themedia
group) which I'm authorizing as on the windows machine that has no problems reading/writing to other standard samba shares belonging to the same media user. I created a gist with the output from /var/log/samba/log for two different write operations. Thanks for your response! -
Fabby over 8 yearsSo the samba share is on an Ubuntu machine residing on an NTFS partition? Did you use a user mapping or did you use the same user name on the Windows and Ubuntu machine? (or neither?) Please tell me if you don't understand the questions...
-
mogelbrod over 8 yearsThe ubuntu machine has a NTFS formatted USB drive connected and mounted using the mount commands listed in the question. I've created a samba user on the ubuntu server using smbpasswd, which I can authenticate with from the windows machine. I've got other shares with the exact same samba configuration that works perfectly, so the cause of the problem is most likely how the drive is mounted.
-
-
mogelbrod over 8 yearsAdding
writeable = yes
did nothing, unfortunately. -
koullislp over 8 yearsWow!! In this case mark your answer as the correct one for other people to see.