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.