Permission Problems

Status
Not open for further replies.

andrema2

Explorer
Joined
Aug 3, 2011
Messages
83
Hi all,

I have create a share on my Freenas 8.0.1 b4 using AFP. The volume has permission to Owner andre and Group wheel for read, write and execute and other have read and execute. The AFP share have allow list and read-write for wheel group.

I copied a bunch of files (1.5 tb) and everything was ok.

Then I created a NFS share using the same volume. In the NFS share the maproot user is andre and the maproot group wheel. Nevertheless, I was unable to access the files or folders from my Mac. I tried to reapply the permissions on the volume level recursively. An error message appeared at the top of the GUI stating that there was an error, just that.

Now the situation is worse. This is the type of permission on the volume
# file: Movies
# owner: andre
# group: wheel
owner@:--------------:------:deny
owner@:rwxp---A-W-Co-:------:allow
group@:-w-p----------:------:deny
group@:r-x-----------:------:allow
everyone@:-w-p---A-W-Co-:------:deny
everyone@:r-x---a-R-c--s:------:allow

I know nothing of linux and its permissions but it seems to me that it is all messed up.

I can't change the permissions via GUI since it always give the the error message. How can I change it via SSH ? I would like to reset it to the owner user/group which I know I have permission. Better yet, since this is a home server, I don't need any permission at all.

Thanks for the help and patience
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
From the command line, in the parent directory you can set the owner and group like this:

