0

Something strange happened when upgrading from 12.04 to 14.04. I have three partitions on a connected hard drive that were all shared in 12.04. After upgrading, I only have one shared. The other two refuse to be shared. Attempting to set file sharing results in:

'net usershare' returned error 255: net usershare add: failed to add share 3tb2-extra. Error was Operation not permitted

Using the command "chown :smbuser /Media/main1/3TB2-Extra", results in:

chown: invalid group: ‘:smbuser’

When using gksu Nautilus, file settings cannot be changed.

How can I fix this file sharing problem?

16
  • What is the type of file system on the 3TB2-Extra? Is it some kind of ext partition, when you are trying to change the ownership?
    – kukulo
    Feb 29, 2016 at 17:13
  • It's just a partition where extra backup data is kept; an ext4 type of file system. The ownership changed when updating and I would like to have it back. As I wrote, two of the three changed; one remained accessible with the correct file share.
    – edempco
    Mar 1, 2016 at 3:49
  • Use the sudo chown -R user:usergroup command, where user is your username and usergroup you can choose from groups command. Make sure you belong to the group. With useradd -G group user you can add yourself to the group.
    – kukulo
    Mar 1, 2016 at 5:30
  • Thanks for the suggestions. I follow up on them and learned a lot. I found a new GUI that makes it very easy to change user, group, and rwx for any file or folder. However, changing the user and group didn't fix the problem; I get the same 255 error when attempting to set up share. It almost seems to me to be a problem with the Samba database or something else, maybe. As mentioned, I have three folders that were shared and working. Setting all permissions to match the one that is still working, doesn't seem to affect 3TB2-Extra. Thoughts?
    – edempco
    Mar 3, 2016 at 17:04
  • Can you access the share with gksu nautilus? If yes, then there might be a problem with the top folder you are sharing, can you give the folder which is one level above the share the same permissions?
    – kukulo
    Mar 3, 2016 at 17:33

2 Answers 2

0

Change the ownership with the command:

sudo chown user:group /path/to/disk/folder -R

where user - your username, group - a group the user is belonging to.

Sample:

sudo chown marthy:marthy /Media/main1/3TB2-Extra/* -R

For accessing files locally the samba does not need to be running.

1
  • Thank you for replying. I believe that I've done this already ... several different ways to be sure that it was done. Each time, I checked with: #ls -l 3TB2-Extra
    – edempco
    Mar 5, 2016 at 0:52
0

SOLVED:

After upgrading I lost the ability to set up a "shared" folder. The folder would not hold the share designation or would refuse to be shared and report a 255 error. The answer to the question of setting up lost shares is as follows:

  1. The upgrade from 12.04 to 14.04.3 changed, either the folder permissions or how Samba works with file sharing (I'm still not positive).
  2. What I found was that some folders had full read, write, execute (rwx) permissions and some did not. I discovered that Samba needs full rwx permissions ... including "Everybody". This means that EVERY folder in the path needs FULL rwx permissions. (This was written about in the help above, by Kukulo. Thank you!)
  3. To accomplish this investigation and final resolve, I downloaded a GUI application called "Uprawnienia" (which means Permissions in Polish) from the Ubuntu Software Centre. This is a graphical application that lets a person, visually, make changes to the user, group, and permissions of any file or folder at the Root level (requiring Root password).
  4. Using Uprawnienia I dragged and dropped each folder (that was in the path) into the application and changed it's permissions until I was able to share the folder over the network. In my case the path was "/media/main/3TB2-Extra". I changed the permissions of (going backwards) 3TB2-Extra, then main, then media. By doing this I discovered that the permissions of each folder in the path needs to be set to full rwx for owner (rwx), group (rwx), and everybody (rwx). The octal for this is 777, it's also read as drwxrwxrwx for a folder (d=folder).

NOTE: Files within the folder DO NOT need to be changed recursively (using -R or the check box in Uprawnienia). Each file can and should have it's own permissions, depending on who needs access! My recommendation is NOT to change permissions for all of the files within a folder in this method! I use -R and now I have to change each file, one-at-a-time, to get them back to where I want them.

My Discovery: While many people use the terminal to change file user, group, and permissions with "chown" and "chmod" commands, then follow it up by reading those results with "ls -l", I will not be using the terminal from now on for these operations. It is too easy to make a mistake typing and it is too hard remembering what changes are made (especially if you typically don't use the terminal and are not a programmer). It is my personal opinion that my time can be better served and the changes make more sense when using a GUI application. I was able to overcome a very obscure and convoluted file permissions problem, only with the help of a GUI. I would recommend a GUI in any file permissions process.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .