EBS: Resize a Volume
Greg DeKoenigsberg edited this page Nov 19, 2012
·
2 revisions
You can resize an EBS volume by creating a new volume of the target size and copying the contents to the new volume by following these steps. # indicates commands on CLC, $ indicates commands inside a "scratch" instance:
- A "scratch" instance running in your Eucalyptus cloud onto which you can attach volumes. This instance must have the "parted" package installed.
- The source volume to be resized.
- Create a new volume with the target size. Say, 100GB:
# euca-create-volume -s 100 -z cluster01
- Attach both source and destination volumes to a "scratch" instance:
# euca-attach-volume -i i-SCRATCH vol-OLDVOLUME -d /dev/vdc
# euca-attach-volume -i i-SCRATCH vol-NEWVOLUME -d /dev/vdd
- Verify the attachments by logging into the scratch instance and running "fdisk -l" to determine the actual device names of the newly-attached volumes. Then, in the scratch instance, "dd" the contents of source volume (/dev/vdc) to destination volume (/dev/vdd):
$ dd if=/dev/sdc of=/dev/sdd bs=1M
- Rescan the partitions and then resize the partition and then resize the filesystem:
$ partprobe /dev/sdd
$ parted /dev/sdd rm 1
$ parted /dev/sdd mkpart primary ext2 0% 100%
$ e2fsck -f /dev/sdd1
$ resize2fs /dev/sdd1
- If this new volume is intended to be used as an EBS-backed image, log out of the scratch instance, detach the new volume, create a snapshot, and register it:
# euca-detach-volume vol-NEWVOLUME
# euca-create-snapshot vol-NEWVOLUME
# euca-register -n "resized BFEBS" --root-device-name /dev/vda -b /dev/vda=snap-XXXXXX
code on Github | bugs on Jira | questions on StackOverflow | chat on IRC
Made available under the CC-BY-3.0-US license.
© 2015 Hewlett-Packard Development Company, L.P.
Index of Categories
- category.HOWTO
- category.Training
- category.Troubleshooting
- category.UNCATEGORIZED
- category.aws-compatibility
- category.blueprints
- category.bugs
- category.ceph
- category.community
- category.components
- category.confluence
- category.contributing
- category.contributions
- category.cors
- category.debugging
- category.design
- category.developer
- category.docs
- category.docs-team
- category.ebs
- category.eustore
- category.events
- category.examples
- category.faqs
- category.fedora
- category.gsoc
- category.ha
- category.hackfests
- category.images
- category.infrastructure
- category.install
- category.legacy
- category.meetings
- category.monitoring
- category.networking
- category.objectstorage
- category.participation
- category.people
- category.releng
- category.reporting
- category.riakcs
- category.stats
- category.storage
- category.tools
- category.training
- category.troubleshooting
- category.ui