By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Increase storage rocky linux 7 ec2

0

how to increase storage in default is 10 Gb storage but im built to 300 Gb but in dh -h just 10 Gb how, storage is 300 Gb

asked 10 days ago37 views
3 Answers
5

Hello,

If it's for the root directory ("/"), simply restarting your instance should do the trick. If it's for a mounted volume, you can use the command: xfs_growfs -d <DEVICE_NAME>

To find the device name, you can run: lsblk

The device name will typically look like /dev/something

Hope it helps! 😊

profile pictureAWS
answered 10 days ago
profile picture
EXPERT
reviewed 9 days ago
1

Hi,

You may want to read this stream to obtain the specifics of partition extension for Rocky Linux: https://forums.rockylinux.org/t/how-can-i-extend-a-partition-capacity/11475/6

profile pictureAWS
EXPERT
answered 9 days ago
profile picture
EXPERT
reviewed 9 days ago
0

When you increase the storage size of an EC2 instance in AWS, the change is not automatically reflected in your operating system. You need to take additional steps to make the increased storage available on your Rocky Linux 7 instance. Here's how to do it:

  1. First, verify that AWS has recognized the storage increase to 300 GB. You can do this in the EC2 console or by using AWS CLI.

  2. Once confirmed, you need to extend the partition on your instance to use the additional space. You can use the 'growpart' command for this purpose:

    sudo growpart /dev/xvda 1

    (Replace /dev/xvda with your actual device name if different)

  3. After extending the partition, you need to resize the file system to use the newly available space. For ext3/ext4 filesystems, use the 'resize2fs' command:

    sudo resize2fs /dev/xvda1

    (Again, adjust the device name if necessary)

  4. If you're using XFS filesystem instead, use 'xfs_growfs':

    sudo xfs_growfs /

  5. After completing these steps, run 'df -h' again, and you should see the full 300 GB of storage available.

Remember to be cautious when modifying partitions and filesystems, as incorrect steps can lead to data loss. It's always a good idea to back up your data before making such changes.

If you encounter any issues or if these steps don't resolve the problem, you may need to check your specific partition setup or consult AWS support for further assistance.
Sources
EC2 Storage increased in AWS but not showing in Linux server | AWS re:Post
Why isn't my EC2 storage space upgrading? | AWS re:Post

profile picture
answered 10 days ago
profile picture
EXPERT
reviewed 9 days 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.

Guidelines for Answering Questions