Page 1 of 1

Samba write access: NT_STATUS_MEDIA_WRITE_PROTECTED

Posted: Fri Jun 12, 2009 11:46 am
by ^rooker
[PROBLEM]
I've mounted an external USB harddisk as "/media/disk" and want to share it for read/write using samba. Everything is configured conforming to HowTos and docs, and the user I'm using has write access to /media/disk.

Yet, I can read all files and folders, but I cannot create anything there over samba, because samba complains that the file system is mounted read-only - which it ain't.

[SOLUTION]
I've tried renaming the share name in the smb.conf from "[shared]" to something else like "files" and it worked. All other settings were exactly the same. Weird...

Additional information:
An entry in a forum post on ubuntuforums.org mentioned Samba exhibiting irregular behavior when sharing a mount point directly, but that seemed odd to me - and it didn't fix the problem.

Re: Samba write access: NT_STATUS_MEDIA_WRITE_PROTECTED

Posted: Mon Apr 28, 2014 7:19 pm
by ^rooker
UPDATE
Just ran into this error again. When creating a file or folder in a mounted Samba share, I got an "input/output error", with "NT_STATUS_MEDIA_WRITE_PROTECTED" only showing up in the logs of the Samba server:
mkdir: cannot create directory `test': Input/output error
[SOLUTION]
My previous posting actually didn't really mention a solution, as I haven't figured out how I've fixed it.
Now I got it:
While digging through the server logs, I saw that although I used concrete user credentials, the login was silently mapped to guest :!:
The reason for this was, that although the username for accessing the Samba share was a proper system user on the Samba server and had correct access rights to the share, but (!) I forgot to tell add it:

Code: Select all

$ smbpasswd -a {username}
Then restart the Samba service and try again. Now you should be able to write :)