How to Fix: How to write to HFS+ through AFP/Netatalk without permission denied and cnid_metad error?
Fix permission denied and cnid_metad error when writing to HFS+ drives using AFP/Netatalk on a Debian server with Mac OS X environment.
📋 Table of Contents
This troubleshooting guide is designed to help you resolve the 'permission denied' and 'cnid_metad error' issues when attempting to write to HFS+ volumes through AFP/Netatalk on a Debian server running Mac OS X (10.8) environment.
The error can be frustrating, especially since it prevents you from using your server as a TimeCapsule replacement. However, by following the steps outlined in this guide, you should be able to resolve the issue and access your HFS+ volumes without any problems.
⚠️ Common Causes
- The primary reason for this error is that the 'cnid_metad' database is not properly configured on the server. The 'cnid scheme' parameter in the AFP configuration file should be set to 'dbd', which stands for 'Database-Driven Database'. This setting tells Netatalk to use a database-driven approach to manage CNIDs (Client Network Identifiers), which are necessary for authentication and authorization.
- Another possible cause is that the ownership of the HFS+ volumes or folders has not been correctly set. Make sure that the 'valid user' parameter in the AFP configuration file matches the username that is trying to access the volume, and that the ownership has been set using the `chown` command with the correct group ID.
🛠️ Step-by-Step Verified Fixes
Configuring the cnid_metad database
- Step 1: Edit the `/etc/afp.conf` file and change the 'cnid scheme' parameter for each volume to 'dbd'. This will ensure that Netatalk uses a database-driven approach to manage CNIDs.
- Step 2: Restart the `avahi-daemon` service to apply the changes. You can do this by running the command `sudo systemctl restart avahi-daemon` (on Debian-based systems) or `sudo /etc/init.d/avahi-daemon restart` (on older systems).
- Step 3: Verify that the CNID database is properly configured by checking the `/var/log/netatalk.log` file for any errors related to CNIDs.
Correcting ownership and permissions
- Step 1: Check the ownership of the HFS+ volumes or folders using the `ls -l` command. Make sure that the 'valid user' parameter in the AFP configuration file matches the username that is trying to access the volume.
- Step 2: Use the `chown` command to set the correct ownership and group ID for each volume or folder. For example, if you want to set the ownership of a volume to `userA:userA`, run the command `sudo chown -R userA:userA /media/usb/TimeCapsuleA`.
- Step 3: Verify that the permissions on the volumes or folders are correct by checking the `/etc/auto.misc` file for any errors related to permissions.
💡 Conclusion
By following these steps, you should be able to resolve the 'permission denied' and 'cnid_metad error' issues when attempting to write to HFS+ volumes through AFP/Netatalk on a Debian server running Mac OS X (10.8) environment. Remember to restart the `avahi-daemon` service after making any changes to the configuration file, and verify that the CNID database is properly configured for optimal results.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid