SSブログ
エステ

最近のsmb.conf [Samba]

最近、NetatalkからSambaに傾きつつあるファイルサーバでのsmb.confメモ。(それでもやっぱりnetatalkがsambaよりも圧倒的に早い。体感的にも。だから結局、netatalkに戻るのだけれども。。) 

max protocol = SMB2

socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536

を設定してあげると、それなりに早くなる。

samba4.0系の方が3.6系よりも早いけれども、インストールが面倒なのと、イマイチ安定していなかったこともあり、3.6系に戻す。 

 

Wired LANで、MacBook Pro Retina model Late2013との接続でのベンチマーク結果。 

QuickBench(TM) 4.0 Test Results

ゥ2000-2007 Intech Software Corp.

Test file created on 2013年 12月 4日 水曜日 at 11:31:48 PM

Test Volume Name: Share

Test Volume Type: Windows Sharing (SMB/CIFS)

Test Volume Size: 5.372 Terabytes

Test Volume Free Space: 2.267 Terabytes

Allow Disk Cache Effects: Disabled

All reads and writes performed sychronously

Standard Test Results:

Test Cycles: 1 

Transfer Size   Sequential Read   Sequential Write    Random Read      Random Write

   4 KBytes      5.339 MB/Sec      2.441 MB/Sec      6.116 MB/Sec      3.078 MB/Sec

   8 KBytes      9.818 MB/Sec      4.577 MB/Sec      9.220 MB/Sec      6.355 MB/Sec

  16 KBytes      16.077 MB/Sec     8.549 MB/Sec      16.082 MB/Sec     11.324 MB/Sec

  32 KBytes      25.983 MB/Sec     10.795 MB/Sec     26.314 MB/Sec     13.344 MB/Sec

  64 KBytes      38.219 MB/Sec     15.543 MB/Sec     38.872 MB/Sec     24.225 MB/Sec

 128 KBytes      44.659 MB/Sec     29.375 MB/Sec     45.290 MB/Sec     35.825 MB/Sec

 256 KBytes      49.092 MB/Sec     44.630 MB/Sec     49.749 MB/Sec     47.832 MB/Sec

 512 KBytes      70.361 MB/Sec     57.709 MB/Sec     78.113 MB/Sec     68.398 MB/Sec

1024 KBytes      87.999 MB/Sec     62.801 MB/Sec     86.561 MB/Sec     72.147 MB/Sec

Standard Ave     38.616 MB/Sec     26.269 MB/Sec     39.591 MB/Sec     31.392 MB/Sec

 

smb.confは今のところこんな感じで。 

[global]

        dos charset = CP932

        display charset = UTF-8

        netbios name = fS2-SMB2

        server string = %h Samba Server

        map to guest = Bad User

        obey pam restrictions = Yes

        pam password change = Yes

        passwd program = /usr/bin/passwd %u

        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

        unix password sync = Yes

        syslog = 0

log level = 1

        log file = /var/log/samba/log.%m

        max log size = 1000

        max xmit = 65535

        domain logons = Yes

        os level = 65

        preferred master = Yes

        dns proxy = No

        wins support = Yes

        panic action = /usr/share/samba/panic-action %d

        admin users = administrator

        create mask = 0774

        directory mask = 0754

        block size = 4096

veto files = /.DS_Store/Network Trash Folder/TheFindByContentFolder/TheVolumeSettingsFolder/Temporary Items/.TemporaryItems/.VolumeIcon.icns/Icon?/.FBCIndex/.FBCLockFolder/

        delete veto files = Yes

        ea support = Yes

        kernel oplocks = No

        oplocks = No

        level2 oplocks = No

        #vfs objects = streams_xattr

        null password = Yes

        guest account = nobody

        unix extensions = No

        printing = bsd

max protocol = SMB2

dfree cache time = 60

socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536

 

[share]

        path = /st/share

        username = nao

        write list = nao

        read only = No

        write cache size = 262144

        hide dot files = No 


samba 3.5.6 on ubuntu 10.04(Lucid) [Samba]

