What means to be a root device on EC2?
Asked Answered
S

5

10

I couldn't find the answer on EC2 documentation. What is it for? If I launched an EBS backed instance, the root device for the instance would be an EBS volume. If I install a few tools/software on the instance, will those be installed on the root instance by default? Still I guess the question really came from the little understanding of the root device. Any detailed info on that?

Also if I need to launch another EBS backed instance, and also want to have the same copy of the tools/software installed on the earlier instance, how to do that?

Swaggering answered 5/7, 2012 at 15:36 Comment(0)
D
12

EC2 instances have two types of storage -- ephemeral storage, and EBS based storage -- and each instance is given a specific amount of that disk space by default. Each instance has its own allotment of disk space that it can use which is independent of any other instances disk space that you launch. You can also add an EBS volume to your drive for additional storage, but, those volumes can only be attached to one specific host at a time.

If you had two EBS instances, and you wanted to ensure that they're both using the same tools and software, you'd need to enforce that using a configuration management tool, such as puppet, chef, or cfengine.

Deform answered 5/7, 2012 at 16:19 Comment(5)
Sorry I still don't get what the definition of a "root device". Also I am not sure what the configuration management tool is needed for the question regarding the software installed on different instance, can I just take a snapshot of the EBS volume and apply the snapshot of another EBS volume to be attached/mounted to the new instance?Swaggering
Tom: The root device is the virtual device that houses the partition where your filesystem is stored -- ephemeral devices have it running on the same physical host at the server, and EBS devices have it mounted using iSCSI.Deform
So can I say that the root device == boot device?Swaggering
Tom: That's a good analogy, but a better one would be root device == default boot, operating system, and storage location.Deform
Fantastic answer! The obvious advantage of having an EBS volume as a root device is you can modify the volume from the AWS console if you run out of space and are unable to even SSM into your instance to delete large logs etc.Kessiah
I
5

This is the best answer about 'root device' so far! AWS is still new. And most of the times, the answer is just 'cut and paste' straight from AWS document, which does not help much!

https://web.archive.org/web/20140601070714/https://skeddly.desk.com/customer/portal/articles/1346918-ebs-backed-versus-instance-store

Imprecation answered 4/8, 2015 at 17:18 Comment(1)
Excerpt from that article: "An "instance store" instance is an EC2 instance whose root device resides on the virtual machine’s hard drive ... the instance’s root device is the actual hard drive, it is "stuck" on the hardware, and the only thing you can do is terminate the instance. If you do this, the instance is deleted, never to be recovered"Predikant
B
4

I agree with what Ian wrote. I would add that the "root device" in EC2 is analogous to the operating system partition in a personal computer. It is where the filesystem of your OS resides.

Blennioid answered 5/7, 2012 at 20:52 Comment(0)
S
0

This may have been added since you asked, but I believe this answers the question:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/RootDeviceStorage.html

Siccative answered 14/12, 2013 at 21:9 Comment(0)
D
0

Q: What is a root device in AWS EC2?

A: In AWS EC2 (and in Linux, in general) , the root device is the primary storage where your operating system sits alongside the root filesystem (the / path in Linux) and other critical system libraries. You can identify it accoriding to last letter which is usually a or 1:

/dev/xvda
/dev/nvme0n1
/dev/sda

(*) The 3 examples above are reveant for different types of AMIs.


Q: If I install a few tools/software on the instance, will those be installed on the root device by default?

A: If you no additioanl volumes were added on your EC2, the software will resides on one of child directories of / - which are all on your root device. But if you mounted a volume on a /someNiceMountPoint directory for example, and you're now downloading a software on the directory, that means that it will be installed on a non root device.


Q: Also if I need to launch another EBS backed instance, and also want to have the same copy of the tools/software installed on the earlier instance, how to do that?

A: You can take a snapshot of your first EC2 instance root volume (AWS recommend that you stop the instance before taking the snapshot). Then create an AMI from that snapshot and then launch an instance from that AMI.

Drinkwater answered 23/2 at 15:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.