Mounting from an Amazon Elastic Compute Cloud instance
You can mount your file system from an Amazon EC2 instance.
To mount your file system from Amazon EC2
-
Connect to your Amazon EC2 instance.
-
Make a directory on your FSx for Lustre file system for the mount point with the following command.
$ sudo mkdir -p /fsx -
Mount the Amazon FSx for Lustre file system to the directory that you created. Use the following command and replace the following items:
Replace
with the actual file system's DNS name.file_system_dns_nameReplace
with the file system's mount name. This mount name is returned in themountnameCreateFileSystemAPI operation response. It's also returned in the response of the describe-file-systems Amazon CLI command, and the DescribeFileSystems API operation.
sudo mount -t lustre -o relatime,flockfile_system_dns_name@tcp:/mountname/fsxThis command mounts your file system with two options,
-o relatimeandflock:-
relatime– While theatimeoption maintainsatime(inode access times) data for each time a file is accessed, therelatimeoption also maintainsatimedata, but not for each time that a file is accessed. With therelatimeoption enabled,atimedata is written to disk only if the file has been modified since theatimedata was last updated (mtime), or if the file was last accessed more than a certain amount of time ago (6 hours by default). Using either therelatimeoratimeoption will optimize the file release processes.Note
If your workload requires precise access time accuracy, you can mount with the
atimemount option. However, doing so can impact workload performance by increasing the network traffic required to maintain precise access time values.If your workload does not require metadata access time, using the
noatimemount option to disable updates to access time can provide a performance gain. Be aware thatatimefocused processes like file release or releasing data validity will be inaccurate in their release. -
flock– Enables file locking for your file system. If you don't want file locking enabled, use themountcommand withoutflock.
-
Verify that the mount command was successful by listing the contents of the directory to which you mounted the file system, /mnt/fsx by using the following command.
$ls /fsximport-path lustre $You can also use the
dfcommand, following.$df Filesystem 1K-blocks Used Available Use% Mounted on devtmpfs 1001808 0 1001808 0% /dev tmpfs 1019760 0 1019760 0% /dev/shm tmpfs 1019760 392 1019368 1% /run tmpfs 1019760 0 1019760 0% /sys/fs/cgroup /dev/xvda1 8376300 1263180 7113120 16% / 123.456.789.0@tcp:/mountname3547698816 13824 3547678848 1% /fsx tmpfs 203956 0 203956 0% /run/user/1000The results show the Amazon FSx file system mounted on /fsx.