必要に迫られて、netatalk2.1.5が動いているファイルサーバーにsamba3.5.6をいれました。


# tar zxvf ./samba-3.5.6.tar.gz

# cd ./samba-3.5.6/source3

# ./autogen.sh
./autogen.sh: need autoconf 2.53 or later to build samba from GIT

あらま。
なにか入っていないといわれるので、、

# apt-get install autoconf
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.32-24-server linux-headers-2.6.32-24 linux-headers-2.6.32-26
  linux-headers-2.6.32-26-server
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  automake autotools-dev m4
Suggested packages:
  autoconf2.13 autoconf-archive gnu-standards autoconf-doc libtool gettext
The following NEW packages will be installed:
  autoconf automake autotools-dev m4
0 upgraded, 4 newly installed, 0 to remove and 29 not upgraded.
Need to get 1,730kB of archives.
After this operation, 5,005kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://jp.archive.ubuntu.com/ubuntu/ lucid/main m4 1.4.13-3 [286kB]
Get:2 http://jp.archive.ubuntu.com/ubuntu/ lucid/main autoconf 2.65-3ubuntu1 [772kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu/ lucid/main autotools-dev 20090611.1 [64.1kB]
Get:4 http://jp.archive.ubuntu.com/ubuntu/ lucid/main automake 1:1.11.1-1 [608kB]
Fetched 1,730kB in 1s (878kB/s)
Selecting previously deselected package m4.
(Reading database ... 97865 files and directories currently installed.)
Unpacking m4 (from .../archives/m4_1.4.13-3_amd64.deb) ...
Selecting previously deselected package autoconf.
Unpacking autoconf (from .../autoconf_2.65-3ubuntu1_all.deb) ...
Selecting previously deselected package autotools-dev.
Unpacking autotools-dev (from .../autotools-dev_20090611.1_all.deb) ...
Selecting previously deselected package automake.
Unpacking automake (from .../automake_1%3a1.11.1-1_all.deb) ...
Processing triggers for install-info ...
Processing triggers for man-db ...
Setting up m4 (1.4.13-3) ...
Setting up autoconf (2.65-3ubuntu1) ...
Setting up autotools-dev (20090611.1) ...
Setting up automake (1:1.11.1-1) ...
update-alternatives: using /usr/bin/automake-1.11 to provide /usr/bin/automake (automake) in auto mode.

# ./autogen.sh

# ./configure

# make

# make install

# /usr/local/samba/bin/smbstatus
/usr/local/samba/bin/smbstatus: error while loading shared libraries: libwbclient.so.0: cannot open shared object file: No such file or directory

おっと。またもや。
ということで、、、

# apt-get install libwbclient0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.32-24-server linux-headers-2.6.32-24 linux-headers-2.6.32-26
  linux-headers-2.6.32-26-server
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libtalloc2
The following NEW packages will be installed:
  libtalloc2 libwbclient0
0 upgraded, 2 newly installed, 0 to remove and 29 not upgraded.
Need to get 129kB of archives.
After this operation, 287kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://jp.archive.ubuntu.com/ubuntu/ lucid/main libtalloc2 2.0.1-1 [20.7kB]
Get:2 http://jp.archive.ubuntu.com/ubuntu/ lucid-updates/main libwbclient0 2:3.4.7~dfsg-1ubuntu3.2 [108kB]
Fetched 129kB in 0s (181kB/s)   
Selecting previously deselected package libtalloc2.
(Reading database ... 98154 files and directories currently installed.)
Unpacking libtalloc2 (from .../libtalloc2_2.0.1-1_amd64.deb) ...
Selecting previously deselected package libwbclient0.
Unpacking libwbclient0 (from .../libwbclient0_2%3a3.4.7~dfsg-1ubuntu3.2_amd64.deb) ...
Setting up libtalloc2 (2.0.1-1) ...

Setting up libwbclient0 (2:3.4.7~dfsg-1ubuntu3.2) ...

Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

ここで再度。

