documents >
User's Manual >
samba/gfarmfs-fuse
GfarmFS-FUSE + Samba
English | Japanese
Another solution: Gfarm syscall-hooking library + Samba is here
1. Summary
You can access to Gfarm filesystem via GfarmFS-FUSE via Samba from Windows.
Configurations
- on Linux (Samba) machine
- You can access to the Gfarm environment which you will use.
- FUSE is installed. (= environment of Linux kernel 2.4 or 2.6)
- 'user_allow_other' is set in /etc/fuse.conf.
- GfarmFS-FUSE is installed. You can run the 'gfarmfs' command.
- Samba server (smbd) is running.
- You can access via Samba to the mountpoint which you mounted using gfarmfs.
- on Windows machine
- You can access to the Samba server mentioned above.
Softwares
2. Japanese Filename
See GfarmFS-FUSE + Samba in Japanese
3. Samba Configuration
Setting shares configuration in smb.conf.
Adding [homes] or 'Path' in [Section Name] for publishing the mountpoint by GfarmFS-FUSE.
This mountpoint is ~/.../mountpoint or ~/mountpoint or 'Path'/.../mountpoint or 'Path'/mountpoint.
And, adding the Samba member corresponding to the unix user (for this purpose).
See Samba documentations about the details of Samba configurations.
4. FUSE Configuration
If you will access to GfarmFS-FUSE via Samba when FUSE version 2.3.0 (or later) is installed, you should set the following.
/etc/fuse.conf
This setting is that normal users can use the options of -o allow_root and -o allow_other. (See README of FUSE)
5. Mount by GfarmFS-FUSE
Please check whether you can access to Gfarm with 'gfhost -l'.
Run the 'gfarmfs' to mount on the Samba server.
(See documentations of Gfarm and GfarmFS-FUSE about these details.)
$ gfarmfs [GfarmFS options] mountpoint [FUSE options]
|
This mountpoint must be published by Samba. (See section 3)
Attention
You shall not set '-o allow_other' of FUSE option.
If '-o allow_other' is set, other normal users can access to your Gfarm environment via the mountpoint by your authority.
6. Access to Samba from Windows
You access to the Samba and you open the share folder and the mountpoint by gfarmfs.
And, you can assign this share folder to a network drive.
7. Example of Samba Configuration and Application
This is an example that the mountpoint for gfarmfs is automatically mounted
, if you connect to the share folder named 'Gfarm'.
- A name of the share folder is 'Gfarm'.
- The mountpoint is ~/samba-fuse for gfarmfs, and publishing ~/samba-fuse of any users.
- It is necessary for ~/samba-fuse directory to be created.
- The mountpoint is automatically mounted by gfarmfs when you connect to the share folder.
- But you are limited when you use sharedsecret authentication of Gfarm on the home directories shared by NFS.
- Or if you use GSI authentication, you must run the grid-proxy-init on the Samba machine.
- If you fail to mount the mountpoint, you fail to access to the share folder too.
- The mountpoint is automatically unmount in disconnected.
[Gfarm]
path = %H/samba-fuse
exec = /usr/local/bin/gfarmfsmount.sh %P
preexec close = Yes
postexec = /usr/local/bin/gfarmfsumount.sh %P
read only = no
|
gfarmfsmount.sh
#! /bin/sh
GFARMFS=/usr/local/bin/gfarmfs
USERNAME=`/usr/bin/whoami`
LOGFILE=/tmp/gfarmfs-$USERNAME.log
#ARCH="-a i686-FC3-linux"
ALLOWROOT="-o allow_root"
GREP=/bin/grep
DF=/bin/df
TAIL=/usr/bin/tail
DATE=/bin/date
# for fusermount
export PATH=$PATH:/usr/local/bin
#####
if [ $# -ne 1 ]; then
echo "usage: `basename $0` MOUNTPOINT"
exit 1
fi
if [ ! -f $LOGFILE ]; then
touch $LOGFILE
chmod 600 $LOGFILE
fi
DATE=`$DATE '+%Y%m%d-%H%M%S'`
MOUNTP=$1
($DF -t fuse $MOUNTP | $TAIL +2 | $GREP gfarmfs > /dev/null && \
(echo $DATE MOUNT:ALREADY $MOUNTP) || \
($GFARMFS $ARCH -l -s $MOUNTP $ALLOWROOT && \
echo $DATE MOUNT:SUCCESS $MOUNTP || ! echo $DATE MOUNT:FAIL $MOUNTP)
) >> $LOGFILE 2>&1
exit $?
|
gfarmfsumount.sh
#! /bin/sh
FUSERMOUNT=/usr/local/bin/fusermount
USERNAME=`/usr/bin/whoami`
LOGFILE=/tmp/gfarmfs-$USERNAME.log
DATE=/bin/date
SLEEP=/bin/sleep
#####
if [ $# -ne 1 ]; then
echo "usage: `basename $0` MOUNTPOINT"
exit 1
fi
if [ ! -f $LOGFILE ]; then
touch $LOGFILE
chmod 600 $LOGFILE
fi
DATE=`date '+%Y%m%d-%H%M%S'`
MOUNTP=$1
(cd /; $SLEEP 1;
$FUSERMOUNT -u $MOUNTP && \
echo $DATE UMOUNT:SUCCESS $MOUNTP || \
echo $DATE UMOUNT:FAIL $MOUNTP
) >> $LOGFILE 2>&1 &
|
8. comment
If you have any question or comment, feel free to send email to
datafarm@apgrid.org.
Grid Datafarm <datafarm@apgrid.org>