yas3fs icon indicating copy to clipboard operation
yas3fs copied to clipboard

Support standard mount -o option format

Open jstrunk opened this issue 10 years ago • 9 comments

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

jstrunk avatar Jul 31 '14 15:07 jstrunk

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

danilop avatar Aug 01 '14 07:08 danilop

maybe it's time for configuration files so it can be yas3fs#/path/to/mountconfiguration.cfg

ewah avatar Nov 17 '14 16:11 ewah

Should we still use that script, or add yas3fs to rc.local?

Jaykah avatar Mar 05 '15 22:03 Jaykah

+1 Let's make this happen :)

prologic avatar May 27 '15 00:05 prologic

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 ;)

fdutheil avatar Oct 08 '15 09:10 fdutheil

+1 Any progress on this enhancement?

lbadger avatar Apr 19 '16 15:04 lbadger

Any progress on this? I'm looking into installing this on my NAS.

computergeek125 avatar Oct 17 '17 00:10 computergeek125

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

jazzl0ver avatar Mar 21 '18 16:03 jazzl0ver

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.

YoungCP avatar Apr 23 '18 02:04 YoungCP