AFP Share Issues

Status
Not open for further replies.

seggerman

Dabbler
Joined
Jun 8, 2011
Messages
34
Thanks I have just tried your suggestion but I get the following message for every single .AppleDB the Terminal found :-

rm: ./.AppleDB/__db.001: Permission denied

So, it's the same problem no matter what I try. I can't get rid of the .AppleDB files. I don't know how I can delete them. :(

Are you root user ?
Does the user have the write bit for the files?
What does 'ls -la' give out?
What does 'ls ./.AppleDB/__db.001' give you ?

Best
Alexander
 
Joined
Sep 5, 2011
Messages
75
Are you root user ?
Does the user have the write bit for the files?
What does 'ls -la' give out?
What does 'ls ./.AppleDB/__db.001' give you ?

Best
Alexander

'ls -la' gives :-
drwxr-xr-x+ 16 FreeNASuser wheel 22 Oct 23 21:08 ./
drwxr-xr-x 4 root wheel 512 Oct 23 19:51 ../
drwxr-xr-x 2 root 755 26 Oct 23 20:23 .AppleDB/
drwxr-xr-x 2 FreeNASuser wheel 3 Oct 8 23:37 .AppleDesktop/
drwxr-xr-x 2 FreeNASuser wheel 8 Oct 8 23:38 .AppleDouble/
-rw-rw-rw- 1 FreeNASuser wheel 24580 Oct 23 20:00 .DS_Store
-rw-rw-rw- 1 FreeNASuser wheel 5160 Apr 22 2011 .VolumeIcon.icns
-rw-rw-rw- 1 www wheel 4096 Oct 3 23:25 ._Synchronize! Volume ID
-rwxr-xr-x+ 1 FreeNASuser wheel 39 Oct 23 21:08 .bash_history*
drwxr-xr-x+ 3 FreeNASuser wheel 4 Oct 23 20:21 .ssh/
-rw-r--r-- 1 root wheel 0 Oct 22 21:52 .windows
drwxr-xr-x+ 9 FreeNASuser wheel 11 Sep 18 00:15 Downloads/
drwxrwxrwx 7 FreeNASuser wheel 10 Sep 14 22:28 HD Backups/
drwxrwxrwx 7 FreeNASuser wheel 9 May 7 12:19 Movies/
drwxrwxrwx 8 FreeNASuser wheel 11 Jul 13 2009 Music/
drwxrwxrwx 3 FreeNASuser wheel 3 Apr 22 2011 Network Trash Folder/
drwxrwxrwx 6 FreeNASuser wheel 8 Feb 6 2011 Other/
drwxrwxrwx 80 FreeNASuser wheel 89 Oct 2 11:52 Photos/
-rw-rw-rw- 1 www wheel 48 Oct 3 23:25 Synchronize! Volume ID
drwxrwxrwx 3 FreeNASuser wheel 3 Apr 22 2011 Temporary Items/
drwxr-xr-x+ 3 FreeNASuser wheel 33 Oct 7 19:35 Trash/

'ls ./.AppleDB/__db.001' gives :-
./.AppleDB/__db.001
 

seggerman

Dabbler
Joined
Jun 8, 2011
Messages
34
'ls -la' gives :-
drwxr-xr-x+ 16 FreeNASuser wheel 22 Oct 23 21:08 ./
drwxr-xr-x 4 root wheel 512 Oct 23 19:51 ../
drwxr-xr-x 2 root 755 26 Oct 23 20:23 .AppleDB/
drwxr-xr-x 2 FreeNASuser wheel 3 Oct 8 23:37 .AppleDesktop/
drwxr-xr-x 2 FreeNASuser wheel 8 Oct 8 23:38 .AppleDouble/
-rw-rw-rw- 1 FreeNASuser wheel 24580 Oct 23 20:00 .DS_Store
-rw-rw-rw- 1 FreeNASuser wheel 5160 Apr 22 2011 .VolumeIcon.icns
-rw-rw-rw- 1 www wheel 4096 Oct 3 23:25 ._Synchronize! Volume ID
-rwxr-xr-x+ 1 FreeNASuser wheel 39 Oct 23 21:08 .bash_history*
drwxr-xr-x+ 3 FreeNASuser wheel 4 Oct 23 20:21 .ssh/
-rw-r--r-- 1 root wheel 0 Oct 22 21:52 .windows
drwxr-xr-x+ 9 FreeNASuser wheel 11 Sep 18 00:15 Downloads/
drwxrwxrwx 7 FreeNASuser wheel 10 Sep 14 22:28 HD Backups/
drwxrwxrwx 7 FreeNASuser wheel 9 May 7 12:19 Movies/
drwxrwxrwx 8 FreeNASuser wheel 11 Jul 13 2009 Music/
drwxrwxrwx 3 FreeNASuser wheel 3 Apr 22 2011 Network Trash Folder/
drwxrwxrwx 6 FreeNASuser wheel 8 Feb 6 2011 Other/
drwxrwxrwx 80 FreeNASuser wheel 89 Oct 2 11:52 Photos/
-rw-rw-rw- 1 www wheel 48 Oct 3 23:25 Synchronize! Volume ID
drwxrwxrwx 3 FreeNASuser wheel 3 Apr 22 2011 Temporary Items/
drwxr-xr-x+ 3 FreeNASuser wheel 33 Oct 7 19:35 Trash/

