This document shows how to mount an AWS S3 bucket on Mac OS X using goofyfs.
The first three steps illustrate how to use goofys
- Install goofyfs via brew
brew cask install osxfuse
brew install goofys
- Create an empty directory as a mount point for the S3 bucket
mkdir -p ~/drat
- Mount a prefix of an S3 bucket (note the colon)
goofys com-dnli-ngs-test:drat ~/drat
- When you are done, unmount the bucket
umount ~/drat
ls ~/drat # empty
The following steps are only included to highlight the functionality of goofys:
- Verify that files are sync'ed to S3
echo "Test" > ~/drat/test.tmp
aws s3 cp s3://com-dnli-ngs-test/drat/test.tmp -
echo "Test 2" > ~/drat/test.tmp
aws s3 cp s3://com-dnli-ngs-test/drat/test.tmp -
- Unmount the bucket - and the local directory is empty
umount ~/drat
ls ~/drat # empty
aws s3 ls s3://com-dnli-ngs-test/drat/ # not empty
- Re-mount the bucket - and the files are back
goofys com-dnli-ngs-test:drat ~/drat
ls ~/drat # not empty
- Remove local files - and they are also removed from S3
rm ~/drat/test.tmp
aws s3 ls s3://com-dnli-ngs-test/drat/ # empty
- Unmount the bucket when you are done
umount ~/drat
ls ~/drat # empty