Skip to content
Visual explainer 2h 30m to learn 5 steps

Back up and restore EBS, EFS and FSx data

Choose between EBS, EFS and FSx and plan a scoped restore from a snapshot or AWS Backup recovery point.

By Invicly Tech, , in AWS Cloud Engineering. About 11 minutes to read.

Topic 15 of 38

In short

EBS gives one EC2 instance a disk, EFS gives many Linux machines a shared NFS file system, and FSx offers managed Windows, Lustre, NetApp ONTAP and OpenZFS file systems. Each has its own way to back up, and AWS Backup can schedule and keep those backups in one place. A backup only counts once you have restored from it and checked the data.

Think of it like this: EBS is the hard drive inside one laptop, EFS is the shared drive the whole office maps, and FSx is a specialist file server you rent with the brand you need.

Explained simply

Not every app can store files in S3. Some software expects a normal disk or a shared folder. AWS has three families for this. EBS is a virtual hard drive for one EC2 instance. EFS is a shared folder that many Linux servers can use at once over NFS. FSx gives you managed versions of well-known file systems, such as Windows File Server.

Each of these can break: someone deletes a folder, an upgrade corrupts data, or ransomware encrypts files. So you keep copies. For EBS the copy is a snapshot. For EFS and FSx you use backups, often scheduled by AWS Backup, a service that runs and stores backups for many resource types.

A backup you have never restored is only a hope. The safe habit is a scoped restore: bring back just the volume or folder you need into a new resource, check it, and only then swap it in. That way the original stays untouched until you know the copy is good.

These services cost money while they exist, including test volumes and old snapshots. Keep lab resources tiny, tag them, and delete them in the cleanup step. If you cannot spend anything, you can still write the restore plan and practise the steps on paper.

Press Play on a diagram to walk through it one step at a time.

CompareEBS, EFS and FSx at a glance
EBS
  • Block volume for EC2
  • Lives in one Availability Zone
  • Usually attached to one instance
  • Back up with incremental snapshots
EFS
  • Shared NFS for Linux
  • Regional, spans AZs by default
  • Grows and shrinks by itself
  • Back up with AWS Backup
FSx
  • Windows File Server, Lustre, ONTAP, OpenZFS
  • SMB or NFS or Lustre clients
  • Pick when an app needs that file system
  • Backups built in and via AWS Backup
FlowA scoped restore of one volume
  1. 1
    Pick recovery point

    Snapshot or AWS Backup point from before the damage

  2. 2
    Restore to new resource

    New volume or file system, never over the original

  3. 3
    Attach and mount

    To a test instance, read-only if possible

  4. 4
    Verify

    Checksums, file counts, app smoke test

  5. 5
    Swap or copy back

    Then delete what you no longer need

CycleThe backup confidence loop
  1. 1
    Back up

    Scheduled plan with retention

  2. 2
    Restore test

    Into a new resource, on a calendar

  3. 3
    Verify

    Checksums, counts, smoke test

  4. 4
    Measure

    Actual recovery time and data loss

  5. 5
    Adjust

    Change schedule, retention or runbook

  6. Back to step 1

In depth

Choosing between EBS, EFS and FSx

Start with how the data is used. If one instance needs a fast disk for a database or boot volume, use EBS; gp3 is the usual general-purpose type and lets you set IOPS and throughput separately from size. If several Linux instances or containers must read and write the same files, use EFS; it is regional by default, grows automatically and is billed for what you store. If an app needs a specific file system, pick the matching FSx: FSx for Windows File Server for SMB shares and Active Directory, FSx for Lustre for high-speed compute jobs, FSx for NetApp ONTAP or FSx for OpenZFS when teams already rely on those features. If none of this applies, S3 is usually cheaper and simpler.

  • One instance, block disk: EBS
  • Many Linux clients, shared files: EFS
  • Windows SMB shares: FSx for Windows File Server
  • HPC scratch or S3-linked compute: FSx for Lustre
  • Plain objects: S3

How EBS snapshots work

The first snapshot of a volume copies all used blocks. Later snapshots store only the blocks that changed, but each one can still restore the full volume, because AWS keeps track of which blocks belong to which point in time. Deleting an older snapshot does not break newer ones. Snapshots are stored across the Region, so you can create a new volume from one in any AZ there, or copy it to another Region for disaster recovery. A snapshot of a running volume is crash-consistent, like pulling the power plug; for databases, flush or pause writes, or use the application's own backup tool. A restored volume pulls blocks from S3 the first time they are read, so the first pass is slow. Fast snapshot restore removes that delay for an extra charge.

AWS Backup: plans, assignments and vaults

AWS Backup gives one place to schedule and keep backups for EBS, EFS, FSx, RDS, DynamoDB and more. A backup plan holds rules: how often to run, the backup window, how long to keep each recovery point and whether to copy it to another Region or account. A resource assignment says which resources the plan covers, often by tag such as backup=daily. A backup vault stores the recovery points, encrypted with a KMS key, and a vault access policy can deny deletes. For EFS, you can restore the whole file system or only chosen paths; item-level restores are written into a new recovery directory rather than over your files. Backups are billed per GB stored and per GB restored for some types.

MapParts of AWS Backup
AWS Backup
  • Backup plan
    • Schedule and window
    • Retention
    • Copy to another Region
  • Resource assignment
    • By tag, e.g. backup=daily
    • Or by ARN
  • Backup vault
    • Holds recovery points
    • KMS encrypted
    • Access policy can deny deletes
  • Jobs
    • Backup job
    • Restore job
    • Copy job

Planning and verifying a scoped restore

