Difference between revisions of "Programming/Linux/Working with AWS instances"

From Thalesians Wiki
(Created page with "=Elastic storage= Once you have changed the size of a volume using AWS's elastic storage, the changes won't be immediately reflected in <pre> df -h </pre> New volumes should be formatted to be accessible. Resized existing volumes should also be modified (resized) from inside the operating systems. A detailed discussion of these aspects can be found in * [|Making an Amazon EBS volume available for use on Linux] * [|Extending a Linux file system after resizing a volume]...")
 
Tag: Manual revert
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:


New volumes should be formatted to be accessible. Resized existing volumes should also be modified (resized) from inside the operating systems. A detailed discussion of these aspects can be found in
New volumes should be formatted to be accessible. Resized existing volumes should also be modified (resized) from inside the operating systems. A detailed discussion of these aspects can be found in
* [|Making an Amazon EBS volume available for use on Linux]
* [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html|Making an Amazon EBS volume available for use on Linux]
* [|Extending a Linux file system after resizing a volume]
* [https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html|Extending a Linux file system after resizing a volume]


However, as a quick solution, run the following two commands, in the given order, after resizing a volume:
However, as a quick solution, run the following two commands, in the given order, after resizing a volume:
Line 20: Line 20:
df -h
df -h
</pre>
</pre>
This information comes from [https://stackoverflow.com/questions/62146336/new-volume-in-ec2-instance-not-reflecting|this Stack Overflow post].

Latest revision as of 22:36, 14 December 2023

Elastic storage

Once you have changed the size of a volume using AWS's elastic storage, the changes won't be immediately reflected in

df -h

New volumes should be formatted to be accessible. Resized existing volumes should also be modified (resized) from inside the operating systems. A detailed discussion of these aspects can be found in

However, as a quick solution, run the following two commands, in the given order, after resizing a volume:

sudo growpart /dev/xvda 1
sudo resize2fs /dev/xvda1

The volume size changes should then be reflected in

df -h

This information comes from Stack Overflow post.