# /usr/local/samba/bin/smbstatus
params.c:OpenConfFile() - Unable to open configuration file "/usr/local/samba/lib/smb.conf":
No such file or directory
Can't load /usr/local/samba/lib/smb.conf - run testparm to debug it

はい、はい。なーんにもないわけですね。

# vi /usr/local/samba/lib/smb.conf

smb.confには

--

[global]

        dos charset = CP932

        display charset = UTF-8

        netbios name = FS-CIFS

        server string = %h Samba Server

        map to guest = Bad User

        obey pam restrictions = Yes

        pam password change = Yes

        passwd program = /usr/bin/passwd %u

        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

        unix password sync = Yes

        syslog = 0

        log file = /var/log/samba/log.%m

        max log size = 1000

        max xmit = 65535

        domain logons = Yes

        os level = 65

        preferred master = Yes

        dns proxy = No

        wins support = Yes

        panic action = /usr/share/samba/panic-action %d

        admin users = administrator

        create mask = 0754

        directory mask = 0754

        block size = 4096

        delete veto files = Yes

        ea support = Yes

        kernel oplocks = No

        oplocks = No

        level2 oplocks = No

        vfs objects = streams_xattr

 [nao-cifs]

        path = /st1/nao

        username = nao

        write list = nao

        read only = No

        write cache size = 262144

        hide dot files = No

--

こんな感じで。

それから、起動ファイルを作成。本当はupstartとか使うんでしたっけ??
よくわからないので、init.dでいきます。

# vi /etc/init.d/samba

ファイルにはこんな感じで。
--
#!/bin/sh

### BEGIN INIT INFO
# Provides:          samba
# Required-Start:    $network $local_fs $remote_fs
# Required-Stop:     $network $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Should-Start:      slapd
# Should-Stop:       slapd
# Short-Description: start Samba daemons (nmbd and smbd)
### END INIT INFO


# Defaults
RUN_MODE="daemons"

# Reads config file (will override defaults above)
[ -r /etc/default/samba ] && . /etc/default/samba

PIDDIR=/usr/local/samba/var/locks
NMBDPID=$PIDDIR/nmbd.pid
SMBDPID=$PIDDIR/smbd.pid

# clear conflicting settings from the environment
unset TMPDIR

# See if the daemons are there
test -x /usr/local/samba/sbin/nmbd -a -x /usr/local/samba/sbin/smbd || exit 0

. /lib/lsb/init-functions

case "$1" in
        start)
                log_daemon_msg "Starting Samba daemons"
                # Make sure we have our PIDDIR, even if it's on a tmpfs
                install -o root -g root -m 755 -d $PIDDIR

                NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
                if [ "$NMBD_DISABLED" != 'Yes' ]; then
                        log_progress_msg "nmbd"
                        if ! start-stop-daemon --start --quiet --oknodo --exec /usr/local/samba/sbin/nmbd -- -D
                        then
                                log_end_msg 1
                                exit 1
                        fi
                fi

                if [ "$RUN_MODE" != "inetd" ]; then
                        log_progress_msg "smbd"
                        if ! start-stop-daemon --start --quiet --oknodo --exec /usr/local/samba/sbin/smbd -- -D; then
                                log_end_msg 1
                                exit 1
                        fi
                fi

                log_end_msg 0
                ;;
        stop)
                log_daemon_msg "Stopping Samba daemons"
                log_progress_msg "nmbd"

                start-stop-daemon --stop --quiet --pidfile $NMBDPID
                # Wait a little and remove stale PID file
                sleep 1
                if [ -f $NMBDPID ] && ! ps h `cat $NMBDPID` > /dev/null
                then
                        # Stale PID file (nmbd was succesfully stopped),
                        # remove it (should be removed by nmbd itself IMHO.)
                        rm -f $NMBDPID
                fi

                if [ "$RUN_MODE" != "inetd" ]; then
                        log_progress_msg "smbd"
                        start-stop-daemon --stop --quiet --pidfile $SMBDPID
                        # Wait a little and remove stale PID file
                        sleep 1
                        if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
                        then
                                # Stale PID file (nmbd was succesfully stopped),
                                # remove it (should be removed by smbd itself IMHO.)
                                rm -f $SMBDPID
                        fi
                fi

                log_end_msg 0

                ;;
        reload)
                log_daemon_msg "Reloading /usr/local/samba/lib/smb.conf" "smbd only"

                start-stop-daemon --stop --signal HUP --pidfile $SMBDPID

                log_end_msg 0
                ;;
        restart|force-reload)
                $0 stop
                sleep 1
                $0 start
                ;;
        status)
                status="0"
                NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
                if [ "$NMBD_DISABLED" != "Yes" ]; then
                        status_of_proc -p $NMBDPID /usr/local/samba/sbin/nmbd nmbd || status=$?
                fi
                if [ "$RUN_MODE" != "inetd" ]; then
                        status_of_proc -p $SMBDPID /usr/local/samba/sbin/smbd smbd || status=$?
                fi
                if [ "$NMBD_DISABLED" = "Yes" -a "$RUN_MODE" = "inetd" ]; then
                        status="4"
                fi
                exit $status
                ;;
        *)
                echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}"
                exit 1
                ;;
