vca wrote:
Is this feasible? Does anyone do this? Is there a better approach?
I have the setup that you describe:
- system partition (2GB, but that is more than necessary)
- spare system partition (2GB)
- data partition
This means if I want to make any major changes (like trying a new distro), I can set it up in the spare partition. Then, if it all goes pear-shaped, I can quickly go back to the original and trouble-shoot from there. You can also use chroot to run a terminal in the new system, from the old system.
jhmartin has described well how to do it.
My data doesn't need as much rigour as he/she describes - to transfer the data I just used:
Code:
cp -av <source> <destination>
from a root login. So I didn't use single-user login, and didn't use rsync. But you need to decide what your data needs - the most important thing is that no changes get made to the data while you are copying it. (Though the -u option with cp can be useful in that case.)
Another approach that you might find easier (though this is maybe harder work for the servers), and you might feel safe doing without fully backing up first (though you should have a backup of anything important anyway):
You can duplicate entire virtual partitions from the linode dashboard now so, providing you had twice as much space as you need, you could do:
- shut down linode
- shrink image to smallest size (needs to be half or less of what you have available)
- duplicate the image using the dashboard
- start linode
- mount duplicated image
- delete system files (anything that is not 'data') from duplicated image
- delete 'data' files from original image
- if necessary, remount duplicated image in it's final resting place
- shutdown and resize images from the dashboard
Personally, I like to mount the whole partition, then remount bits of it elsewhere, like this (note the last line from my /etc/fstab):
Code:
/dev/xvda / ext3 defaults 0 1
/dev/xvdb none swap auto,defaults 0 0
/dev/xvdc /mnt/data ext3 auto,defaults 0 0
/dev/xvdd /mnt/spare ext3 auto,defaults 0 0
/mnt/data/home /home none rw,bind 0 0