How do I know the amount of data used in a volume attached to EC2 instance??

1

I started an EC2 instance with 30gb attached volume. How do I know the amount of volume used up of that 30gb??

TIA

질문됨 7달 전5013회 조회
2개 답변
4

Hello.

If the EC2 OS is Linux, connect via SSH and execute the following command.

df -h

For Windows, connect via RDP and execute the following command using PowerShell.

fsutil volume diskfree c:
profile picture
전문가
답변함 7달 전
profile picture
전문가
검토됨 7달 전
1
수락된 답변

To check the amount of space used on your attached EBS (Elastic Block Store) volume in an EC2 instance, you can log into your EC2 instance and use command-line utilities to inspect the disk usage. Here's how you can do it:

For Linux-based Instances:

  1. SSH into Your EC2 Instance: Use SSH to connect to your Linux-based EC2 instance. ssh -i /path/to/your/key.pem ec2-user@your-instance-public-ip
  2. Check Disk Usage: Use the df command to check disk usage on your EC2 instance. To specifically check the EBS volume, you can use the -h option to show sizes in a human-readable format.
df -h

This command will display information about all mounted volumes, including the EBS volume you attached to your EC2 instance. Look for the volume mount point (it might be something like /dev/xvdf), its size, and the amount of used space.

  1. Check Disk Usage for a Specific Directory: If you want to check the usage of a specific directory, you can use the du command. For example, to check the size of the /var/log directory:
du -sh /var/log

This will show you the total size of the /var/log directory in a human-readable format.

For Windows-based Instances:

  1. RDP into Your EC2 Instance: Use Remote Desktop Protocol (RDP) to connect to your Windows-based EC2 instance.

  2. Check Disk Usage: Open File Explorer on your Windows instance. Right-click on the drive associated with your attached EBS volume (usually D: or E:) and select "Properties." This will show you the used space and free space on the volume.

Alternatively, you can use PowerShell to check disk usage. Open PowerShell and use the Get-Volume cmdlet:

Get-Volume

This will provide detailed information about all volumes on the system, including the used space.

By using these commands, you can determine the amount of space used on your attached EBS volume in your EC2 instance.

AWS
답변함 7달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