I need to reinstall Ubuntu Server running on VMWare VPS. The simplest way would certainly be to make a fresh install from mini ISO. But it's a production server and I can't afford an hour or more of downtime. Is it possible to reinstall with almost no downtime (say, 15 minutes or so)?
In other words, I'm looking for a way to upgrade OS release on live Ubuntu Server without noticeable downtime. I will transfer all settings and data manually.
- Ubuntu Server 10.04.2 LTS amd64
- VMWare VPS with console access (I can mount a local ISO image)
- Single drive:
/boot, 92 MB on
/, 1.5 GB on LVM
/srv, 19 GB on LVM
- swap on LVM
I have no experience with Linux file system tools (
chroot and the like) yet. However, I guess a plan of action similar to the following might work (
host is target VPS machine,
upgrade is new OS):
Install upgrade OS
Install a fresh Ubuntu Server on local Virtual Box.
Transfer services and settings
Transfer services and settings from current OS to upgrade OS. I keep config as portable as possible and use
etckeeperto track configuration changes.
Copy upgrade OS file system to host
I plan to use
rsyncto copy upgrade OS file system to host. But where to place it on host? I thought of:
a separate partition; I'd need to shrink LVM
dataon host and prepare new partition for the upgrade OS file system.
a file image; I'd create a file image on host's
/srvpartition, mount it on host (don't know how to yet) and copy upgrade OS file system into it.
a folder; I'd transfer mirror into folder on host's
/srvpartition. This would be the best option IMO, if at all possible.
Replace current OS with upgrade OS file system
I'm aware it depends on where the mirror has been transfered to. In any case it should be possible to switch first to test it working and replace file systems afterwards. I can afford to reboot and use recovery console or boot mini ISO for that.
Steps 3 and 4 are main question marks on which I need instructions. If you can advice changes to my 'plan' or a different approach, please, go ahead. Reference to instructions or documentation would be appreciated.
Edit: As suggested I'd go with a clone machine if I there's no other solution.