TechEarl

How to Add an EBS Volume to an EC2 Instance

Create an EBS volume, attach it to a running EC2 instance, format and mount it, and survive reboots with a UUID-based fstab entry. Console, AWS CLI, and Terraform walkthroughs plus the Nitro device-naming gotcha that trips everyone, and how to extend the volume later without a restart.

Ishan KarunaratnePublished ⏱️ 24 min readUpdated
Share thisCopied
Create an EBS volume with aws ec2 create-volume, attach it to a running EC2 instance, format with mkfs.ext4 or mkfs.xfs, mount it, and persist across reboots with a UUID-based /etc/fstab entry. Console, AWS CLI, and Terraform walkthroughs.

Adding an EBS volume to a running EC2 instance is three operations: create the volume with aws ec2 create-volume, attach it with aws ec2 attach-volume --device /dev/sdf, then format and mount it from inside the instance. AWS handles the create and attach in seconds and the instance stays running throughout.

The mount step, run on the instance itself, is where every gotcha lives. The two things people get wrong: the AWS-vs-Linux device-naming mismatch (you attach as /dev/sdf and the OS sees it as /dev/xvdf on Xen or /dev/nvme1n1 on Nitro), and using the device path in /etc/fstab instead of the filesystem UUID, which guarantees a broken fstab the next time the kernel reorders devices. Below: the exact procedure for Console, AWS CLI, and Terraform; the EBS volume type comparison (gp3, gp2, io2 Block Express, st1, sc1); Multi-Attach caveats; the verification commands that prove the mount survives a reboot; and, when the disk fills up, extending the volume without a restart.

How do I add an EBS volume to an EC2 instance?

Create the volume with aws ec2 create-volume --volume-type gp3 --size 100 --availability-zone us-east-1a, capturing the volume ID. Attach it to the running instance with aws ec2 attach-volume --volume-id vol-XXX --instance-id i-XXX --device /dev/sdf. The instance sees the new block device immediately (run lsblk to confirm). On Nitro instances the device appears as /dev/nvme1n1, not /dev/sdf; on older Xen instances it appears as /dev/xvdf. Format with sudo mkfs.ext4 -L data /dev/nvme1n1 (or mkfs.xfs), create a mount point, mount it, then add a /etc/fstab entry using UUID= (not the device path) with the nofail flag so a missing disk does not block boot. The instance stays running throughout. Snapshot the volume before mounting anything that already contains data.

Try it with your own values

Type your AWS values once, every example below uses them.

Jump to:

Before you start: prerequisites and snapshot

You need an IAM principal with ec2:CreateVolume and ec2:AttachVolume (the AWS-managed AmazonEC2FullAccess policy covers both). The instance can be running. No reboot at any point.

The volume must be created in the same Availability Zone as the instance. This is the most common up-front mistake: launching an instance in us-east-1a and creating a volume in us-east-1b and being unable to attach. AZs are scoped per AWS account, so my us-east-1a is not the same physical zone as your us-east-1a, but for a single account a volume and instance must agree on the AZ string.

If the volume already contains data (snapshot restore, migration, import), snapshot first:

bash
aws ec2 create-snapshot \
  --region :region \
  --volume-id :volume_id \
  --description "pre-attach-$(date +%Y%m%d-%H%M)"

Snapshots are incremental, cost cents, and give you a single-API-call rollback. Skip the snapshot only on a fresh empty volume.

Step 1: Create the EBS volume

A 100 GiB gp3 volume in the instance's AZ:

bash
aws ec2 create-volume \
  --region :region \
  --volume-type :volume_type \
  --size :volume_size \
  --availability-zone :availability_zone \
  --tag-specifications 'ResourceType=volume,Tags=[{Key=Name,Value=data-disk-01},{Key=role,Value=data}]'

--size is in GiB. --volume-type accepts gp3, gp2, io1, io2, st1, sc1, or standard. The default for gp3 is 3,000 IOPS and 125 MiB/s throughput, both adjustable with --iops and --throughput. gp2 scales IOPS with size; gp3 decouples them and is cheaper for the same performance, so unless you need backward compatibility there is no reason to pick gp2 anymore.

The command returns the volume ID immediately. To wait for it to reach available:

bash
aws ec2 wait volume-available --region :region --volume-ids :volume_id

