Skip to content

/dev/nvme0n1p1 on ec2 takes up too much disk space.

0

ec2's /dev/nvme0n1p1 takes up too much disk space. Even though I erased all the unnecessary files, such as logs, there was so much space in it that ec2 got abnormal. What should I do?!! 여기에 이미지 설명 입력 여기에 이미지 설명 입력

asked 2 years ago900 views

1 Answer
0

I understand you're facing a critical issue with disk space on your EC2 instance, specifically with the /dev/nvme0n1p1 partition. This situation can indeed cause abnormal behavior in your EC2 instance. Let's address this problem step by step:

  1. First, it's important to note that simply deleting log files may not always be sufficient to free up space, especially if the disk is severely full. When a disk reaches near 100% capacity, it can cause various system issues.

  2. Based on the information provided, it appears that your root device (/dev/nvme0n1p1) is completely full, showing 100% usage. This is a critical situation that needs immediate attention.

  3. To resolve this, you have a few options:

    a. Increase the size of your EBS volume:

    • You can modify the size of your EBS volume without stopping your instance.
    • After increasing the size, you'll need to extend the file system to use the new space.

    b. Add a new EBS volume:

    • Attach a new EBS volume to your instance.
    • Move some data to this new volume to free up space on the root volume.
  4. If you choose to increase the size of your existing EBS volume:

    • Use the AWS Management Console, AWS CLI, or AWS SDKs to modify the volume size.
    • After the volume is resized, you'll need to extend the file system on the device.
    • For a Linux instance, you can use commands like growpart and resize2fs to extend the partition and file system.
  5. After increasing the volume size and extending the file system, reboot your instance to ensure all changes take effect properly.

  6. For future prevention:

    • Regularly monitor your disk usage using tools like CloudWatch.
    • Implement log rotation and cleanup scripts to manage log files.
    • Consider using larger instance types or EBS volumes if you consistently need more space.

Remember, it's crucial to maintain sufficient free space on your root volume to ensure proper functioning of your EC2 instance. If you're not comfortable performing these operations, consider seeking assistance from an AWS professional to avoid any data loss or further complications.
Sources
Decoding Instance-State log in EMR | AWS re:Post
Troubleshoot status check failures on an unreachable EC2 Linux instance | AWS re:Post
Increase the size of an EBS volume on your Mac instance - Amazon Elastic Compute Cloud

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.