How to un-mount AWS EFS?

Abhishek Verma
TheLoudCloud
Published in
1 min readAug 13, 2020

--

AWS recommends un-mounting the elastic file system before deleting it.

A thing to note is that this cannot be done using the console, or the CLI, or through any of the SDKs. To un-mount an EFS file system, one has to connect to the EC2 instance running Linux and use the umountcommand.

umount <EFS directory path> e.g., umount /mnt/efs

umount has options such as lazy and force.

  • umount -f can be used in case of an unreachable file system.
  • umount -l detaches the file system from the file system hierarchy on command execution and cleans up all the references to the file system as soon as it’s not busy anymore.

AWS recommends not using any of the umountoptions though.

The df command can be used to check to get the disk usage statistics of file systems mounted on the instance.

df -T -h

The above command shouldn’t return the EFS file system details after it has been un-mounted.

--

--