For using a cluster filesystem like OCFS or sharing read-only data between machines, one needs to attach the same SAN volume/LUN to multiple servers at the same time.

How can I do that with EBS volumes on Amazon EC2 ?

console.aws.amazon.com seems not to allow attaching an already attached volume and the Amazon documentation doesn't contain "multiattach". Perhaps I need another keyword to search for ?


Now you can do it with Provisioned IOPS io1 volumes.

AWS Announcement:

You can now enable Multi-Attach on Amazon EBS Provisioned IOPS io1 volumes to allow a single volume to be concurrently attached to up to sixteen AWS Nitro System-based Amazon Elastic Compute Cloud (Amazon EC2) instances within the same Availability Zone.

Note that it's necessary to use file systems designed for multi-writing or replication like GFS2 or OCFS2.

  • Great improvement, but not available for t2 instances that I'm using currently. After they introduced Nitro I had a quick performance test in summer 2019 and my workload was slower by a factor of 2.5(!) on t3 compared to t2. I did not do any analysis of the root cause yet. – Juergen Feb 21 '20 at 13:20
  • According to docs.aws.amazon.com/AWSEC2/latest/UserGuide/…, multi-attach is available only in the us-{east,west}-[12] and ap-northeast-2 Regions. I'm using eu-central-1, so I have to wait. – Juergen Feb 21 '20 at 23:48
  • List of Nitro-System based instance types > docs.aws.amazon.com/AWSEC2/latest/UserGuide/… – Elijah Lynn Mar 26 '20 at 7:06
  • GovCloud is not yet available either (my use case). – Elijah Lynn Mar 26 '20 at 7:08

You cannot do this. The EC2 API does not allow for it.

  • 1
    @Juergen, this is documented in the EBS section of the EC2 faq: Q: Do you support multiple instances accessing a single volume? While you are able to attach multiple volumes to a single instance, attaching multiple instances to one volume is not supported at this time. – Michael - sqlbot May 27 '16 at 22:08
  • 1
    Amazon added limited support for multiattach in Feb 2020 - see Dmitrii Narkevich's answer. – Juergen Feb 21 '20 at 23:51

If you want to do this, use Elastic File System (EFS) rather than Elastic Block Storage (EBS).



  1. It is much slower with small files
  • That has already been suggested in another answer, where I commented: EFS is file oriented, not block oriented. And S3 seems not useful for block storage (= mounting as a Linux block device). – Juergen Jun 2 '16 at 9:19
  • And it is similar to a network drive in the fstab. Costs are high until realise you are not paying for unused capacity. For volatile needs it can be cheaper. Good for logs and archives or a staging area. (Semaphores and tokens as well if you are database averse). – mckenzm Feb 13 '18 at 1:55

EBS is for a single instance only. Sharing an EBS instance would be like putting the same physical disk in two machines.

If you want two instances of the disk you can create an EBS snapshot or an AMI based on that EBS disk. This would let you run multiple instances of a web server, for example.

If you really want shared storage for data look at Amazon EFS, or you could use S3.

  • EFS is file oriented, not block oriented. And S3 seems not useful for block storage (= mounting as a Linux block device), or is it ? – Juergen May 29 '16 at 12:14
  • I think you're right, EFS and S3 are file storage not block storage, and that EBS is the only block store on Amazon. What are you actually trying to achieve? Multiple instances of the same server running? – Tim May 29 '16 at 19:20
  • Actually I wanted to use OCFS and Cluster LVM in a 3-node-cluster, which needs a shared SAN as its basis. Now it seems clear that cannot be done, not even using drbd as a SAN replacement, because drbd only allows two and not three mirrored disks. I'll be trying gluster instead. – Juergen Jun 2 '16 at 9:23
  • You could perhaps consider setting up one of the EC2 instances as a file server? – Tim Jun 2 '16 at 19:18
  • That single non-clustered file server instance would be the single point of failure that I wanted to prevent from. That's why I asked for multiattach to support OCFS as filesystem in the question. – Juergen Jun 3 '16 at 13:03

As stated by EEAA, you can not do that.

However, a workaround exists: attach the EBS volume to a single Linux instance, then export the device via iSCSI. Now on the "client" instances you simply had to attach the volume as a normal iSCSI drive.

Fot the sake of completeness: remember that traditional filesystems are not cluster aware. If you concurrently mount a disk from two iSCSI client, you will (more or less) instantly corrupt your filesystem (ext4 at least; xfs has some security safeguard that should prevent a double-mount). You had to use a cluster aware filesystem, as OCFS (as you suggested) or GFS2.

  • Using a singe "gateway" instance would destroy the cluster approach of preventing from a single point of failure. And if I had a multiattach feature, I would not only use it for a cluster filesystem, but also for Cluster LVM: Allocate a sufficiently large Block of several gigabytes from Amazon and suballocate (and free) smaller blocks to resize individual filesystems as needed. – Juergen May 29 '16 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.