How to un-mount AWS EFS?
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
umount <EFS directory path> e.g., umount /mnt/efs
umount has options such as lazy and force.
umount -fcan be used in case of an unreachable file system.
umount -ldetaches 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
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.