Shrinking a Volume

dreamcompute

#1

So I think I’ve mostly got my DreamCompute instance set up, except for one thing; I foolishly allocated my full storage allowance as a single volume, but I could really use a second.

Could someone give me an overview of what I need to do to reduce the size of my volume so I can allocate the free space into another? My current volume is formatted as ext4 with an Ubuntu 14 instance running on it.

Basically my plan is to setup a second volume for nothing but backups, onto which I’ll put frequent backups of databases and sites (e.g- mysqldump and rsync stuff across). I can then use infrequent snapshots as a fallback in case the OS/filesystem somehow becomes damaged; in other words I don’t want to rely on snapshots alone, as I want to be able to restore single databases/sites if necessary.

I suppose I could still do this with a single volume, but it seems neater to use two.


#2

Shrinking is definitely more involved than growing a volume. If you haven’t made any major changes or things you can’t reproduce, the easier path is probably upgrading to a larger plan, making a new smaller volume with a new instance, copying over the changes, destroying the old instance and volume, and downgrading your plan. Otherwise, shrinking in place gets tricky because most utilities that do this want it unmounted, and as the primary partition for your OS it is hard not to mount it and still use the utilities on it.

As for backups, there is DreamObjects (cloud object storage) which is great for holding such data. The pricing starts at $0.025/GB/month for storage, and you can copy data to it via the command line with tools like s3cmd, boto-rsync and others.

If you do want to go the shrinking route, I can check with others in our cloud dept if they have some other idea. And if you have any other questions about DreamObjects, let me know!


#3

Depending on the needs of your application and current disk utilization, there could be other options than those suggested by JustinK. One I’m thinking is, if 80Gb are enough you could spin up another machine with ephemeral disk, copy your stuff over to the ephemeral disk, destroy the old volume and rebuild it as you need.

Using DreamObjects to store files is a good idea that I’d explore more in details as it’s the best way to deal with just files, a lot more reliable than any volume. Check this article for example: http://wiki.dreamhost.com/How_to_Use_duplicity_with_DreamObjects


#4

DreamObjects does look pretty interesting for keeping a more secure copy, thanks!

But what about backup history, does it have any facility for taking snapshots of buckets or anything like that? My normal backup tool of choice would be rsync using --link-dest pointed at a previous backup, as this lets me to create backups easily without copying unchanged files. Not quite as sophisticated as ZFS send or whatever, but it’s always suited my needs before, I just need somewhere to send the backups, and foolishly forgot about that when I was setting up my instance :slight_smile:

I’ll definitely take a look at DreamObjects though, that guide using Duplicity seems pretty straightforward, so that should be good for handling my disaster recovery needs, but I like to have backup history too so I can pick a more specific moment in time if I know when an issue occurred, or just in case I somehow delete a file I shouldn’t have etc.