To restore from a snapshot instead, swap --size for --snapshot-id:

bash
aws ec2 create-volume \
  --region :region \
  --snapshot-id snap-0abc123 \
  --volume-type :volume_type \
  --availability-zone :availability_zone

The size is inherited from the snapshot; pass --size larger than the source to create a bigger volume from the same snapshot.

Step 2: Attach the volume to the instance

bash
aws ec2 attach-volume \
  --region :region \
  --volume-id :volume_id \
  --instance-id :instance_id \
  --device :device

The --device argument is the device name AWS will report in volume metadata. It is not necessarily the device path that appears on the Linux instance. See the gotcha section below.

Conventional AWS device names for additional data volumes: /dev/sdf through /dev/sdp. Root volumes are conventionally /dev/sda1 or /dev/xvda, which AWS reserves. Pick /dev/sdf for the first data volume on an instance, /dev/sdg for the second, and so on.

Attach completes in seconds. From inside the instance, confirm with lsblk:

code
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
nvme0n1      259:0    0     8G  0 disk
└─nvme0n1p1  259:1    0     8G  0 part /
nvme1n1      259:2    0   100G  0 disk

nvme1n1 (or xvdf on older instances) is the new volume. No partitions, no filesystem.

Console method: EC2 console, Volumes, select the volume, Actions, Attach volume. Same effect, slower for batches.

The AWS-vs-Linux device naming gotcha

This single mismatch trips everyone exactly once. AWS device names are advisory; Linux assigns its own.

AWS device argumentXen instance seesNitro instance sees
/dev/sda1 (root)/dev/xvda/dev/nvme0n1
/dev/sdf/dev/xvdf/dev/nvme1n1
/dev/sdg/dev/xvdg/dev/nvme2n1
/dev/sdh/dev/xvdh/dev/nvme3n1

Nitro instances are the modern default (C5, M5, R5, T3, T3a, T4g, all Graviton families, and every C6/M6/R6 and later). The kernel sees EBS volumes through the NVMe driver, so devices appear as /dev/nvmeXn1 in order of attachment, not by the AWS device argument.

Xen instances (older C3, M3, R3, T2 and earlier) use the Xen block driver, so /dev/sdf from AWS becomes /dev/xvdf (a one-character translation: s to xv).

The reliable way to map an AWS device argument to a Linux device path on Nitro is the nvme id-ctrl command, which reads the device's identity controller block:

bash
sudo nvme id-ctrl -v /dev/nvme1n1 | grep -i "sn\|vol"

The serial number contains the EBS volume ID (with hyphens stripped). Compare against aws ec2 describe-volumes output to know which Linux device corresponds to which EBS volume.

For most workflows you can skip the mapping ritual and just use lsblk to find the unformatted device by size and TYPE. On an instance with one root disk and one new data disk, the latter is unmistakable.

Step 3: Format and mount inside the instance

Format with ext4 (the right default for most workloads):

bash
sudo mkfs.ext4 -L data /dev/nvme1n1

-L data labels the filesystem data, which lets you reference it later as /dev/disk/by-label/data. The label is convenient but the UUID is what goes in fstab.

For XFS (Amazon Linux 2023 boot disks use XFS by default; large-file workloads benefit from it):

bash
sudo mkfs.xfs -L data /dev/nvme1n1

This is destructive. Double-check the device path on instances with multiple unformatted volumes.

Mount point, mount, permissions:

bash
sudo mkdir -p /mnt/data
sudo mount /dev/nvme1n1 /mnt/data
sudo chown ec2-user:ec2-user /mnt/data

Confirm with df -h /mnt/data. The filesystem should report close to the volume size (a small percentage goes to filesystem overhead and the journal).

For workloads that benefit from filesystem-level TRIM passthrough to EBS, mount with discard:

bash
sudo mount -o discard /dev/nvme1n1 /mnt/data

EBS treats discards as a hint to release allocated blocks. The performance impact is small on modern volumes; the cost benefit is real on volumes that grow and shrink in real usage.

Step 4: Persist the mount with fstab and UUID

The mount is live but ephemeral. Reboot now and the disk is unmounted; you have to re-run the mount command manually.

The fix is /etc/fstab. Two ways to write the entry, only one is right.

Wrong (the version that bites people):

code
/dev/nvme1n1 /mnt/data ext4 defaults 0 2

Works until you attach another volume, detach and re-attach this one, or move to a different instance type with different NVMe enumeration. The kernel can re-letter the devices and /dev/nvme1n1 ends up being a different volume, or nothing at all.

Right (UUID, baked into the filesystem at format time):

bash
sudo blkid /dev/nvme1n1

Output:

code
/dev/nvme1n1: LABEL="data" UUID="3f7e1c2a-9b4d-4a8e-bc6f-2d1a5e9b7c8f" TYPE="ext4"

Add it to fstab:

bash
echo "UUID=3f7e1c2a-9b4d-4a8e-bc6f-2d1a5e9b7c8f /mnt/data ext4 defaults,nofail 0 2" \
  | sudo tee -a /etc/fstab

nofail matters. Without it, a missing disk (detached, snapshotted out from under the instance, accidentally deleted) prevents the instance from booting and you have to recover via the EC2 Serial Console or by detaching the root volume. With nofail, boot continues and you can SSH in to diagnose.

Test without rebooting:

bash
sudo umount /mnt/data
sudo mount -a
df -h /mnt/data

Clean output from mount -a plus the disk in df -h means the fstab line is correct.

Critical: before you ever run aws ec2 detach-volume, remove or comment out the fstab line. Otherwise the next reboot pauses at the fstab stage waiting for a disk that no longer exists.

EBS volume types compared

AWS offers five active EBS volume types plus the legacy standard (magnetic) type. Pick by workload.

TypeMediaMin sizeMax sizeMax IOPSMax throughputBest for
gp3SSD1 GiB64 TiB80,0002,000 MiB/sDefault for everything
gp2SSD1 GiB16 TiB16,000250 MiB/sLegacy, no reason to pick today
io2 Block ExpressSSD4 GiB64 TiB256,0004,000 MiB/sHigh-end databases, latency-critical
io1SSD4 GiB16 TiB64,0001,000 MiB/sLegacy provisioned IOPS
st1HDD125 GiB16 TiB500500 MiB/sLarge sequential workloads, logs
sc1HDD125 GiB16 TiB250250 MiB/sCold storage, infrequent access

Default to gp3. It is cheaper than gp2 at the same baseline (3,000 IOPS, 125 MiB/s included) and IOPS plus throughput are tunable independent of size. Reach for io2 Block Express only when you have measured gp3 and need more IOPS than its 80,000 ceiling allows, or when sub-millisecond latency is a requirement.

st1 is the right answer for big-block sequential workloads: log aggregators, data warehouse staging, video processing pipelines. sc1 is for things you almost never read.

Performance on gp3 is set at create time, not derived from size, so a 100 GiB gp3 and a 10 TiB gp3 have the same default 3,000 IOPS. Bump IOPS with --iops 8000 at create time (or modify later with aws ec2 modify-volume). The first 3,000 IOPS and 125 MiB/s are free; you only pay for provisioned performance above that.

For the live-resize procedure when a volume fills up, see extending an EBS volume without a restart below.

Console vs CLI vs Terraform

Same operation, three interfaces. Pick by workflow.

ApproachBest forCommand / action
EC2 consoleOne-off volumes, exploringVolumes, Create volume, then Actions, Attach volume
AWS CLIScripted, batchedaws ec2 create-volume plus attach-volume
TerraformInfra-as-code, audit trailsaws_ebs_volume plus aws_volume_attachment
AWS CDKProgrammatic, app-alignedec2.Volume plus instance.attachVolume()

The Terraform snippet:

hcl
resource "aws_ebs_volume" "data" {
  availability_zone = "us-east-1a"
  size              = 100
  type              = "gp3"
  iops              = 3000
  throughput        = 125
  encrypted         = true
  tags = {
    Name = "data-disk-01"
    role = "data"
  }
}

resource "aws_volume_attachment" "data" {
  device_name = "/dev/sdf"
  volume_id   = aws_ebs_volume.data.id
  instance_id = aws_instance.web.id
}

Two resources, not one. aws_ebs_volume creates the volume; aws_volume_attachment attaches without coupling the volume's lifecycle to the instance. If you put ebs_block_device inside the aws_instance resource instead, deleting the instance deletes the volume (almost never what you want for data disks).

The CDK equivalent in TypeScript:

typescript
const dataVolume = new ec2.Volume(this, "DataVolume", {
    availabilityZone: "us-east-1a",
    size: cdk.Size.gibibytes(100),
    volumeType: ec2.EbsDeviceVolumeType.GP3,
    encrypted: true,
});

new ec2.CfnVolumeAttachment(this, "DataVolumeAttachment", {
    device: "/dev/sdf",
    instanceId: instance.instanceId,
    volumeId: dataVolume.volumeId,
});

The format / mount / fstab steps still happen inside the instance. Use a user-data script, an Ansible playbook, or AWS Systems Manager Run Command. The fact that Terraform creates the volume and attaches it does not get you a formatted filesystem; the OS-side work is yours.

To attach volumes across a fleet, a Bash for loop over the instance list does it cleanly:

bash
for instance in i-aaa i-bbb i-ccc; do
  vol=$(aws ec2 create-volume --region :region --volume-type :volume_type --size :volume_size \
      --availability-zone :availability_zone --query VolumeId --output text)
  aws ec2 wait volume-available --region :region --volume-ids "$vol"
  aws ec2 attach-volume --region :region --volume-id "$vol" --instance-id "$instance" --device :device
done

Multi-Attach and other caveats

Multi-Attach lets one EBS volume attach to up to 16 EC2 instances simultaneously, all read-write. Significant caveats:

  • io1 and io2 only. Not gp3, gp2, st1, or sc1.
  • All instances must be in the same AZ.
  • Instances must be Nitro-based.
  • ext4 and XFS corrupt themselves under Multi-Attach. You need a cluster-aware filesystem: GFS2, OCFS2, or a clustered application that handles its own concurrency.
  • Snapshots are not consistent unless the filesystem itself coordinates.

For most use cases that ask "can I share a disk between instances?", the answer is EFS (NFS over the network, simple) or FSx (managed Lustre, Windows File Server, OpenZFS, or NetApp). Multi-Attach is the right answer only when you have a cluster-aware filesystem and a workload that genuinely benefits from shared block storage.

Encryption at rest is on by default in most accounts since 2021 (you set the default with aws ec2 enable-ebs-encryption-by-default). For customer-managed keys pass --kms-key-id to create-volume.

Per-instance attachment limits depend on instance type. The classic ceiling was 25 EBS volumes per instance; modern Nitro instances support up to 128 or more on certain types. The instance volume limits page in the EC2 user guide is the authoritative source.

Volumes attach across AZs is not supported. A volume in us-east-1a cannot be attached to an instance in us-east-1b. To migrate, create a snapshot, restore the snapshot to a new volume in the target AZ, attach.

Detach order matters. Always sudo umount /mnt/data from the instance before aws ec2 detach-volume. Detaching a mounted volume risks filesystem corruption.

Verify the volume survives a reboot

The only verification that proves the fstab entry works:

bash
sudo reboot

Wait for the instance to come back, SSH in, confirm the mount is present without manual intervention:

bash
df -h /mnt/data
mount | grep /mnt/data

If the mount is missing, check dmesg | tail and journalctl -xb | grep -i fstab. The usual suspects: UUID typo from a copy-paste, filesystem type mismatch (ext4 declared but volume is xfs), missing nofail blocking boot at the fstab stage and dropping the instance into emergency mode.

For instances that hosted databases, the post-reboot ritual extends to a logical check: confirm MySQL, PostgreSQL, or Redis came back up cleanly. The MySQL backup procedure is the right pre-flight before any disk operation on a database instance.

Extend an EBS volume without a restart

When a volume fills up, it grows online: no detach, no reboot, no maintenance window. Elastic Volumes (GA February 2017) handles the control-plane side, and on Nitro instances Linux sees the new size within seconds. The whole job is four commands: aws ec2 modify-volume to enlarge it, aws ec2 describe-volumes-modifications to confirm it reached optimizing, sudo growpart to expand the partition, and sudo resize2fs (ext4) or sudo xfs_growfs (XFS) to stretch the filesystem.

You need ec2:ModifyVolume and ec2:DescribeVolumesModifications, and the volume must be attached. Volumes attached before November 3, 2016 23:40 UTC must first be initialized by a detach and reattach or a stop and start; nothing launched in recent years is affected. Take a snapshot first, exactly as in the prerequisites above, and capture df -hT and lsblk so you have a before-and-after.

Modify the volume

bash
aws ec2 modify-volume \
  --region :region \
  --volume-id :volume_id \
  --size :new_size

--size is in GiB. The response shows the modification state:

json
{
    "VolumeModification": {
        "VolumeId": "vol-0abc123def456",
        "ModificationState": "modifying",
        "TargetSize": 200,
        "OriginalSize": 100,
        "Progress": 0,
        "StartTime": "2026-04-10T13:22:01.000Z"
    }
}

The same command changes type, IOPS, and throughput too, all in one call. Converting gp2 to gp3 with provisioned performance:

bash
aws ec2 modify-volume \
  --region :region \
  --volume-id :volume_id \
  --volume-type gp3 \
  --iops 6000 \
  --throughput 250 \
  --size :new_size

In the console it is Volumes, select the volume, Actions, Modify volume. In Terraform, change size on the aws_ebs_volume resource from the Terraform snippet above and terraform apply; the resize happens in place, with no replacement.

Wait for the optimizing state

The modification moves through modifying (the backend is provisioning, the new size is not visible yet), optimizing (the resize is functionally done and the OS sees the new size, though performance may still be settling), and completed. The new size is usable at optimizing, so there is no need to wait for completed. Poll it, or loop until it arrives:

bash
while true; do
  state=$(aws ec2 describe-volumes-modifications \
      --region :region \
      --volume-ids :volume_id \
      --query "VolumesModifications[0].ModificationState" \
      --output text)
  [[ "$state" == "optimizing" || "$state" == "completed" ]] && break
  sleep 5
done

For a gp3 size-only change the wait is usually under a minute. Type conversions (gp2 to gp3, or anything to io2 Block Express) can sit in optimizing for hours while data rebalances, but the size is usable as soon as the state flips. Confirm with lsblk inside the instance. Nitro instances rescan automatically; on an older Xen instance that still shows the old size, nudge it with echo 1 | sudo tee /sys/class/block/xvdf/device/rescan.

Grow the partition and filesystem

growpart (from cloud-utils-growpart, pre-installed on official AWS AMIs) moves the partition's end to the new end of the disk. It takes the disk and the partition number as two space-separated arguments; growpart /dev/nvme1n1p1 fails.

bash
sudo growpart /dev/nvme1n1 1   # partitioned data volume on Nitro
sudo growpart /dev/nvme0n1 1   # root volume on Nitro
sudo growpart /dev/xvdf 1      # older Xen instance
code
CHANGED: partition=1 start=2048 old: size=209713119 end=209715167 new: size=419430399 end=419432447

If it is missing, install cloud-utils-growpart with dnf (Amazon Linux, RHEL, Rocky) or cloud-guest-utils with apt-get (Debian, Ubuntu). A volume formatted as a whole-disk filesystem, like the mkfs.ext4 -L data /dev/nvme1n1 from Step 3, has no partition rows under it in lsblk: skip growpart (it fails with "must supply partition-number") and resize the filesystem directly.

Then stretch the filesystem:

FilesystemCommand
ext4, partitionedsudo resize2fs /dev/nvme1n1p1
ext4, whole disksudo resize2fs /dev/nvme1n1
XFSsudo xfs_growfs / or sudo xfs_growfs /mnt/data (by mount point)
btrfssudo btrfs filesystem resize max /

ext4 resizes online on a mounted filesystem:

code
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/nvme1n1p1 is mounted on /; on-line resizing required
old_desc_blocks = 13, new_desc_blocks = 25
The filesystem on /dev/nvme1n1p1 is now 52428795 (4k) blocks long.

Amazon Linux 2023 root volumes are XFS. xfs_growfs -d appears in older AWS documentation; current xfs_growfs grows to fill the device by default, so the flag is harmless. If you do not know the type, lsblk -f shows it per partition. Verify with df -hT:

code
# Before
$ df -hT /mnt/data
Filesystem      Type   Size  Used Avail Use% Mounted on
/dev/nvme1n1p1  ext4    98G   42G   52G  45% /mnt/data

# After
$ df -hT /mnt/data
Filesystem      Type   Size  Used Avail Use% Mounted on
/dev/nvme1n1p1  ext4   196G   42G  149G  22% /mnt/data