esac

exit 0
--

実行権限つけて。
# chmod +x /etc/init.d/samba

シンボリックリンク作って。
# ln -s /etc/init.d/samba /etc/rc3.d/S20samba

# /etc/rc3.d/S20samba start
* Starting Samba daemons
   ...done.

ユーザー作ります。
# /usr/local/samba/bin/pdbedit -a nao
new password:
retype new password:

Unix username:        nao
NT username:          
Account Flags:        [U          ]
User SID:             S-1-5-21-542004972-3484054483-2600468714-1000
Primary Group SID:    S-1-5-21-542004972-3484054483-2600468714-513
Full Name:            
Home Directory:       \\fs-cifs\nao
HomeDir Drive:        
Logon Script:         
Profile Path:         \\fs-cifs\nao\profile
Domain:               WORKGROUP
Account desc:         
Workstations:         
Munged dial:          
Logon time:           0
Logoff time:          9223372036854775807 seconds since the Epoch
Kickoff time:         9223372036854775807 seconds since the Epoch
Password last set:    Fri, 28 Jan 2011 00:35:17 JST
Password can change:  Fri, 28 Jan 2011 00:35:17 JST
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Macなどからつなげてみます。
OK


ちなみに、

# /usr/local/samba/bin/smbstatus

Samba version 3.5.6
PID     Username      Group         Machine                        
-------------------------------------------------------------------
21195     nao           nao           macbookpro   (192.168.1.60)
17053     nao           nao           192.168.1.67 (192.168.1.67)

Service      pid     machine       Connected at
-------------------------------------------------------
nao-cifs    21195   macbookpro    Fri Jan 28 23:40:14 2011
nao-cifs    17053   192.168.1.67  Fri Jan 28 01:44:22 2011

Locked files:
Pid          Uid        DenyMode   Access      R/W        Oplock           SharePath   Name   Time
--------------------------------------------------------------------------------------------------


とりあえずファイルは読めるようになりました[晴れ]
拡張属性周りはまだノーチェック。


samba でシンボリックリンクをコピーできないにつける薬 [Samba]

Linuxサーバ内のディレクトリをごっそりファイルサーバ内にコピーしておいて、
それを一時的にMacにバックアップすると、それを再度ファイルサーバに戻す時、
sambaではシンボリックリンクのコピーに失敗する。

Mac側では、どうやら、エイリアスと認識されているようなのですが、
そのシンボリックリンクをコピー仕様とすると「エラーコード 36」に遭遇する。

しばらく対処不能だったのですが・・・

smb.confで

unix extensions = no

とすることで、いちおうコピーできるようになった模様。
ちなみに、netatalkではもともとちゃんとコピーできます。

うん、よかった[ぴかぴか(新しい)]



samba 3.5.2 を試してみる。 [Samba]


netatalkを2.1beta2に上げたので、ついでにsambaも3.5.2に上げておきます。

といってもこれまた、3.5.1の時と同じです。



$ tar zxvf ./samba-3.5.2.tar.gz