Write the restore plan before you need it. Name the resource, the recovery point you would choose and why, where the restore goes (a new volume in the same AZ as a test instance, or a new EFS path), and how you will check it. Good checks are concrete: the file count in a folder, a sha256sum of known files compared with a list made at backup time, and an application smoke test such as opening one processed result. Time the whole exercise. The time it took is your real recovery time, and the age of the recovery point is your real data loss. Finish by detaching and deleting the test volume or file system, and record the result.

  • Restore into a new resource
  • Mount read-only for checks
  • Compare checksums and counts
  • Record how long it took
  • Clean up test resources

Learn it in 5 short steps

About 30m each. Track them with a timer in your plan.

  1. 1
    Compare EBS, EFS and FSx~30m
  2. 2
    Take an EBS snapshot~30m
  3. 3
    Create an AWS Backup plan~30m
  4. 4
    Restore one volume or file system~30m
  5. 5
    Verify the restored data~30m

Key points

  • EBS snapshots are incremental and stored by AWS across the Region, so you can restore into any AZ there.
  • A volume restored from a snapshot loads blocks lazily, so first reads are slow unless you pre-warm it.
  • AWS Backup uses plans (schedule and retention), resource assignments and vaults that hold recovery points.
  • Restore to a new resource first; replacing the original before checking can turn one problem into two.

Key terms

Tap a card to flip it. 0/5 known

Examples

bash
# snapshot, then restore into a NEW volume for checking
aws ec2 create-snapshot --volume-id vol-0abc1234 --description "before upgrade"
aws ec2 wait snapshot-completed --snapshot-ids snap-0def5678
aws ec2 create-volume --snapshot-id snap-0def5678 \
  --availability-zone eu-west-1a --volume-type gp3
# attach to a test instance, mount read-only, compare checksums

Recover one deleted folder from an EBS volume

Situation: on a lab EC2 instance, someone deleted /data/results at 14:20. Step 1: find the last snapshot before 14:20 with describe-snapshots. Step 2: create a new gp3 volume from it in the same AZ as the instance. Step 3: attach it as a second device and mount it read-only at /mnt/restore. Step 4: copy only /mnt/restore/results back to /data/results and compare checksums. Evidence: matching sha256sum output. Cleanup: unmount, detach and delete the restored volume.

bash
aws ec2 describe-snapshots --owner-ids self \
  --filters Name=volume-id,Values=vol-0abc1234 \
  --query "Snapshots[].[SnapshotId,StartTime]" --output table
aws ec2 create-volume --snapshot-id snap-0def5678 --availability-zone eu-west-1a --volume-type gp3
aws ec2 attach-volume --volume-id vol-0new9999 --instance-id i-0lab1111 --device /dev/sdf
# on the instance (device name may show as /dev/nvme1n1)
sudo mount -o ro /dev/nvme1n1 /mnt/restore
sudo rsync -a /mnt/restore/results/ /data/results/

A tag-based daily backup plan

Goal: back up every resource tagged backup=daily once a day and keep each copy for 14 days. Step 1: create a backup vault. Step 2: create a plan with one rule that runs at 03:00 UTC with 14-day retention. Step 3: assign resources by tag, using the AWS Backup default service role. Evidence: after the next window, list-recovery-points-by-backup-vault shows new points. Cleanup: delete recovery points, the selection, the plan and then the vault.

bash
aws backup create-backup-vault --backup-vault-name lab-vault
aws backup create-backup-plan --backup-plan '{"BackupPlanName":"daily-14",
  "Rules":[{"RuleName":"daily","TargetBackupVaultName":"lab-vault",
  "ScheduleExpression":"cron(0 3 * * ? *)","Lifecycle":{"DeleteAfterDays":14}}]}'
# then create-backup-selection with ListOfTags backup=daily and an IAM role
aws backup list-recovery-points-by-backup-vault --backup-vault-name lab-vault

Quick reference

  • EBS = one AZ, usually one instance; EFS = shared NFS, regional; FSx = managed specialist file systems
  • EBS snapshots are incremental; deleting an old one does not break newer ones
  • Restore a snapshot to a new volume in the same AZ as the instance that will attach it
  • Restored volumes load lazily; first reads are slow unless fast snapshot restore is on
  • AWS Backup = plan (schedule, retention) + assignment (tags) + vault (recovery points)
  • A backup is proven only by a timed, verified restore

Common mistakes

  • Taking snapshots for months and never practising a restore.
  • Restoring in the wrong AZ: a volume must be in the same AZ as the instance that attaches it.
  • Forgetting to delete test volumes and old snapshots, which keep billing.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1Three Linux containers in different AZs must share the same folder of images. Which service fits best?

Question 2

2You delete the oldest of five EBS snapshots. What happens to the other four?

Question 3

3In AWS Backup, what decides which resources a plan protects?

Question 4

4Why is restoring over the original volume risky?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    For each case pick EBS, EFS, FSx or S3: a PostgreSQL data disk on one EC2 instance, a Windows team share with Active Directory, 2 million user photos served over HTTPS, a shared config folder for four Linux servers.

  2. Exercise 2medium

    Write a five-line restore runbook for an EFS file system where one directory was deleted yesterday.

  3. Exercise 3hard

    Your RPO is 4 hours and RTO is 1 hour for an EBS-backed app. A test restore took 75 minutes, mostly slow first reads. Propose two changes and how you would prove they work.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Is an EBS snapshot a full copy every time?
No. Only the first snapshot copies all used blocks. Later ones store changed blocks, yet each can restore the whole volume.
Can I attach one EBS volume to two instances?
Only io1 and io2 volumes support Multi-Attach, within one AZ, and the file system must handle shared access. For normal shared files, use EFS or FSx.
Does AWS Backup replace snapshots?
It uses the same underlying snapshot and backup features but adds central schedules, retention, cross-Region copies and vault protection.

Go deeper

ShareXLinkedInWhatsApp