'ls ./.AppleDB/__db.001' gives :-
./.AppleDB/__db.001

looking at your output it seems as if a mixture of users have accessed/created the files. The .AppleDB needs to be deleted with the root users (since this is being owned by this user). So you will have to log in as root to delete these files.

You have files owned by 'FreeNasUser', 'www' and 'root' is this by design? The way I've set up my system is that I access AFP shares always as guest (no specific user). The local AFP user is 'ftp'. This means that all files are created/modified by ftp. Depending on what you want one or multiple users might be needed. But in general the .apple* files will be created by the AFP user (in my case 'ftp').

You might need to clean up you permissions first 'chmod -R FreenNasUser:wheel 'the directory'', then delete the .apple* files

Do you want individual (named) users accessing the files, or would one BSD user be sufficient for all your users ?

Best
Alexander
 
Joined
Sep 5, 2011
Messages
75
looking at your output it seems as if a mixture of users have accessed/created the files. The .AppleDB needs to be deleted with the root users (since this is being owned by this user). So you will have to log in as root to delete these files.

You have files owned by 'FreeNasUser', 'www' and 'root' is this by design? The way I've set up my system is that I access AFP shares always as guest (no specific user). The local AFP user is 'ftp'. This means that all files are created/modified by ftp. Depending on what you want one or multiple users might be needed. But in general the .apple* files will be created by the AFP user (in my case 'ftp').

You might need to clean up you permissions first 'chmod -R FreenNasUser:wheel 'the directory'', then delete the .apple* files

Do you want individual (named) users accessing the files, or would one BSD user be sufficient for all your users ?

Best
Alexander
I simply set up a user called FreeNasUser from the GUI and left the settings as they were when presented to me.

At the moment I am the only user. My primary use of my server is for backup.

* I have just done :-
chmod -R FreenNasUser:wheel 'the directory'
and got :-
chmod: invalid file mode: FreenNasUser:wheel
 
Joined
Sep 5, 2011
Messages
75
OK I’m getting a little confused now so here’s what I did. I deleted the current user and using the GUI I made a new user of the same name. The default settings for this user are - Primary Group ID is wheel and the home directory is /nonexistent. If I try to change the home directory I get an error but it doesn’t tell me what the error is.

In the Terminal I can ssh FreeNASuser@192.168.1.101 and enter my password. I then get the message below.
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
The Regents of the University of California. All rights reserved.

FreeBSD 8.2-RELEASE-p3 (FREENAS.amd64) #7: Fri Sep 30 12:51:49 PDT 2011

FreeNAS nanobsd (c) 2009-2010, The FreeNAS Development Team
All rights reserved.
FreeNAS is under the modified BSD license.

For more information, documentation, help or support, go here:
http://freenas.org
Welcome to FreeNAS
Could not chdir to home directory /nonexistent: No such file or directory

I then did - cd /mnt/myZFSvolume

I tried - rm -rf `find . -type d -name .AppleDB` but I got the Permission denied massage.

I tried - chmod -R FreeNASuser:wheel 'myZFSvolume' but I got the messages below.

chown: myZFSvolume wheel: No such file or directory
chown: chmod: No such file or directory
chown: -R: No such file or directory
chown: FreeNASuser:wheel: No such file or directory
chown: myZFSvolume: No such file or directory

I tried - chown -R FreeNASuser:wheel myZFSvolume and got - chown: myZFSvolume: No such file or directory.

I am now confused and no further forward.
 

seggerman

Dabbler
Joined
Jun 8, 2011
Messages
34
OneStickShortOfaBundle,

first of all it was a mistake on my side. As william mentioned it has to be chown (change owner) and not chmod.

Basically you are logged in as FreeNASuser, but trying to delete files owned by somebody else (in this case root).

So instead of logging in as FreeNASuser log in as root and then do the 'chown'. You will have to have set a password for root and also enable root access in the SSH service.

