Digging my own Ditch

Archive for the ‘Amazon’ Category

How to increase the size of vol on AWS

Friday, November 20th, 2009

OK. First a huge disclaimer. If you’re a regular reader of this blog you’re not going to be interested in this post.

It’s a technical post which I’m leaving partly because I found the information very hard to find online, and partly because I’ll probably reference myself it in the future.

I should also point out we have a great sysadmin who looks after the Aroxo production system, but I’ve got a “knock about” server which I like to play with to help me understand what I’m doing, what I’ve done here refers to that server.

So here’s the scenario: you’re hosted using Amazon Web-Services EC2 platform. You’ve created a volume to store your data on, and you’ve run out of space. How do you increase the space on /vol using AWS?

Here are the steps which after a lot of messing around and a lot of help about I eventually found to work, some of this is based on this post. This might not be the most efficient way and some steps might be unnecessary and it’s based on a Debian install, maybe that makes a difference, maybe it doesn’t:

  1. Log onto your machine using SSH
  2. Type
    umount /vol

    to unmount your drive (note it’s umount, not unmount)

    1. If your machine tells you that the drive is use, and it probably will, do this:
    2. fuser -m /vol
    3. You’ll get a list of the process IDs which are currently using the drive
    4. I then just killed them using
      kill xxxx

      but there’s probably a smoother way to shutting them down, you might want to think about that, like a clean shutdown of Apache and mysql at least

    5. Type
      umount /vol
  3. Go to your AWS console
  4. Detach this drive from your instance
  5. Create a snapshot based on the volume and wait for it to complete
  6. Create a new, larger, drive based on the snapshot
  7. Attach the new drive (remember the mount point, maybe something like /dev/sdf)
  8. Back to SSH type
    mount /dev/sdf /vol
  9. Type
    xfs_growfs /vol
  10. Restart the box or the services you unceremoniously killed
  11. Check everything
  12. Breath a sigh of relief
  13. Make a cup of tea and find some to tell who’s likely to be impressed (if you find anyone, let me know).

That’s what I did, it worked but it wasn’t pretty.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes