Which EBS drive attached to my Amazon EC2 instance contains root volume?

Posted on

Which EBS drive attached to my Amazon EC2 instance contains root volume? – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, amazon-ec2, filesystems, amazon-ebs, .

I have an Amazon EC2 instance that has two EBS drives associated with it: an 8 GB drive at /dev/sda1, and a 20 GB drive at /dev/sdf. I didn’t set this up so I’m not sure why this instance needs two drives of those sizes.

I’m trying to figure out which of these two EBS drives contains the root (/) volume. (My goal is to disconnect that drive and attach it to another instance, where I can gain access to a key file I need at /home/ec2-user/.ssh/authorized_keys, per this excellent answer.)

How can I tell? (What is /sda1 and /sdf?)

Solution :

Just do a df -h. This will tell you if the 8G disk is mounted on / or the 20G one. Then just go to the EC2 web console and detach the disk.

“sda” term us usually used for SCSI drivers. I suggest you to read up a bit about Linux device files. It’ll help you a lot.

First, lets find the root device (probably it is /dev/sda1) with mount command. You will see your disk device with corresponding line where “on” is /.

Then you shoudl go to the AWS management console, EC2 section, find your instance, scroll down to the Block Devices section, then you’ll see attached EBS Volumes to the intance and their IDs. Using this data you can find your Volume by its ID in the Volumes section.

It is almost certainly the one without the numeric subscript, as this is a general indicator of a boot volume, presumably to prevent further partitioning but possibly just as likely for bootloader purposes (so grub is not easily broken?).

We are frequently cleaning up volumes ($$$) that have not been terribly well documented, and mounting them to an arbitrary instance for an investigation is often required. I’ll admit I use Webmin for this from time to time as it is good for poking around. It would be really good if we could mount to the console in a similar fashion. I’m not lazy, it’s hard work, and frought with risk.

Leave a Reply

Your email address will not be published.