2

I want to write data directly to an unmounted raw EBS volume (with no file system) using system calls.

1) Can I can do this via the EC2 instance to which the EBS is connected?

2) Can I provision raw EBS volumes without having an associated EC2 instance and read/write to them via an API?

swami
  • 145
  • 4
  • 1. yes, because when an ebs volume is attached to an ec2 instance you need to first create a file-system before mounting the volume. This works because it is accessible as a device (/dev/something) 2. interesting idea... I'm curious to see what comes up – DanJ May 29 '20 at 19:21

1 Answers1

1

Yes, you can read and write directly to an EBS volume from an EC2 instance. They are block devices, and follow all the expected semantics.

In practical terms, you cannot read from or write to an EBS volume other than through the EC2 instance to which it is attached. Again, they are block devices... there's no mechanism of access other than by attaching them to an EC2 instance.

Although... snapshotting an EBS volume does not require that it be attached to an instance, which means it is possible to take a snapshot of a volume, and then use the EBS Direct API to read raw data from the snapshot, so technically it's possible to read from an EBS volume with no EC2 instance attached, albeit indirectly and pretty convoluted. With this, you can read but not write.

Michael - sqlbot
  • 21,988
  • 1
  • 57
  • 81