Same Used, larger Size, and the SSH session never dropped.

Resize limits and gotchas

  • No shrinking. A smaller size is rejected with InvalidParameterValue. The only route to a smaller volume is a new volume, a data copy, and a swapped attachment.
  • Up to four modifications per volume in a rolling 24-hour period, and each one has to reach completed before you can start the next (a modification that is still modifying or optimizing blocks a new request). Other volumes are independent. Going over the limit returns an error telling you when the next modification is allowed. If a volume might need several bumps in a day, do the larger one up front.
  • Performance. gp2 IOPS scale at 3 per GiB, so doubling the size doubles the IOPS ceiling. gp3 decouples IOPS from size: a resize alone changes nothing, so pass --iops and --throughput explicitly.
  • Custom AMIs. Official AMIs (Amazon Linux 2, Amazon Linux 2023, Ubuntu) ship cloud-init set to grow the root partition and filesystem at boot. Custom AMIs without it do not, so the steps above are mandatory and a reboot will not do it for you.
  • Skip the fdisk advice. Older posts say to run sudo fdisk /dev/nvme0n1 and press w before growpart. It is unnecessary on modern AMIs and risky in interactive mode; growpart updates the partition table itself.

AWS's Request Amazon EBS volume modifications and Extend the file system after resizing an Amazon EBS volume are the upstream references.

What to do next

FAQ

Three commands. Run aws ec2 create-volume --volume-type gp3 --size 100 --availability-zone us-east-1a to create the volume in the same AZ as the instance. Run aws ec2 attach-volume --volume-id vol-XXX --instance-id i-XXX --device /dev/sdf to attach it. From inside the instance, run sudo mkfs.ext4 -L data /dev/nvme1n1, create a mount point, and mount it.

Then add a UUID-based entry to /etc/fstab with the nofail option so the mount survives reboots. The instance stays running throughout.

Because Nitro-based instances (C5, M5, R5, T3, all Graviton, all C6/M6/R6 and later) expose EBS volumes through the NVMe driver. AWS device names like /dev/sdf are advisory metadata at the control-plane layer; Linux assigns its own device paths based on the driver it loaded.

On Nitro, volumes appear as /dev/nvme0n1, /dev/nvme1n1, and so on in order of attachment. On older Xen instances they appear as /dev/xvdf (a one-letter translation of sdf). Use lsblk to see what the OS actually sees, and use UUID= in fstab instead of either name.

ext4 is the right default for most workloads. It is mature, well-understood, supports online resize, and is the default on Amazon Linux 2 and Ubuntu. Format with sudo mkfs.ext4 -L data /dev/nvme1n1.

XFS is a strong alternative for large-file workloads (video processing, log aggregation, scientific data) and is the default on Amazon Linux 2023. It outperforms ext4 on parallel writes to large files and supports online growth. Format with sudo mkfs.xfs -L data /dev/nvme1n1. Avoid btrfs and zfs on EBS root volumes unless you specifically need their features and have operational comfort with them.

Device paths like /dev/nvme1n1 are not stable. The kernel assigns them in the order it sees volumes at boot. Attach another volume, detach and re-attach the boot volume, or move to a different instance type with different NVMe enumeration, and the same physical volume can show up as /dev/nvme2n1 or something else entirely.

Filesystem UUIDs are baked into the filesystem at format time and never change. UUID=... in fstab references the filesystem directly, not whichever device path won the boot-time race. Always add nofail so a missing volume does not block the instance from booting.

gp2 scales IOPS with volume size: 3 IOPS per GiB up to a 16,000 IOPS ceiling. A 100 GiB gp2 gives you 300 IOPS; a 5,000 GiB gp2 gives you the full 16,000.

gp3 decouples IOPS and throughput from size. Every gp3 starts at 3,000 IOPS and 125 MiB/s baseline, regardless of size. You can scale either up to 80,000 IOPS and 2,000 MiB/s with the --iops and --throughput arguments. gp3 is ~20% cheaper than gp2 at the equivalent performance point. No workload should default to gp2 today.

Yes, with EBS Multi-Attach, but with significant constraints. Only io1 and io2 volumes support it. Up to 16 instances, all in the same AZ, all Nitro-based. ext4 and XFS will corrupt themselves under Multi-Attach because they assume single-writer semantics; you need a cluster-aware filesystem like GFS2 or OCFS2, or an application that coordinates writes itself.

For most shared-storage needs, EFS (NFS over the network) or FSx (managed Lustre, Windows File Server, NetApp ONTAP) is the better answer. Multi-Attach exists for specific clustered workloads like Oracle RAC or SAP HANA shared block storage.

Not for a fresh, empty volume you just created. There is nothing to back up. But for any volume that already contains data (a snapshot-restored volume, a volume migrated from another instance, a volume that previously belonged to an instance that crashed), snapshot it before mounting on the new instance.

The cost is cents. The benefit is a one-command rollback if the filesystem turns out to be inconsistent or if the wrong mount commands cause data loss. Use aws ec2 create-snapshot --volume-id vol-XXX --description "pre-attach".

Depends on the instance type. On older Xen instances the practical limit was 25 EBS volumes per instance. Modern Nitro instance types support more: many support 28, some support 128 or more attachments. The official EC2 user guide page on instance volume limits is the authoritative source per instance family.

In practice you hit the IOPS or throughput limit of either the instance's EBS-optimized network bandwidth or the aggregate volume performance well before you hit the count limit. For most workloads, fewer larger volumes outperform many small ones.

Yes. Run aws ec2 modify-volume --volume-id vol-XXX --size 200, wait for the modification to reach optimizing (the new size is visible then, not only at completed), then run sudo growpart /dev/nvme1n1 1 and sudo resize2fs /dev/nvme1n1p1 for ext4 or sudo xfs_growfs /mnt/data for XFS. The instance, its services, and open SSH sessions keep running.

growpart moves the partition table entry so the partition reaches the new end of the disk. resize2fs then grows the ext4 filesystem inside that partition so the space is usable. Both are needed, in that order: volume (modify-volume), partition (growpart), filesystem (resize2fs). A whole-disk filesystem with no partition table skips growpart.

Up to four times per volume in a rolling 24-hour period, for any kind of modification: size, type, IOPS, or throughput. Each modification must reach completed before you can start the next one. The limit is per volume, so other volumes are unaffected. If a volume might need several size bumps in a day, do the larger bump first.

No, on any volume type. aws ec2 modify-volume rejects a smaller size with InvalidParameterValue. To get a smaller volume, create one, copy the data over (rsync, or dd of a smaller filesystem), attach it in place of the old one, and delete the original.

64 TiB for gp3 and io2 Block Express (AWS raised the gp3 ceiling from 16 TiB to 64 TiB in September 2025), and 16 TiB for gp2, io1, st1, and sc1. An instance can attach many volumes, so total storage scales past a single-volume ceiling.

Sources

Authoritative references this article was fact-checked against.

TagsAWSEC2EBSElastic VolumesLinuxfstabgrowpartTerraformgp3Nitro

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Systems and Network Architect · Chief Technology Officer

Systems and network architect and Chief Technology Officer with more than two decades designing, building, and running production software, cloud and network architecture, Linux systems, and the bare metal underneath them, and lately working AI into the stack. A US Army veteran who served in Operation Iraqi Freedom. What I write here is drawn from the full arc of that work, across architecture, engineering, and operations, not any single job.

Keep reading

Related posts

Connect to an AWS EC2 instance using plain SSH with a key pair, EC2 Instance Connect, AWS Systems Manager Session Manager, or an EC2 Instance Connect Endpoint for private instances. Default usernames, security group rules, and troubleshooting Permission denied and Connection timed out.

How to SSH into an AWS EC2 Instance

Connect to an EC2 instance four ways: plain SSH with a key pair, EC2 Instance Connect, Session Manager, and EC2 Instance Connect Endpoint. Default usernames, security group rules, and the troubleshooting matrix that fixes Permission denied and Connection timed out.

Change a MySQL column type with ALTER TABLE MODIFY or CHANGE, and add one with ADD COLUMN: data preservation, INT to BIGINT, DEFAULT backfill, and INSTANT.

How to Change a MySQL Column Type

Change a MySQL column type with ALTER TABLE MODIFY or CHANGE, and add a new column with ADD COLUMN. Covers data preservation, CAST behavior, INT to BIGINT, VARCHAR widening, DEFAULT and NOT NULL backfills, and how ALGORITHM=INSTANT applies.