chown -R owner:group ./*

That will get everything from the directory you're in, all the way to the lowest subdirectory.

Note: Just realized I forgot the './*' part
 

andrema2

Explorer
Joined
Aug 3, 2011
Messages
83
Thanks

It seems ok when I check using ls -l. On the GUI, it shows the owner as me and the group has only read and execute. If I try to correct on the GUI the same error message appears. Seems to me that there is a bug there.

Once again thanks
 

Thai Raconteur

Dabbler
Joined
Aug 14, 2011
Messages
10
Finally got my permissions sorted out with chown -R owner:group ./* command!
Still can't delete files and directories but can make and modify them so it is sort of OK. Is this a beta problem?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
You can't delete a directory unless it's empty. Here are some tricks, use them carefully or you could delete a bunch of stuff you don't want to.

rmdir (will delete an empty directory if you are not 'in' it, need to be in parent folder)

find ./ -type d -empty -delete (will delete all EMPTY *directories* only)

most dangerous.... will delete directories by force with all the files in them: USE VERY CAUTIOUSLY! EDIT - Probably best to verify current directory with 'pwd' before using this.

rm -rf ./*
 

Thai Raconteur

Dabbler
Joined
Aug 14, 2011
Messages
10
Thanks for this. Problems is I also can't delete single files so I can't make empty directories! Got to get all of my permissions sorted out.
 

andrema2

Explorer
Joined
Aug 3, 2011
Messages
83
Protosd,

Thanks again. When I try to use NFS I still have some issues. If I give permission on the share using maproot I don't have any access to the folders or disks. I mean, I can't read the folder content nor create a new file on the root level. If I use mapall, then I can create new files and navigate on the folders. The problem appears when I try to access a folder used by iTunes. The folder is named after a Brazilian band Legião Urbana. Below this folder I know I have several other folders with the albums names. If I use NFS I can't see them, is like they don't exists. If I use AFP then I can see them with no problem.

I assume that the permission on the folder and files are ok, since I can access them fine via AFP. I'm assuming I'm doing something wrong with the NFS connection.

More info I think can help. I'm using Lion. If I give permission using CHOWN to root:wheel, when I try to get info from the folder or files, in the permissions I can see that wheel has read only, everyone has read only and another user/group that appears as fetching (as Lion was trying to discover the user name) has read/write permissions. If I give permissions to myself:wheel then when I get info I get fetching read/write and everyone no access. I don't see wheel any more.

On the share the permission was done to myself and to wheel group. My primary group is wheel and I added my self to wheel group as well.

Can you help me again ?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I know the developers said they had trouble getting permissions from different file systems to work properly with each other in some cases. I'll see if I can find what was suggested and post back tomorrow. I'll try to help you find a solution.
 

andrema2

Explorer
Joined
Aug 3, 2011
Messages
83
I know the developers said they had trouble getting permissions from different file systems to work properly with each other in some cases. I'll see if I can find what was suggested and post back tomorrow. I'll try to help you find a solution.

Thanks Protosd
 

Thai Raconteur

Dabbler
Joined
Aug 14, 2011
Messages
10
Thanks also Protosd!

I can sort of serve files but I got to be careful about what I copy to the server as it is there for good! Again can't delete files or directories even tho all the setting permission setting in the UI are checked. Other than that I am serving nearly 1 TB very stably.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
The post I was thinking of was the release notes for beta-4 here: FreeNAS-8.0.1-BETA4 but it doesn't apply to your problem like I thought.

If you login at the console and 'cd' to the folder you mentioned "Legião Urbana" do an 'ls -ld ./*' and post the results if you want, or at least a sample including the that folder '.'

You probably need to make sure that the GID on FreeNAS is the same as the one you're trying trying to access your files remotely using NFS with. I'm not sure how to find that out on the Mac, you might know, probably from the terminal window.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Here's how to find your UID/GID on Mac. It was too simple, I should have thought of it:

To find out your UID and GID, open a terminal window:

Code:
cd ~
ls -n

Or, you can use the id command.
id


Then you need to check them on FreeNAS. You can do that from the GUI by going to:
Accounts -> View All Groups and looking at the # on the left next to the group name.

Accounts -> View All Users same thing look at the # on the left next to the username.

The idea is to make those match for the UID/GID you have on your Mac without picking a # that is already being used by another user/group.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
There's also this funny little FreeBSD thing (its a PITA) called 'chflags' which can prevent even root from deleting files. To unset it you would do 'chflags -R noschg ./*'

google 'freebsd man chflags' to learn more about it.

Edit: Here's a good link write-protect-files-with-immutable-bit
 

Thai Raconteur

Dabbler
Joined
Aug 14, 2011
Messages
10
Well I did the 'chflags -R noschg ./*' and it accepted it but so far I have not got any better access to folders and and files!
 

andrema2

Explorer
Joined
Aug 3, 2011
Messages
83
Protosd,

Thanks now it works. I changed the UID of my user in Freenas to match my id in Lion. It solved the problem.
Thanks again. Let's hope he beta 5 solve it or even the final version. It's kinda funny that I was the only one with this kind of problem.

Cheers
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Andreme2 -

Thanks for reporting back, glad to hear it fixed your problem. I'm sure there were others with the problem that just didn't recognize it as the same problem.
 

andrema2

Explorer
Joined
Aug 3, 2011
Messages
83
Hi Protosd

I think I got the problem with the folder access. Looks like NFS has issues to access folders with special characters like ã. Since iTunes create folders based on band and albums names it have this type of characters.
As results I can see the folder with the special character but, when I enter the folder I can't see any files or folders under it. If I use AFP everything is there.

Question is how to allow NFS to understand all characters ?
 

andrema2

Explorer
Joined
Aug 3, 2011
Messages
83
Hi

Anyone is having this problem ? It's a pain because now iTunes can find all my music and keeps saying that more than a 100 songs are missing. Any ideas on how to solve it using NFS ? Thanks
 

Thai Raconteur

Dabbler
Joined
Aug 14, 2011
Messages
10
Do any of our resident Linux gods know how to use the "chmod" command to give unlimited access to all share directories? I have already tried "chown" for root:wheel to try and clear flags and when I do a "ls -l" all I can get is -rw-r--r--

Thanks
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Hi Thai,

chown only sets owner & group, you need to use 'chmod'. chmod has a -R option to recursively do subdirectories, the problem is that will set directories as well as files to the same setting which you don't want. Here's what I use to get all the folders & files below the one I'm in:

find . -type d -exec chmod 777 {} \; This will set the folders/directories

find . -type f -exec chmod 666 {} \; This will set all the files
 
Status
Not open for further replies.
Top