我花了 24 小时安装我的 Debian 服务器和各种软件包。由于此服务器在 Mac OS X (10.8) 环境中运行,我最初的目标是使用此服务器作为 TimeCapsule 的替代品。
因此我安装了 Netatalk 3.0.2 和 avahi-daemon 以实现 zeroConfig 和 Time Machine 支持。
连接到我的服务器的硬盘是使用 GUID 分区方案的 HFS+ 格式的。
我确实为每台 Mac 设置了一个包含一个文件夹的卷作为 TimeCapsule 卷,并添加了两个 unix 用户供他们访问这些驱动器,并添加了两个额外的驱动器作为数据驱动器。我通过以下方式更改了 TimeCapsule 驱动器/文件夹的所有权:
chown -R userA:userA /media/usb/TimeCapsuleA
and
chown -R userB:userB /media/usb/TimeCapsuleB
我的 /etc/afp.conf 看起来像这样
[Global]
hostname = TimeCapsule
log file = /var/log/netatalk.log
uam list = uams_guest.so, uams_dhx.so, uams_dhx2.so,
zeroconf = yes
save password = yes
mimic model = TimeCapsule6,106
log level = default:warn
log file = /var/log/netatalk.log
hosts allow = 192.168.178.0/24
[default_for_all_vol]
[TimeCapsuleA]
path = /media/usb/TimeCapsuleBackup/TimeCapsuleA/
time machine = yes
valid user = usera
invisible dots = yes
search db = yes
ea = auto
cnid scheme = dbd
[TimeCapsuleB]
path = /media/usb/TimeCapsuleBackup/TimeCapsuleB/
time machine = yes
valid user = userb
invisible dots = yes
search db = yes
ea = auto
[PogoPlug1]
path = /media/usb/PogoPlug1/
cnid scheme = dbd
ea = auto
mac charset = MAC_ROMAN
invisible dots = yes
search db = yes
valid user = userA userB
[OSX-Exchange]
path = /media/usb/OSX-Exchange/
cnid scheme = dbd
ea = auto
mac charset = MAC_ROMAN
invisible dots = yes
search db = yes
valid user = userA userB
我的挂载表
/etc/auto.misc on /media/usb type autofs (rw,relatime,fd=6,pgrp=1658,timeout=300,minproto=5,maxproto=5,indirect)
/dev/sdb2 on /media/usb/TimeCapsuleBackup type hfsplus (ro,nosuid,nodev,noexec,relatime,sync,umask=22,uid=0,gid=0,nls=utf8)
/dev/sdc2 on /media/usb/PogoPlug1 type hfsplus (ro,nosuid,nodev,noexec,relatime,sync,umask=22,uid=0,gid=0,nls=utf8)
/dev/sdd2 on /media/usb/OSX-Exchange type hfsplus (ro,nosuid,nodev,noexec,relatime,sync,umask=22,uid=0,gid=0,nls=utf8)
/media/usb/ 的权限
drwxrwxrwx 1 evils evils 20 Feb 27 01:24 OSX-Exchange
drwxrwxr-x 1 evils evils 18 Feb 27 01:19 PogoPlug1
drwxrwxr-x 1 root root 12 Feb 27 01:00 TimeCapsuleBackup
所有驱动器均通过 autofs 安装。UserA 和 UserB 都是组 0 的成员,当尝试通过终端执行此操作时,他们可以写入所有驱动器。
现在,当我尝试以 UserA 身份访问 TimeCapsuleA 卷时,我获得了完全的写入权限,并且可以将该卷用作 TimeMachine 备份卷。但是,当我使用属于组 0 的同一用户访问 OSX-Exchange 或 PogoPlug1 时,我没有获得任何写入权限,这真的很奇怪,因为我可以通过终端以同一用户的身份写入同一张光盘。当我将所有权更改为该用户时,我再次获得写入权限,但只有这个特定的用户可以再次写入,而同一 gid 或有效用户参数中的其他用户都无法写入。
现在,由于我有几个用户需要访问这些数据驱动器,我需要找到一种方法,如何写入同一个驱动器,而不必在每次写入用户更改时更改所有权。
当启动 netatalk 时,我的 netatalk 日志文件输出以下内容:
Feb 27 00:59:08.422374 cnid_dbd[3314] {netatalk_conf.c:196} (W:AFPDaemon): volume "TimeMachineFH" does not support Extended Attributes or read-only volume
Feb 27 00:59:08.423147 cnid_dbd[3314] {netatalk_conf.c:196} (W:AFPDaemon): volume "TimeMachineNS" does not support Extended Attributes or read-only volume
Feb 27 00:59:08.423549 cnid_dbd[3314] {netatalk_conf.c:196} (W:AFPDaemon): volume "PogoPlug1" does not support Extended Attributes or read-only volume
Feb 27 00:59:08.423828 cnid_dbd[3314] {netatalk_conf.c:196} (W:AFPDaemon): volume "OSX-Exchange" does not support Extended Attributes or read-only volume
Feb 27 01:04:34.658562 cnid_metad[3460] {netatalk_conf.c:196} (W:AFPDaemon): volume "TimeMachineFH" does not support Extended Attributes or read-only volume
Feb 27 01:04:34.659329 cnid_metad[3460] {netatalk_conf.c:196} (W:AFPDaemon): volume "TimeMachineNS" does not support Extended Attributes or read-only volume
Feb 27 01:04:34.659725 cnid_metad[3460] {netatalk_conf.c:196} (W:AFPDaemon): volume "PogoPlug1" does not support Extended Attributes or read-only volume
Feb 27 01:04:34.660002 cnid_metad[3460] {netatalk_conf.c:196} (W:AFPDaemon): volume "OSX-Exchange" does not support Extended Attributes or read-only volume
Feb 27 01:04:34.799875 afpd[3459] {netatalk_conf.c:196} (W:AFPDaemon): volume "TimeMachineFH" does not support Extended Attributes or read-only volume
Feb 27 01:04:34.800798 afpd[3459] {netatalk_conf.c:196} (W:AFPDaemon): volume "TimeMachineNS" does not support Extended Attributes or read-only volume
Feb 27 01:04:34.801209 afpd[3459] {netatalk_conf.c:196} (W:AFPDaemon): volume "PogoPlug1" does not support Extended Attributes or read-only volume
Feb 27 01:04:34.801534 afpd[3459] {netatalk_conf.c:196} (W:AFPDaemon): volume "OSX-Exchange" does not support Extended Attributes or read-only volume
Feb 27 01:04:53.508492 afpd[3464] {netatalk_conf.c:196} (W:AFPDaemon): volume "TimeMachineFH" does not support Extended Attributes or read-only volume
Feb 27 01:04:53.508942 afpd[3464] {netatalk_conf.c:196} (W:AFPDaemon): volume "TimeMachineNS" does not support Extended Attributes or read-only volume
Feb 27 01:04:53.509239 afpd[3464] {netatalk_conf.c:196} (W:AFPDaemon): volume "PogoPlug1" does not support Extended Attributes or read-only volume
Feb 27 01:04:53.509531 afpd[3464] {netatalk_conf.c:196} (W:AFPDaemon): volume "OSX-Exchange" does not support Extended Attributes or read-only volume
即使所有权与登录用户匹配,我也有完全的写访问权限。
这些是我尝试通过 AFP 创建新文件夹时遇到的错误:
Feb 27 01:05:08.355873 afpd[3467] {ad_open.c:976} (E:Default): ad->ad_ops->ad_mkrf(ad_p) failed: Permission denied
任何帮助都将不胜感激!
答案1
这可能与你所有的坐骑都是只读有关吗?所有三个卷都有反渗透属性。使用读写(读写)选项/etc/fstab如果自动挂载,则文件如下:
/dev/sXXX /media/usb/volume_name type hfsplus rw,nosuid,nodev,noexec,relatime,sync,umask=22,uid=0,gid=0,nls=utf8
或者,如果您手动安装,请使用:
sudo mount /dev/XXX /media/usb/volume_name -t hfsplus -o rw,nosuid,nodev,noexec,relatime,sync,umask=22,uid=0,gid=0,nls=utf8
答案2
我一直在为类似的问题而苦恼,错误信息完全一样:
cnid_metad[]: volume "MyVolume" does not support Extended Attributes or read-only volume
Netatalk 版本使用的是 3.1.8,但基本上任何 3.x 都会产生相同的消息。
在我的情况下,我共享的是 reiserfs 文件系统,我不需要扩展属性,这只是数据访问卷。所以我想清除 Debian Linux 系统服务器的 daemon.log 中的错误,因为它会破坏日志。
解决方案是禁用所有设置中的扩展属性ea = none
,并恢复到旧版本的 AppleDouble appledouble = v2
。
将代码放入 Volume 部分:
[MyVolume]
...
appledouble = v2
ea = none
答案3
配置键是复数:valid users
。