Adding Storage to EC2 instance that’s already created

0

I am having issues in regards to adding storage onto my instances I have already created and have been using for awhile. My storage is low so I decided to add more storage. I added 30GB of storage to each instance (General Purpose SSD (gp2) changed to 60 GiB from 30 GiB, when I sign onto the server it doesn’t show up in the storage but it shows up in my disk management that I have 30GB unallocated. What do i need to do to get the 30GB I added to the instance onto the server itself?

asked a year ago1283 views
3 Answers
3

this is more related with linux

you need to extend storage

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

please read the link and follow these steps

  1. Identify the device name of the new volume that you attached to your instance. You can do this by running the command lsblk in your server's terminal. The output will show you a list of all the attached devices along with their device names and sizes.
  2. Create a file system on the unallocated space using the appropriate command for your file system type. For example, if you're using an ext4 file system, you can use the command sudo mkfs -t ext4 /dev/xvdf1 to create the file system on the device named /dev/xvdf1.
  3. Create a mount point directory for the new file system. This can be any directory in your server's file system that you want to use as the access point for the new storage. For example, you can use the command sudo mkdir /mnt/new-storage to create a new directory named new-storage under the /mnt directory.
  4. Mount the new file system to the mount point directory using the command sudo mount /dev/xvdf1 /mnt/new-storage. This will make the new storage available at the /mnt/new-storage directory in your server's file system.
  5. Optionally, you can configure the file system to mount automatically at boot time by adding an entry to the /etc/fstab file. For example, you can add the following line to the file: /dev/xvdf1 /mnt/new-storage ext4 defaults 0 0.
profile picture
EXPERT
answered a year ago
1
Accepted Answer

Hey,

I'm Assuming this is Windows instance and 30GB vol is your C drive ( root Volume), but below solution should work for non root volumes as well. Once you allocate EBS storage at the cloud, you will still have to login to the EC2 Instance and complete the disk configuration from the OS perspective. This is like any addition of Disk at the OS level. follow below steps

Extending the file system using Disk Management

  1. Connect to your EC2 Windows instance using Remote Desktop Protocol (RDP).
  2. Open a command prompt, and then run the diskmgmt.msc command to launch Disk Management. From Action, choose Refresh.
  3. Open the context (right-click) menu for the Volume, and then choose Extend Volume.
  4. Choose Next, Next, Finish.

for more details, Please check the following article from AWS.

Windows : https://repost.aws/knowledge-center/expand-ebs-root-volume-windows
Linux : https://repost.aws/knowledge-center/expand-root-ebs-linux

answered a year ago
profile pictureAWS
EXPERT
reviewed a year ago
0

As mentioned in the other replies, the OS has to extend the file system. You've presented the larger storage to the instance. The instance itself "sees" the additional storage, but it lacks a file system. So, this is similar to seeing an additional partition on the disk because the file system only covers what you had before. See the other replies from the 2 other authors, based upon your OS to extend the file system.

AWS
answered a year 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