0

I kind of know that sda comes from SCSI device from early Unix/Linux days. However, I had some trouble when I was playing around with detaching/attaching Volumes to my AWS EC2 Instances.

What I understand is that when the attachment is complete, it's visible as a "Block" device. Or, so does this link claims. So, AMIs are backed by either EBS-based or instance-based root device volume.

So, does this mean that if an AMI is backed by an EBS-based root device volume it will be /dev/xvda? Or, could it be anything else?

ha9u63a7
  • 101
  • 1
  • 3
  • I might have answered my own question ? https://askubuntu.com/questions/166083/what-is-the-dev-xvda1-device#:~:text=Virtual%20storage%20devices%2C%20representing%20cloud,SCSI%2Dlike%20storage%20device). – ha9u63a7 Nov 14 '20 at 14:41

1 Answers1

0

You can't count on the device name being /dev/xvda. On newer instances they have names more like /dev/nvme0n1p1 - I copied that from a t3a.nano.

What problem are you trying to solve?

Tim
  • 31,888
  • 7
  • 52
  • 78
  • If I detach a volume, and then want to re-attach it, I need to provide a device ID - the challenge is to figure out what device id that should be. – ha9u63a7 Nov 14 '20 at 17:59
  • Are you taking about the `--device` parameter in a aws cli call? https://docs.aws.amazon.com/cli/latest/reference/ec2/attach-volume.html From my experience it doesn't matter what you supply here, as long the name is unique. The hypervisor will choose another name anyways if the naming scheme doesn't match its own. – Alexander B Nov 17 '20 at 13:38