Samba write access: NT_STATUS_MEDIA_WRITE_PROTECTED

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Samba write access: NT_STATUS_MEDIA_WRITE_PROTECTED

Post 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.
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
^rooker
Site Admin
Posts: 1481
Joined: Fri Aug 29, 2003 8:39 pm

Re: Samba write access: NT_STATUS_MEDIA_WRITE_PROTECTED

Post 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 :)
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply