Mount S3 on Ubuntu with goofys

Version confirmation

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.5 LTS"

install goofys

It seems that it is possible to build a Golang environment and enter it from the source. However, when I tried to reproduce it, I found that Official README.md

$ go get github.com/kahing/goofys

I got stuck at. Since the update has stopped around April 2020, we will drop the binary as it is.

Drop the pre-build binary file,

$ mv path-to-pre-build-binary-of-goofys ~/.local/bin
$ chmod +x ~/.local/bin
$ goofys
Error: goofys takes exactly two arguments.

NAME:
   goofys - Mount an S3 bucket locally

USAGE:
   goofys [global options] bucket[:prefix] mountpoint

VERSION:
   0.24.0-45b8d78375af1b24604439d2e60c567654bcdf88

GLOBAL OPTIONS:
   -o value            Additional system-specific mount options. Be careful!
   --cache value       Directory to use for data cache. Requires catfs and `-o allow_other'. Can also pass in other catfs options (ex: --cache "--free:10%:$HOME/cache") (default: off)
   --dir-mode value    Permission bits for directories. (default: 0755) (default: 493)
   --file-mode value   Permission bits for files. (default: 0644) (default: 420)
   --uid value         UID owner of all inodes. (default: 1000)
   --gid value         GID owner of all inodes. (default: 1000)
   --endpoint value    The non-AWS endpoint to connect to. Possible values: http://127.0.0.1:8081/
   --profile value     Use a named profile from $HOME/.aws/credentials instead of "default"
   --use-content-type  Set Content-Type according to file extension and /etc/mime.types (default: off)
   --subdomain         Enable subdomain mode of S3

TUNING OPTIONS:
   --cheap                 Reduce S3 operation costs at the expense of some performance (default: off)
   --no-implicit-dir       Assume all directory objects ("dir/") exist (default: off)
   --stat-cache-ttl value  How long to cache StatObject results and inode attributes. (default: 1m0s)
   --type-cache-ttl value  How long to cache name -> file/dir mappings in directory inodes. (default: 1m0s)
   --http-timeout value    Set the timeout on HTTP requests to S3 (default: 30s)

AWS S3 OPTIONS:
   --region value         The region to connect to. Usually this is auto-detected. Possible values: us-east-1, us-west-1, us-west-2, eu-west-1, eu-central-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, sa-east-1, cn-north-1 (default: "us-east-1")
   --requester-pays       Whether to allow access to requester-pays buckets (default: off)
   --storage-class value  The type of storage to use when writing objects. Possible values: REDUCED_REDUNDANCY, STANDARD, STANDARD_IA. (default: "STANDARD")
   --sse                  Enable basic server-side encryption at rest (SSE-S3) in S3 for all writes (default: off)
   --sse-kms key-id       Enable KMS encryption (SSE-KMS) for all writes using this particular KMS key-id. Leave blank to Use the account's CMK - customer master key (default: off)
   --sse-c value          Enable server-side encryption using this base64-encoded key (default: off)
   --acl value            The canned ACL to apply to the object. Possible values: private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control (default: off)

MISC OPTIONS:
   --help, -h     Print this help text and exit successfully.
   --debug_fuse   Enable fuse-related debugging output.
   --debug_s3     Enable S3-related debugging output.
   -f             Run goofys in foreground.
   --version, -v  print the version

Check AWS Credentials

$ cat ~/.aws/credentials
[default]
aws_access_key_id = AKID1234567890
aws_secret_access_key = MY-SECRET-KEY

Of course, you need to have permission for the S3 bucket you want to mount on this account.

S3 bucket mount

$ goofys <bucket> <mountpoint>

reference

Recommended Posts

Mount S3 on Ubuntu with goofys
Draw Japanese with matplotlib on Ubuntu
Mount and format Disk on Ubuntu on GCP.
Try server-side encryption on S3 with boto3
Shebang on Ubuntu 20.04
I can't install Dask with pip on Ubuntu
Build python environment with pyenv on EC2 (ubuntu)
View images on S3 with API Gateway + Lambda
[0] TensorFlow-GPU environment construction built with Anaconda on Ubuntu
Play with your Ubuntu desktop on your Raspberry Pi 4
Reverse proxy with Apache 2.4 on Ubuntu 19.10 Eoan Ermine
Mount a directory on another server with sshfs
Install TensorFlow on Ubuntu
Install PySide2 on Ubuntu
I made a Python3 environment on Ubuntu with direnv.
Install JModelica on Ubuntu
Troublesome story when using Python3 with VScode on ubuntu
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python
S3 uploader with boto
build Python on Ubuntu
Install Python 3.3 on Ubuntu 12.04
Dealing with pip and related installation errors on Ubuntu 18.04
Installing pyenv on ubuntu 16.04
Install Theano on Ubuntu 12.04
Install angr on Ubuntu 18.04
Install pip / pip3 on Ubuntu
Problems with `visudo` not working on Ubuntu 18.04 and its workaround
Using X11 with ubuntu18.04 (C)
Set up Python 3.4 on Ubuntu
I installed tensorRT on Ubuntu 18.04
Run Jupyter on Ubuntu on Windows
Use matplotlib on Ubuntu 12 & Python
SoftwareRAID 0 on SereneLinux (Ubuntu 18.04 Desktop)
[S3] CRUD with S3 using Python [Python]
I installed ROS on Ubuntu 18.04
USB Wifi on Ubuntu 20.04LTS
Set matplotlib font on ubuntu
S3 operation with python boto3
Put Python 3.x on Ubuntu
Build python3 environment with ubuntu 16.04
Rebuild kernel on Ubuntu 20.04 (on Azure)
Operate ubuntu on VScode (windows10)
Create command shortcuts on Ubuntu 16.04
Install GoLand IDE on Ubuntu
Display GUI messages on Ubuntu
Install OpenCV on Ubuntu + python
wsl Install PostgreSQL on Ubuntu 18.04
Introducing TensorFlow on Ubuntu + Python 2.7
[ROS] Install ROS (melodic) on Ubuntu (18.04)
Install Caffe on Ubuntu 14.04 (GPU)
Mount google drive with google-drive-ocamlfuse
Install Docker on WSL Ubuntu 18.04
Blogging with Pelican on Windows
Move CloudWatch logs to S3 on a regular basis with Lambda