Alternatively (I'm not sure if this will work) you can try 'sudo' to execute the following command as root (but you still will have to have a root password).

Alternative #2 ... try to change the ZFS Volume permissions/ownership from the GUI. I don't know if this will work since it depends on which user in the backend will execute the chmod/chown.


Best

Alexander
 
Joined
Sep 5, 2011
Messages
75
OneStickShortOfaBundle,

first of all it was a mistake on my side. As william mentioned it has to be chown (change owner) and not chmod.

Basically you are logged in as FreeNASuser, but trying to delete files owned by somebody else (in this case root).

So instead of logging in as FreeNASuser log in as root and then do the 'chown'. You will have to have set a password for root and also enable root access in the SSH service.

Alternatively (I'm not sure if this will work) you can try 'sudo' to execute the following command as root (but you still will have to have a root password).

Alternative #2 ... try to change the ZFS Volume permissions/ownership from the GUI. I don't know if this will work since it depends on which user in the backend will execute the chmod/chown.


Best

Alexander
OK I really appreciate the help that you are giving me and I realise that my ignorance is part of the problem but...
• Although I have enabled ‘Login as Root with password’ and ‘Allow Password Authentication’ I find that I cannot ssh using my admin name as when I enter my password I get the message ‘Permission denied, please try again.’ I know that my password is correct and I have even copy/pasted it to make sure. So, how do I overcome this?
• I have tried changing permissions/ownership on numerous occasions from the GUI but that doesn’t make any difference.
• I tried making a user account using my admin name and password which allowed me to ssh successfully but then all I got was the old Permission denied messages.
:(
 

seggerman

Dabbler
Joined
Jun 8, 2011
Messages
34
• Although I have enabled ‘Login as Root with password’ and ‘Allow Password Authentication’ I find that I cannot ssh using my admin name as when I enter my password I get the message ‘Permission denied, please try again.’ I know that my password is correct and I have even copy/pasted it to make sure. So, how do I overcome this?

Just to be on the safe side, you have to change the password of the user 'root' and use 'ssh root@IP-Address' to log into your FreeNAS box. The username 'admin' is used for the webgui.

Alexander
 
Joined
Sep 5, 2011
Messages
75
Just to be on the safe side, you have to change the password of the user 'root' and use 'ssh root@IP-Address' to log into your FreeNAS box. The username 'admin' is used for the webgui.
Alexander
I have set the admin and password ages ago. Let’s pretend that my admin name is Fred and that my password is Blogs. Would I be correct to use ssh Fred@192.168.1.101 followed when asked by the password Blogs? That’s what I am trying to do but I keep getting ‘Permission denied, please try again.’ with the password.

P.S. I thought that I would try changing the permissions once again from the GUI. It has been working on it since last night so that’s over twelve hours. I shall let it continue until it is finished but I don’t know how long it will take.
 

seggerman

Dabbler
Joined
Jun 8, 2011
Messages
34
I have set the admin and password ages ago. Let’s pretend that my admin name is Fred and that my password is Blogs. Would I be correct to use ssh Fred@192.168.1.101 followed when asked by the password Blogs? That’s what I am trying to do but I keep getting ‘Permission denied, please try again.’ with the password.

P.S. I thought that I would try changing the permissions once again from the GUI. It has been working on it since last night so that’s over twelve hours. I shall let it continue until it is finished but I don’t know how long it will take.

You need to change the user named root. In the tree view go to 'Account->Users->View All Users. The on the user called root do the 'change password'. This is the root (superuser) who can do everything. Then with this user/password you can then login and do the 'chown' magic.
 
Joined
Sep 5, 2011
Messages
75
You need to change the user named root. In the tree view go to 'Account->Users->View All Users. The on the user called root do the 'change password'. This is the root (superuser) who can do everything. Then with this user/password you can then login and do the 'chown' magic.
Sir you are a genius. I have finally managed to delete the offending AppleDB files but I am still cannot write to my server. Could you possibly explain to me how to use chown to allow FreeNASuser to write to my volume called MyVolume? I have tried myself but I keep getting told ’No such file or directory.’ :confused:
 

seggerman

Dabbler
Joined
Jun 8, 2011
Messages
34
This is my setup (YMMV ... depending on what you want/need). I have a AFP setup for guest access only. So the backup files etc are accessed via the guest user. Same applies for the time machine dataset. Everything via guest.

1) my ZFS Volume has nobody/wheel and rwxrw-rw- as owner and permission
2) AFP is setup to allow guest and guest account is 'nobody'
3) the AFP share are setup with just the path, disc discovery on and 'default' or 'time capsule' depending on the share.

