Unable to resize root partition on EC2 centos

This is what it had to be done

  1. Stop the instance
  2. Create a snapshot from the volume
  3. Create a new volume based on the snapshot increasing the size
  4. Check and remember the current's volume mount point (i.e. /dev/sda1)
  5. Detach current volume
  6. Attach the recently created volume to the instance, setting the exact mount point
  7. Restart the instance
  8. Access via SSH to the instance and run fdisk /dev/xvde
  9. Hit u to change display units tosectors
  10. Hit p to show current partitions
  11. Hit d to delete current partitions (if there are more than one, you have to delete one at a time) NOTE: Don't worry data is not lost
  12. Hit n to create a new partition
  13. Hit p to set it as primary
  14. Hit 1 to set the first cylinder (it musts be the same first cylinder of your old partition)
  15. Set the desired new space (if empty the whole space is reserved)
  16. Hit a to make it bootable
  17. Hit 1 and w to write changes
  18. Reboot instance
  19. Log via SSH and run resize2fs /dev/xvde1
  20. Finally check the new space running df -h


No comments yet.

Leave a Reply