yas3fs
yas3fs copied to clipboard
Support standard mount -o option format
It is possible to mount fuse filesystems from fstab.
For example:
yas3fs#s3://a-bucket /srv/mountpoint fuse defaults 0 0
This works by calling mount.fuse which in turn runs the program before the #
sign in the following manner:
yas3fs s3://a-bucket /srv/mountpoint -o rw,suid,dev
There doesn't appear to be a way to disable the addition of options, and yas3fs fails with the unknown options.
I wrote a wrapper that I am asking for permission from my client to submit to you, but I think this would be better within the main program.
Thank you. Jeff
Hi, unfortunately yas3fs doesn't support fstab syntax, my advice is to use a script to mount at boot, there is a sample upstart script on stack overflow: http://stackoverflow.com/questions/19172783/how-can-i-make-a-working-upstart-job-with-yas3fs
maybe it's time for configuration files so it can be yas3fs#/path/to/mountconfiguration.cfg
Should we still use that script, or add yas3fs to rc.local?
+1 Let's make this happen :)
I don't know what solution implies more work than the other, but I would definitely prefer to get a standard fstab up than a custom configuration file with its own syntax along with enabling a init script. Even better: fstab will work on every Linux distribution. Not the case of an init script. If there is no need to reinvent the wheel, I'm all for it ;)
+1 Any progress on this enhancement?
Any progress on this? I'm looking into installing this on my NAS.
I've added /etc/fstab support. While my pull request is checking, you may use the version from my repo: https://github.com/jazzl0ver/yas3fs
Saw it was merged.
I suggest an alternative (incompatible) mounting script (mount.yas3fs);
#!/usr/bin/env bash
# extract the last part after '#' in 'yas3fs#bucket' string
s3bucket=${1##*#}
localpath=$2
params=()
# parse the fstab options as long parameters to yas3fs
eval "for w in ${4//,/ }; do params+=(\"--\$w\"); done"
# remove parameters to fuse
delete=( "--_netdev" "--allow_other" "--default_permissions" "--rw" )
for target in "${delete[@]}"
do
# echo finding "$target" in "${#params[@]}" values
for i in "${!params[@]}"
do
# echo checking "$i" "${params[i]}"
if [ "$target" = "${params[i]}" ]
then
# echo unsetting "${params[i]}"
unset 'params[i]'
# else
# echo "${params[i]}" is not "$target"
fi
done
done
yas3fs "s3://${s3bucket}" "${localpath}" ${params[*]}
Or maybe since there's a hard dependency on python, rewrite the shell script in python with a #!/usr/bin/env python
shebang.