$ cd ./samba-3.5.2/source3

$ ./autogen.sh

$ ./configure

$ make

# make install

# /etc/init.d/samba restart

いちおうバージョンの確認。

# /usr/local/samba/bin/smbstatus

Samba version 3.5.2
PID     Username      Group         Machine                        
-------------------------------------------------------------------

Service      pid     machine       Connected at
-------------------------------------------------------

No locked files


はい、OKです[るんるん]

samba でちゃんと拡張属性を有効にできたかも [Samba]

ながらく、放っておいたのですが、ちょっと気が向いて、
smb.confさわっていたら拡張属性を "正しく" 有効にできたかも[exclamation&question]
いうことで、メモっておきます。

vfs objects = xattr_tdb
から

 vfs objects = streams_xattr

へ変更してから、「エラーコード -36」問題が発生し、

Macからsambaでファイルサーバへのファイルコピーができないで

いたのですが、、

 

ea support = No

から

ea support = Yes

へ変更したところ、「エラーコード -36」が現れず、

ファイルのコピーができるようになりました。

 

Macからコピー後のファイルの拡張属性を確認しても、ちゃんと

拡張属性は保存されていますので、とりあえずよし[るんるん]として、

しばらく、これでようすをみます。



MacOS : 10.6.3(10.6.2から上げたばかりですが、10.6.2だと、どうなっていたのかしら。)

Samba : 3.5.1


smb.conf  -----------


[global]

        dos charset = CP932

        display charset = UTF-8

        netbios name = SS-CIFS

        server string = %h Samba Server

        map to guest = Bad User

        obey pam restrictions = Yes

        pam password change = Yes

        passwd program = /usr/bin/passwd %u

        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

        unix password sync = Yes

        syslog = 0

        log file = /var/log/samba/log.%m

        max log size = 1000

        max xmit = 65535

        domain logons = Yes

        os level = 65

        preferred master = Yes

        dns proxy = No

        wins support = Yes

        panic action = /usr/share/samba/panic-action %d

        admin users = administrator

        create mask = 0754

        directory mask = 0754

        block size = 4096

        delete veto files = Yes

        ea support = Yes

        kernel oplocks = No

        oplocks = No

        level2 oplocks = No

        vfs objects = streams_xattr

 

[nao-cifs]

        path = /st1/nao

        username = nao

        write list = nao

        read only = No

        write cache size = 262144

        hide dot files = No

 -----------------------



samba 3.5.1 を試してみる。 [Samba]

sambaとMacの「エラーコード -36」問題で、sambaのバージョンを
3.4.0から最新の3.5.1に上げるとどうなるか試してみました。

$ tar zxvf /usr/local/src/samba-3.5.1.tar.gz
$ cd /usr/local/src/samba-3.5.1/source3
$ ./autogen.sh
$ ./configure
$ make
# make install

samba 3.4.0の設定ファイルを3.5.1の設定ファイルに流用します。
# cp /etc/samba/smb.conf /usr/local/samba/lib/

いろいろとファイルの場所が違うので 起動ファイルを書き換えます。

書き換えた /etc/init.d/samba

--------------------------------------------ここから
#!/bin/sh

### BEGIN INIT INFO
# Provides:          samba
# Required-Start:    $network $local_fs $remote_fs
# Required-Stop:     $network $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Should-Start:      slapd
# Should-Stop:       slapd
# Short-Description: start Samba daemons (nmbd and smbd)
### END INIT INFO


# Defaults
RUN_MODE="daemons"

# Reads config file (will override defaults above)
[ -r /etc/default/samba ] && . /etc/default/samba

PIDDIR=/usr/local/samba/var/locks
NMBDPID=$PIDDIR/nmbd.pid
SMBDPID=$PIDDIR/smbd.pid

# clear conflicting settings from the environment
unset TMPDIR

# See if the daemons are there
test -x /usr/local/samba/sbin/nmbd -a -x /usr/local/samba/sbin/smbd || exit 0

. /lib/lsb/init-functions

