โšก Onwuachi Control Plane

AWS Backup / EFS Restore Runbook

Overview

Reusable procedure for restoring an Amazon EFS filesystem from AWS Backup into a new, isolated filesystem for investigation, recovery, file extraction, or validation without modifying the source filesystem.

This procedure also documents common AWS Backup and EFS restore gotchas.


Prerequisites


Known Gotchas

1. AWS Backup item path validation can be misleading

For item-level restores, the AWS Backup UI may display a message indicating that the item path must be relative.

The path that validates may require a leading slash:

/path/from/filesystem/root

Do not assume that removing the leading slash will satisfy the validation message.


2. Verify the restore destination

AWS Backup may default to:

Restore to directory in source file system

This can result in data being written back into the original filesystem.

For an isolated recovery or investigation, always select:

Restore to a new file system

Treat this as a mandatory safety check before submitting the restore job.


3. EFS DNS may not work immediately

A newly restored EFS filesystem needs an available mount target before normal EFS DNS resolution works.

If DNS fails:

  1. Confirm a mount target exists.
  2. Confirm the mount target status is Available.
  3. Confirm networking and security groups allow NFS.
  4. If necessary, mount using the mount target IP address instead of the EFS DNS name.

4. amazon-efs-utils may not be available

amazon-efs-utils may not be available from the default package repositories on every Ubuntu installation.

For a basic scratch mount, standard NFSv4 can be used:

sudo apt-get install -y nfs-common

Then:

sudo mount -t nfs4 \
  -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport \
  <fs-id>.efs.<region>.amazonaws.com:/ \
  /mnt/efs-restore

5. Vault access policies may block restore jobs

An AWS Backup vault access policy can explicitly deny restore operations.

If the required restore action is denied:

  1. Review the vault access policy.
  2. Temporarily remove or modify the applicable deny condition.
  3. Perform the restore.
  4. Immediately restore the original security policy.

Do not leave a temporary security-policy exception in place after the restore.


6. Backup size may represent the entire recovery point

The size displayed for a restore job may represent the full recovery point rather than the specific path being restored.

Do not use the displayed backup size as an estimate of the amount of data contained in a particular item-level restore.


Procedure: Restore to a New Filesystem

1. Identify the Recovery Point

Open:

AWS Backup โ†’ Vaults โ†’ Recovery Points

Identify:

Record the recovery point before beginning.


2. Verify the Vault Policy

Before starting the restore, confirm the vault policy permits the required restore operation.

If a temporary policy change is required:


3. Start the Restore

Select the recovery point and choose:

Restore

Choose the appropriate restore type:

For item-level restore, use the path from the filesystem root:

/path/from/root

If the AWS Backup UI requires it, retain the leading /.


4. Select the Restore Destination

For isolated recovery work, select:

Restore to a new file system

Do not select:

Restore to directory in source file system

unless writing into the original filesystem is explicitly intended.

Recommended scratch configuration:

Submit the restore job.


5. Monitor the Restore

Navigate to:

AWS Backup โ†’ Jobs โ†’ Restore jobs

Wait for:

Status: Completed

Record the restored filesystem ID.

Do not proceed with mounting until the restored resource is available.


6. Create an EFS Mount Target

For the restored filesystem:

EFS โ†’ File systems โ†’ Network

Create a mount target in a subnet reachable from the scratch EC2 instance.

Verify:


7. Mount the Restored Filesystem

On the scratch instance:

sudo apt-get install -y nfs-common

Create the mount point:

sudo mkdir -p /mnt/efs-restore

Mount using NFSv4:

sudo mount -t nfs4 \
  -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport \
  <fs-id>.efs.<region>.amazonaws.com:/ \
  /mnt/efs-restore

Verify:

mount | grep efs
df -h /mnt/efs-restore

If EFS DNS does not resolve, use the appropriate mount-target IP address.


8. Locate and Extract Required Data

Search the restored filesystem:

find /mnt/efs-restore -iname "<filename>"

Copy required data to a local scratch location:

rsync -avh --progress \
  /mnt/efs-restore/<path>/ \
  ~/local-copy/

Verify the copied files before cleanup.


Cleanup

Cleanup is mandatory after completing the recovery.

1. Unmount EFS

sudo umount /mnt/efs-restore

Confirm it is no longer mounted:

mount | grep efs

2. Delete Mount Targets

In the EFS console:

File system โ†’ Network

Delete the mount target(s).

Wait for deletion to complete.


3. Delete the Restored Filesystem

From the EFS filesystem list:

  1. Select the restored filesystem.
  2. Choose Delete.
  3. Confirm the filesystem ID when prompted.

Do not delete the original/source filesystem.


4. Restore Any Temporary Security Policy Changes

If the AWS Backup vault policy was modified:


tmux / nohup

Long-running restore, copy, or investigation commands should be run inside tmux unless the operation is intentionally fire-and-forget.

tmux โ€” preferred for interactive work

Start:

tmux new -s efs-restore

Detach without stopping the work:

Ctrl-b
  โ†“ release
d

Important: Ctrl-b is a prefix. Press and release it first, then press d separately.

List sessions:

tmux ls

Reconnect:

tmux attach -t efs-restore

Kill the session when finished:

tmux kill-session -t efs-restore

Detaching does not stop commands running inside the session.


nohup โ€” fire-and-forget

For a non-interactive operation where a log file is sufficient:

nohup ./script.sh > /path/to/out.log 2>&1 &

Watch output:

tail -f /path/to/out.log

Check the process:

ps aux | grep script.sh

Stop it:

kill <PID>

Force termination only when necessary:

kill -9 <PID>

Rule of thumb

tmux: long-running, interactive, inspectable work.

nohup: background jobs where the log is all you need.

System Context

โ† Back to Kb