亚马逊弹性文件系统的公用事业
Amazon utilities for Amazon Elastic File System (EFS) and Amazon S3 Files.
efs-utils is an open-source toolkit for mounting and managing Amazon EFS and S3 file systems (S3 support added in version 3.0.0). The package includes mount helpers that simplify mounting file systems and enable Amazon CloudWatch monitoring your mount status.
Amazon Elastic File System (EFS) is designed to provide serverless, fully elastic file storage that lets you share file data without provisioning or managing storage capacity and performance. To learn more, see Amazon EFS.
Amazon S3 Files is a shared file system that connects any AWS compute directly with your data in Amazon S3. It provides fast, direct access to all of your S3 data as files with full file system semantics and low-latency performance, without your data ever leaving S3. File-based applications, agents, and teams can access and work with S3 data as a file system using the tools they already depend on. To learn more, see S3 Files.
Efs-utils for EFS and S3 file systems are supported on the following Linux distributions:
| Distribution | Package Type | init System |
|---|---|---|
| Amazon Linux 2 | rpm |
systemd |
| Amazon Linux 2023 | rpm |
systemd |
| RHEL 8 | rpm |
systemd |
| RHEL 9 | rpm |
systemd |
| RHEL 10 | rpm |
systemd |
| Ubuntu 20.04 | deb |
systemd |
| Ubuntu 22.04 | deb |
systemd |
| Ubuntu 24.04 | deb |
systemd |
| OpenSUSE Leap | rpm |
systemd |
| SLES 15 | rpm |
systemd |
Efs-utils for EFS file systems is supported on the following macOS distributions:
| Distribution | init System |
|---|---|
| macOS Ventura | launchd |
| macOS Sonoma | launchd |
| macOS Sequoia | launchd |
| macOS Tahoe | launchd |
For Amazon Linux users, the simplest way to install efs-utils is from Amazon's repositories:
sudo yum -y install amazon-efs-utilsYou can use AWS Systems Manager Distributor to automatically install or update amazon-efs-utils. For more information, see Using AWS Systems Manager to automatically install or update Amazon EFS clients. Prerequisites for using AWS Systems Manager Distributor to install or update amazon-efs-utils include:
AWS Systems Manager agent is installed on the distribution (pre-installed on Amazon Linux and Ubuntu; for other distributions, see install AWS Systems Manager agent on Linux EC2 instance).
Instance is attached with IAM role with AWS managed policy AmazonElasticFileSystemsUtils, this policy will enable your instance to be managed by
AWS Systems Manager agent, also it contains permissions to support specific features.
Building from source requires Rust 1.91.1+, Cargo, Go 1.17.13+, CMake 3.0+, GCC/G++, and Perl. See INSTALL.md for detailed build instructions for your distribution.
For EC2 Mac instances running macOS Tahoe, Sonoma, or Ventura, you can install amazon-efs-utils from the homebrew-aws repository. This is supported on only EC2 instances, not for local Mac computers. macOS is unsupported for S3 file systems.
brew install amazon-efs-utilsThis installs amazon-efs-utils in:
/usr/local/Cellar/amazon-efs-utils/opt/homebrew/Cellar/amazon-efs-utilsFollow the instructions in caveats when using efs-utils on EC2 Mac instance for the first time. To check the package caveats run the command below:
brew info amazon-efs-utilsefs-utils includes two mount helper utilities: mount.efs for EFS file systems and mount.s3files for S3 file systems (v3.0.0+). Both simplify mounting and enhance file system performance. They also launch a proxy process that forwards NFS traffic from the kernel's NFS client to the file system. This proxy handles TLS encryption and improves throughput performance.
To mount your file system with the recommended default options, run:
# For an EFS file system
sudo mount -t efs file-system-id efs-mount-point/
# For an S3 file system
sudo mount -t s3files file-system-id s3files-mount-point/To mount a file system to a specific mount target, run:
# For an EFS file system
sudo mount -t efs -o mounttargetip=mount-target-ip-address file-system-id efs-mount-point/
# For an S3 file system
sudo mount -t s3files -o mounttargetip=mount-target-ip-address file-system-id s3files-mount-point/To mount a file system within a specific network namespace, run:
# For an EFS file system
sudo mount -t efs -o netns=netns-path file-system-id efs-mount-point/
# For an S3 file system
sudo mount -t s3files -o netns=netns-path file-system-id s3files-mount-point/To mount a file system to a mount target in a specific AWS Availability Zone, run:
# For an EFS file system (use az name, e.g. us-east-1a)
sudo mount -t efs -o az=az-name file-system-id efs-mount-point/
# For an S3 file system (use az id, e.g. use1-az1)
sudo mount -t s3files -o azid=az-id-name file-system-id s3files-mount-point/To mount a file system to a mount target in a specific AWS Region, run:
# For an EFS file system
sudo mount -t efs -o region=region-name file-system-id efs-mount-point/
# For an S3 file system
sudo mount -t s3files -o region=region-name file-system-id s3files-mount-point/Note: For cross-account support, ensure the prerequisites are met before using the cross-account option.
To mount an EFS file system mount target in the same availability zone ID (e.g., use1-az1) as the client instance for cross-account mounts, run:
Note: This feature is not supported for S3 Files.
sudo mount -t efs -o crossaccount file-system-id efs-mount-point/To mount your EFS file system over TLS, add the tls flag. S3 file systems use TLS by default and require no action.
# For an EFS file system
sudo mount -t efs -o tls file-system-id efs-mount-point/
# For an S3 file system
sudo mount -t s3files file-system-id s3files-mount-point/To authenticate with EFS using an IAM identity, add the iam and tls flags (TLS is required). S3 Files automatically includes both IAM and TLS and cannot be disabled.
# For an EFS file system
sudo mount -t efs -o tls,iam file-system-id efs-mount-point/
# For an S3 file system
sudo mount -t s3files file-system-id s3files-mount-point/To mount using an access point, use the accesspoint= option, which requires the tls flag. The access point must be in the "available" state before it can be used for EFS or S3 file system mounts.
# For an EFS file system
sudo mount -t efs -o tls,accesspoint=access-point-id file-system-id efs-mount-point/
# For an S3 file system (iam and tls are automatically applied)
sudo mount -t s3files -o accesspoint=access-point-id file-system-id s3files-mount-point/To automatically mount your file system with any of the options above, you can add entries to /etc/fstab:
# For an EFS file system
file-system-id efs-mount-point efs _netdev,tls,iam,accesspoint=access-point-id 0 0
# For an S3 file system (iam and tls are automatically applied)
file-system-id s3files-mount-point s3files _netdev,accesspoint=access-point-id 0 0For more information on mount helpers, see manual pages below or visit our documentation.
man mount.efs
man mount.s3filesnodirects3read – Optionally, you can disable direct reads from your S3 bucket. S3 Files automatically selects the optimal read path, from the file system or direct from the bucket. For large objects, it streams directly from your S3 bucket for higher throughput. When specified, all read operations use the standard NFS data path instead of streaming directly from your S3 bucket.
# Disable direct S3 read path
sudo mount -t s3files -o nodirects3read file-system-id s3files-mount-point/Cross Account Prerequisites: the crossaccount option ensures that the client instance Availability Zone ID (e.g. use1-az1) is the same as the EFS mount target Availability Zone ID for cross-AWS-account mounts (e.g. if the client instance is in Account A while the EFS instance is in Account B). Given a client instance in Account A/VPC A and an EFS instance in Account B/VPC B, the following prerequisites must be completed prior to using the crossaccount option:
Cross-VPC Communication:
Route 53 Setup:
After the above steps are complete, mount your filesystem mount target in the same Availability Zone ID (e.g. use1-az1) as the client instance over cross-AWS-account mounts, by running:
sudo mount -t efs -o crossaccount file-system-id efs-mount-point/暂无开放 Issues,或尚未同步最近议题。