1 Answer
- Newest
- Most votes
- Most comments
0
Using pure native tools you can only increase the size of your EBS volume, not decrease it. To decrease it we need to make a new volume then copy the data over. Please take additional considerations in case the volume is bootable, if so test for booting functionality in a test copy before committing to prod.
Typically I would:
- -~~Take a snapshot of the volume after shutting down the instance. ~~(As Leo noted in the note, this is not needed in this case since it wouldn't help.)
- -
Use the snapshot tocreate a new volume to match the size (If it doesn't fit under 100GB you will have to manage data yourself to get to your ideal size of 100GB) - -Attach it to the instance
- -Depending on our OS, use your appropriate tool to ensure it is recognized by the OS such as creating partitions using fdisk on Windows.
- -Copy all teh data.
- -Again if we are booting from this volume ensure you handle your boot loaders in this case.
- -Finally shutdown the instance to deattach the old drives, handle any bootable drive items such as making it bootable.
- -Reboot
Ensure you test this if you are on production on a non production environment if possible.
For more information check out these docs: https://docs.aws.amazon.com/ebs/latest/userguide/requesting-ebs-volume-modifications.html
answered 21 days ago
Relevant content
- asked 8 months ago
- asked a year ago
- asked 10 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
You can't create a 100-GiB volume from a 1500-GiB snapshot. Creating a snapshot before doing anything else is a good idea, but only for backup purposes. The resizing effort goes as you started to explain, but instead of creating a new volume from the snapshot, they should create an empty volume of 100 GiB, attach it to the instance, and while both the 1500-GiB old volume and the 100-GiB new empty volume are attached, copy the data over. Finally, unmount and detach the old EBS volume from the instance, and mount the file systems from the new volume.