fusefs-smbnetfs の試用2006年09月08日 11時51分21秒

Filesystem in Userspaceによると FUSE とは、ユーザ空間内で動くファイルシステムの実装だ。Google SoC 2005 からFUSE for FreeBSD などでは賛否両論だとの事だが、私は基本的に歓迎だ。新しい物をサポートしなくてはいけなくなり、どんどんカーネルが肥大化するのに有効だと思う。カーネルモジュールで遅延読み込み出来るから、カーネルの大きさ自体は大した問題ではない。一番厄介なのが、中途半端に実装されている物が、増えることだろうか。それだったら、既に広く使われているライブラリを読み込んで、有効に活用すればいいと思う。ただし、カーネル空間に何でもかんでも読み込むと、安全性などの問題は出てくるだろうが。

Fuse for FreeBSD に fusefs-kmod の移植について書いてある。FreeBSD らしく ports からカーネルモジュールとして、読み込まれるようになっている。

既にたくさんの fs が FUSE を利用して実装されている。FUSEWiki にて、それらの fs が辿れる。FreeBSD の ports/sysutils にあるのは、本当にこの中のごく一部だ。

fusefs-smbnetfs に関する資料は無いに等しい。SMBNetFS

SMBNetFS is a Linux/FreeBSD filesystem that allow you to use samba/microsoft network in the same manner as the network neighborhood in Microsoft Windows.
とあったぐらいだ。

/var/db/pkg/fusefs-smbnetfs/+DISPLAY を元に、一般ユーザのアカウントで試したら、


%smbnetfs mountpoint
SMBNetFs-0.3.6

fuse: failed to open fuse device: Permission denied

と出てしまった。+DISPLAY を読んだときには、何も設定しなくてもユーザが mount 出来るような印象を受けたがそうでは無いらしい。

root になって試してみると、動作した。


# sysctl vfs.usermount=1
# mkdir ~/.smb
# cp /usr/local/smb.conf /usr/local/share/doc/smbnetfs/smbnetfs.conf ~/.
smb/
# mkdir /mnt/smbnetfs
# smbnetfs /mnt/smbnetfs
SMBNetFs-0.3.6
# cd /mnt/smbnetfs
# ls
MYGROUP
# cd MYGROUP
FREEBSD
# ls
netlogon        tmp

samba で netlogon と tmp を有効にして試してみた。/mnt/smbnetfs 以下から、Windows のエクスプローラで、覗くようにワークグループと機体名があり、その下に各ディレクトリが見られた。認証が必要なディレクトリはそのままでは見られないらしい。

/usr/local/share/doc/smbnetfs/smbnetfs.conf を覗くと、


#---------------------------------------------------------------------
# Set auth information for samba network resource. If share name is
# omited then the auth data applied to all computer "computer" shares.
# Omit "computer/share" to specify default auth patameters.
#
# PS: You can use "cd mountpoint/domain:user:password@computer"
# command to enter to remote computer as domain/workgroup
# "domain_or_workgroup" user "user" with password "password".
#
# Syntax:
#       auth [computer[/share]] [domain_or_workgroup/]user password
#
# Default:
#       auth "user_login_name" ""
#
#---------------------------------------------------------------------
#auth                   "guest" ""

# read auth data from ~/.smb/smbnetfs.auth
include                 "smbnetfs.auth"

折角なので試してみる。auth を smbnetfs.conf に追加してみた。


# smbnetfs /mnt/smb
SMBNetFs-0.3.6

1769->ReadConfigFile: Error: Insecure config file permission.
Can't apply 'auth' directive.
Run 'chmod 600 smbnetfs.conf' to fix it.
# umount /mnt/smb
# chmod 600 ~/.smb/smbnetfs.conf 
# smbnetfs /mnt/smb
# cd /mnt/smb/MYGROUP/FREEBSD
# ls
netlogon        tmp
# cd uyota
# pwd: .: No such file or directory
# ls
ls: .: Permission denied

もう一度、auth を取り払って試したところ、cd uyota は出来たが、ls も pwd も動かないのは一緒だった。また、文字コードも正しく扱えていない様な雰囲気だった。まだまだ開発途中らしい。

前回