So that is my setup. I started from scratch therefore never had any permission problems. For you to get there you should first set permissions on you complete volume. My Volume is called NASRaid in the /mnt directory
Code:
[root@nasraid] /mnt# ls -la
total 21
drwxr-xr-x   4 root    wheel     512 Oct 14 20:02 ./
drwxr-xr-x  20 root    wheel     512 Oct 13 22:47 ../
drwxrwxr-x   2 root    operator  512 Oct 14 20:02 .snap/
drwxr-xr-x   9 nobody  wheel       9 Oct  6 12:53 NASRaid/
-rw-r--r--   1 root    wheel       5 Oct 13 22:46 md_size
[root@nasraid] /mnt# 


From the /mnt directory you would need to do:
1) chmod 755 NASRaid
2) chown -R nobody:wheel NASRaid

Naturally replace NASRaid with your volume name.

After that the permissions should be set straight.

I would then in the GUI change the permissions/owner of the ZFS Dataset to reflect the new setting.

Have a check then on your AFP setting and the share setting.

Then you should have everything set straight.

Naturally if you want to use a different user (FreeNASuser), want specific user logins you would have to modify the permissions and users, so that everybody has access

Best

Alexander
 

Mario084

Dabbler
Joined
Oct 25, 2011
Messages
12
Hello,

i´m facing the same problem now (i´m running from one problem to another at the moment with freenas :-( )

I have setup a AFP share, using Mac OS X Lion 10.7.2. Everytime when i try to access as guest i get the error message in finder "error 50".

When i try to logon with my user / password i get the message in finder, that this share isn´t supported with mac os.

So my first step was to setup an CIFS share. I can access this share on windows, everything is working fine. When i try to access it with mac os x lion i can copy files, but if they are bigger than approximately 4 GB the copy job cancels and i get an "unknown error" message.

So i want to fix the permissions for AFP share or otherwise i should be able to copy via CIFS Share files bigger than 4 GB! Can anyone help me out?

Thanks!
 

seggerman

Dabbler
Joined
Jun 8, 2011
Messages
34
I have setup a AFP share, using Mac OS X Lion 10.7.2. Everytime when i try to access as guest i get the error message in finder "error 50".
Does the guest user (defined in the AFP setting) have write access to the file/folder/filesystem?

When i try to logon with my user / password i get the message in finder, that this share isn´t supported with mac os.
Is this uid/pw a FreeNas user or a mac user? The mac tries to login with the currently logged on user (on the mac) so this might collide

Alexander
 

Mario084

Dabbler
Joined
Oct 25, 2011
Messages
12
Thanks, my problem is solved now. Fixed the permissions, had to enter my MAC OS User name under "allow list". Now AFP access is fine.

Now i am having the problem of poor performance. I´m copying some file from my internal hard drive and i copy with 30-40 MB, but not continious. The speed goes up and down every second. From 1 MB/sec to 30 MB/sec and from 400 KB/sec to 50 MB/sec...and so on!

Can anyone tell me how to improve that? In 0.7.2. there was a checkbox for "boosting performance" or something like that. Can´t find something like that in 0.8.2 by now.

Thanks
 
Joined
Sep 5, 2011
Messages
75
@ Alexander, seggerman and everyone else who has helped.

I have finally given up and last Friday I began to rebuild the whole NAS. Fortunately I have two backups from which to do this.
Everything that I tried came up with error messages and, although some progress was being made, at the rate it was going it looked like it might take months to get everything working again. Starting from scratch would be quicker so I have erased everything and have begun afresh. Interestingly the default ownerships and permissions on the new setup are quite different from the ones on one of my backups which is of an identical setup yet works properly. I wonder if earlier installations used different settings, ownerships and permissions that have not been suitably modified during updates? Could that be the source of the problem? Whatever the reason I shall be much more cautious about applying updates in future as least until I have scanned the forums to evaluate whether it is safe to do so or not.

I shall keep watching this thread as I’d like to get to the root (lol) of this problem. I hate being beaten by anything. Thanks for trying to help. :)
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Now i am having the problem of poor performance. I´m copying some file from my internal hard drive and i copy with 30-40 MB, but not continious. The speed goes up and down every second. From 1 MB/sec to 30 MB/sec and from 400 KB/sec to 50 MB/sec...and so on!

I've found ZFS to be quite a bit more annoying in how it handles I/O than previous filesystems. Speed varying greatly for no apparent reason is definitely something I noticed with both FreeNAS and Nexenta, so my guess is that it's ZFS. The same hardware runs fairly consistently on UFS.

There's some loader.conf tunable that supposedly evens out the performance somewhat by dropping a ZFS timer from 30 seconds to 5 or so. I haven't really had an opportunity to try it, but it might be interesting to you.
 
Status
Not open for further replies.
Top