# Can't mount netatalk 2 share from Mac OS

## nonhuman

I just upgraded from netatalk 1.6.4 to 2.0.1, and now my mac can't mount volumes shared over AFP any more. When I try to it successfully logs in and shows me the available shares, but when I try to mount them an error message pops up but disappears too quickly to be read (it looks like it says something along the lines of '...failed to mount...').

The settings are still default as I don't want to start trying to customize anything until I can actually get it working.

Does anyone have any ideas?

----------

## nonhuman

Update:

I only get this behavior when trying to connect from OS X 10.4. When connecting from 10.3.9 I don't see any available shares to mount.

----------

## nonhuman

Another update:

I downgraded back down to 1.6.4, but now I have another problem. I can connect to the share via afp from my mac, but the directory that is being shared shows up as empty when it's mounted on the mac. On my gentoo box it's actually an nfs mount from a different box and has a number of directories and files in it.

I know I've seen this problem mentioned before somewhere, but i can't find it anymore. Can someone help me find the link again?

----------

## hawaiian717

Anyone figure out the problems with netatalk2?  I am having the same trouble with netatalk-2.0.3 that nonhuman reported with 2.0.1.  On 10.4.2, I can use "Connect to Server" and see the available shares and select one, but the error message disappears right away.  Then another one comes up in the one that had the Connecting To Server progress bar, it says:

 *Quote:*   

> Sorry, the operation could not be completed because an unexpected error occured
> 
> (Error code -5014).

 

If I browse the network in a Finder window, I see the server, but when I click "Connect", I get an error message:

 *Quote:*   

> Conection Failed
> 
> This file server is running on your machine. Please access the volumes and files locally.

 

Using 10.3.9, don't see any shares when I do "Connect to Server" and browsing in the Finder, I don't see the server.

I've been using sftp and scp in the meantime, but would like to get AppleShare working again.

In case it helps, here's the emerge --info for the server:

```
Portage 2.0.51.22-r2 (default-linux/ppc/2005.0, gcc-3.4.4, glibc-2.3.4.20041102-r1, 2.6.10-gentoo-r8 ppc)

=================================================================

System uname: 2.6.10-gentoo-r8 ppc 603ev

Gentoo Base System version 1.6.13

ccache version 2.3 [enabled]

dev-lang/python:     2.3.5

sys-apps/sandbox:    1.2.12

sys-devel/autoconf:  2.13, 2.59-r6

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6

sys-devel/binutils:  2.15.90.0.3-r5

sys-devel/libtool:   1.5.18-r1

virtual/os-headers:  2.6.8.1-r4

ACCEPT_KEYWORDS="ppc"

AUTOCLEAN="yes"

CBUILD="powerpc-unknown-linux-gnu"

CFLAGS="-O2 -mtune=powerpc -fno-strict-aliasing -pipe"

CHOST="powerpc-unknown-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -mtune=powerpc -fno-strict-aliasing -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig ccache distlocks sandbox sfperms strict"

GENTOO_MIRRORS="http://gentoo.ccccom.com http://mirror.datapipe.net/gentoo http://gentoo.osuosl.org/  ftp://gentoo.ccccom.com http://ftp.du.se/pub/os/gentoo"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="ppc alsa apache2 berkdb bitmap-fonts crypt cups emboss fortran gif gpm gtk2 ipv6 java jpeg libwww motif mp3 mpeg mysql ncurses nls oggvorbis pam pdflib perl php png python readline spell ssl tcpd tiff truetype truetype-fonts type1-fonts unicode usb xml2 xv zlib userland_GNU kernel_linux elibc_glibc"

Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
```

----------

## Will Scarlet

It sounds like you have db corruption, but not really sure.  I don't think this would be the official fix, but this has worked for me (several times   :Very Happy:  , but YMMV):

First make a backup of all directories that you are sharing through netatalk (If any problems arise, you want to be able to at least get back to your original state). 

Now on to the fun stuff:

1.  Stop the netatalk service.

2.  Delete the following files/directories within the netatalk share directory:

-- This will get rid of any leftover cruft whether it's from db conversions or db corruption.

-- Note: some of these files reside beyond the root directory of the netatalk share..AppleDB

.AppleDesktop

.AppleDouble

:2eDS_Store

.DS_Store

:2eTempoaryItems

.TempoaryItems

.Temporary

Network Trash Folder

Temporary ItemsUsing the following command has worked well for me for finding and deleting files:

-- Caution: only use this command if you feel comfortable using it and understand what it does.  Do not blame me if you loose more than intended.  You have been warned.

```
find {netatalk share directory} -name "{insert what you want removed here}" -print0 | xargs -0r rm -fr
```

3.  In your AppleVolumes.default set you default cnidscheme to dbd.