case "$1" in
        start)
                log_daemon_msg "Starting Samba daemons"
                # Make sure we have our PIDDIR, even if it's on a tmpfs
                install -o root -g root -m 755 -d $PIDDIR

                NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
                if [ "$NMBD_DISABLED" != 'Yes' ]; then
                        log_progress_msg "nmbd"
                        if ! start-stop-daemon --start --quiet --oknodo --exec /usr/local/samba/sbin/nmbd -- -D
                        then
                                log_end_msg 1
                                exit 1
                        fi
                fi

                if [ "$RUN_MODE" != "inetd" ]; then
                        log_progress_msg "smbd"
                        if ! start-stop-daemon --start --quiet --oknodo --exec /usr/local/samba/sbin/smbd -- -D; then
                                log_end_msg 1
                                exit 1
                        fi
                fi

                log_end_msg 0
                ;;
        stop)
                log_daemon_msg "Stopping Samba daemons"
                log_progress_msg "nmbd"

                start-stop-daemon --stop --quiet --pidfile $NMBDPID
                # Wait a little and remove stale PID file
                sleep 1
                if [ -f $NMBDPID ] && ! ps h `cat $NMBDPID` > /dev/null
                then
                        # Stale PID file (nmbd was succesfully stopped),
                        # remove it (should be removed by nmbd itself IMHO.)
                        rm -f $NMBDPID
                fi

                if [ "$RUN_MODE" != "inetd" ]; then
                        log_progress_msg "smbd"
                        start-stop-daemon --stop --quiet --pidfile $SMBDPID
                        # Wait a little and remove stale PID file
                        sleep 1
                        if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
                        then
                                # Stale PID file (nmbd was succesfully stopped),
                                # remove it (should be removed by smbd itself IMHO.)
                                rm -f $SMBDPID
                        fi
                fi

                log_end_msg 0

                ;;
        reload)
                log_daemon_msg "Reloading /usr/local/samba/lib/smb.conf" "smbd only"

                start-stop-daemon --stop --signal HUP --pidfile $SMBDPID

                log_end_msg 0
                ;;
        restart|force-reload)
                $0 stop
                sleep 1
                $0 start
                ;;
        status)
                status="0"
                NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
                if [ "$NMBD_DISABLED" != "Yes" ]; then
                        status_of_proc -p $NMBDPID /usr/local/samba/sbin/nmbd nmbd || status=$?
                fi
                if [ "$RUN_MODE" != "inetd" ]; then
                        status_of_proc -p $SMBDPID /usr/local/samba/sbin/smbd smbd || status=$?
                fi
                if [ "$NMBD_DISABLED" = "Yes" -a "$RUN_MODE" = "inetd" ]; then
                        status="4"
                fi
                exit $status
                ;;
        *)
                echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}"
                exit 1
                ;;
esac

exit 0
--------------------------------------------ここまで

そして、
Finderからファイルサーバーにコピーすると。。。
こんどは
スクリーンショット(2010-03-11 2.52.32).png
一部の項目へのアクセス権がないため、操作は完了できません。

と。。。

EA対応していないnetatalkで出るエラーと同じですね。


さて、
samba3.4.0の時には、エラーコード -36で、拡張属性付き0byteのファイルが
できあがっていたのですが、今度はデータフォークもコピーされています。

そして、
このエラーの出たファイルをgetfattrすると、、

$ getfattr -d test.txt 
# file: test.txt
user.DosStream.AFP_AfpInfo:$DATA=0sQUZQAAAAAQAAAAAAAAAAgGJyb2t
NQUNTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
user.DosStream.com.apple.metadata\357\200\242kMDItemFinderComment:
$DATA=0sYnBsaXN0MDBWdGV0ZXRlCAAAAAAAAAEBAAAAAAAAAAEAAAAAAA
AAAAAAAAAAAAAPAA==

一方、ターミナルからコピーしたファイルをgetfatterすると
 getfattr -d test.txt 
# file: test.txt
user.DosStream.com.apple.metadata\357\200\242kMDItemFinderComment:
$DATA=0sYnBsaXN0MDBWdGV0ZXRlCAAAAAAAAAEBAAAAAAAAAAEAAAAAAA
AAAAAAAAAAAAAPAA==

一部欠損してそうです[たらーっ(汗)]

状況はかわりましたが、エラーが出るという点では相変わらずです[バッド(下向き矢印)]


いまだに エラーコード -36 。。。getfattrしてみると・・・ [Samba]

代替データストリーム書き込むために、smb.conf に

vfs objects = streams_xattr

を設定したsamba(3.4.0)サーバへMac OSX(Snow Leopard)から
接続し、Finderからファイルをコピーしようとすると、

スクリーンショット(2010-03-03 23.09.04).png
エラーコード -36 が出てコピーできない件で
# ファイル本体は0byteでパーミッション644です。

では、エラーの出たファイルにgetfattrするとどうなるか?
ですが。。

$ getfattr -d test.txt 
# file: test.txt
user.DosStream.AFP_AfpInfo:$DATA=0sAA==

なんとなく中途半端な感じで拡張属性が書き込まれている感じです。

Finderからファイルをコピーするとエラーとなりますが、
ターミナルからコピーするとエラーがでないので、
ターミナルからコピーしたファイルでgetfattrすると、、

$ getfattr -d test.txt 
# file: test.txt
user.DosStream.com.apple.TextEncoding:$DATA="utf-8;134217984\000"
user.DosStream.com.apple.metadata\357\200\242kMDItemFinderComment:
$DATA=0sYnBsaXN0MDBWdGV0ZXRlCAAAAAAAAAEBAAAAAAAAAAEAAAAAAAA
AAAAAAAAAAAAPAA==

となり、これは、ファイルサーバをnetatalkで共有し、
Mac OSXから接続し、ファイルをコピーした場合の拡張属性の
情報と一致していそうです。

 getfattr -d test.txt 
# file: test.txt
user.com.apple.TextEncoding="utf-8;134217984"
user.com.apple.metadata:kMDItemFinderComment=0sYnBsaXN0MDBWdGV0
ZXRlCAAAAAAAAAEBAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAP

しばらく謎がつづきそうです。。。[たらーっ(汗)]

たぶん原因判明。Finderでファイルをコピーできない件について。 [Samba]

かなり試行錯誤したといいますか、原因と現象の切り分けがヘタで時間が
かかってしまいました。

どうやら、smb.conf で

vfs objects = streams_xattr

を設定すると

エラーコード -36を吐いて、Finderからのコピーに失敗することがあるようです。

ターミナルからのコピーはできるので、Mac側の問題かと思い、MacBookProは
クリーンインストールするハメになったり、さんざんでしたがとりあえず
一件落着です[たらーっ(汗)]

vfs objects = streams_xattr
SnowLeopardのFinderで使われているコピーのAPIかなにかと
相性がよくなかったのでしょうか。
なんとなく、問題はSnowLeopardくさいのですが。。。

とりあえずは、Samba側の設定でごまかして使っていきます。

しばらく、

vfs objects = streams_xattr

をコメントアウトして、様子をみてみま〜す[るんるん]

Sambaでも拡張属性を有効にする の巻 [Samba]

netatalk 2.1beta1では拡張属性(EA)に対応しているため、
マウント時のオプションで user_xattr を付加すれば、拡張属性が
利用できました。

そこで、ついでにSamba(3.4.0)でも試してみます。

[global]セクションに以下を追加します。

ea support = yes
store dos attributes = yes

これでSambaを再起動します。

iMacからCIFS(by Samba)でファイルサーバにtest.txtをコピーします。

で、
# getfattr -d test.txt
しますと、

# file: test.txt
user.DOSATTRIB="0x0"

と帰ってきますので、有効になってそうです。

そして、コピー先の同じディレクトリに
._test.txt
も出来ています。


さて、WindowdのPCからコピーするとどうなるのでしょうか?
WindowsのPCを引っ張り出すのが面倒なので、試していません[たらーっ(汗)]

2010/4/2 追記
その後、いろいろあり、現時点で正しそうな設定はこちら

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。