-- I've found that this db scheme has reduced many of my problems with db corruption issues.

-- From the man file: *Quote:*   

> dbd  Access to the CNID database is restricted to the cnid_metad daemon  process.
> 
> afpd  processes  communicate with the daemon for database reads and updates.
> 
> If built with Berkeley DB transactions the probability for database  corrup-
> ...

 I've been using the dbd backend since 2.0 was in portage and have not noticed any slow performance (YMMV).

4.  Verify you netatalk configuration files.  Never hurts to be thorough.

5.  Restart the netatalk service.

Hope this helps...   :Wink: 

Edited 3 Jan 2006 for mistake in file name.Last edited by Will Scarlet on Tue Jan 03, 2006 2:51 pm; edited 1 time in total

----------

## hawaiian717

Thanks Will, that seems to have fixed it for me.

----------

## cchee

In addition, if you do not have nscd running. You may run into the similar situation where user can login but the mount point list is blank. I have learned it the hard way.

----------

## statmobile

 *Will Scarlet wrote:*   

> 
> 
> 2.  Delete the following files/directories within the netatalk share directory:
> 
> -- This will get rid of any leftover cruft whether it's from db conversions or db corruption.
> ...

 

This just worked for me, but I just thought I would point out that AppleDB was actually .AppleDB in my home directory.  Thanks for the tip!

----------

## Will Scarlet

Thanks statmobile.  I've edited to correct the error.

----------

## nonhuman

I had fixed this problem, but then my gentoo box suffered a hardware failure. I've set up a new one, but I'm again running into this problem and unfortunately Will's solution doesn't seem to be working.

The problem appears to be related to the fact that the directory I'm trying to share is a separate partition. I want to share /dev/hda5 which is an HFS+ formatted partition. I have /dev/hda5 mounted at /mnt/files. When I have the partition mounted I get the same error as in my original post however when it's not mounted I have no problem at all.

I know for a fact it's possible to do this as I had it working before, but I can't for the life of me remember how I fixed it back then.

Does anyone have any ideas?

Thanks.

----------

## nonhuman

 *nonhuman wrote:*   

> I had fixed this problem, but then my gentoo box suffered a hardware failure. I've set up a new one, but I'm again running into this problem and unfortunately Will's solution doesn't seem to be working.
> 
> The problem appears to be related to the fact that the directory I'm trying to share is a separate partition. I want to share /dev/hda5 which is an HFS+ formatted partition. I have /dev/hda5 mounted at /mnt/files. When I have the partition mounted I get the same error as in my original post however when it's not mounted I have no problem at all.
> 
> I know for a fact it's possible to do this as I had it working before, but I can't for the life of me remember how I fixed it back then.
> ...

 

The problem appears to be caused by the partition being HFS+. I reformatted it to ext3 and now it appears to work without a hitch (although I had to chmod 777 the directory before I could get write access from the mac).

Does anyone know if there might be issues using an ext3 partition with Macs? My concern is that the lack of metadata might cause issues.

----------

## Gauss_Cleric

Hi there,

I'm having problem with the cnid backend. If I use dbd or cdb I get the following error type when accessing a share:

[cnid_metad] allocvolinfo("/mnt/raid/storage/dassen"): No such file or directory

Of course the referenced directories exists (its a ifs volume previously mounted). I've deleted all netatalk-related directories to restart the database with no difference. If I use the tdb backend all works well. There are no problems with the permission since the database files get created. Also, I do have the Berkley DB installed (sys-libs/db package). I'm running out of options... I would just use tdb but for some directories need to be accesses by more than one user at the same time. Any ideas?

Thanks in advance,

GN

----------

## Gauss_Cleric

For what is worth here is the relevant part of my /etc/netatalk/AppleVolumes.default file:

/mnt/raid/media media casefold:tolower cnidscheme:dbd rolist:nobody rwlist:dassen

/mnt/raid/storage/shared shared casefold:tolower cnidscheme:dbd rolist:nobody rwlist:@users 

/mnt/raid/storage/dassen dassen casefold:tolower cnidscheme:tdb allow:dassen rwlist:dassen options:tm

/mnt/raid/storage/rick rick casefold:tolower cnidscheme:tdb allow:rick rwlist:rick options:tm

The other config files are of no real relevance (just authentication stuff and if I want to run cnid_metad daemon which is set!)

----------

## grimm26

 *Gauss_Cleric wrote:*   

> Hi there,
> 
> I'm having problem with the cnid backend. If I use dbd or cdb I get the following error type when accessing a share:
> 
> [cnid_metad] allocvolinfo("/mnt/raid/storage/dassen"): No such file or directory
> ...

 

Get rid of the  casefold:tolower in /etc/netatalk/AppleVolumes.default

----------

