Re: Moving VM hosts with ubuntu install

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: kitepilot@kitepilot.com
Date:  
To: kfries6, Main PLUG discussion list
Subject: Re: Moving VM hosts with ubuntu install
Option 3 will not work if the machine is running, add I think dd is a can of
worms...

I have done this some 921752163 times, so here is my cookbook:
1.- Boot both puters with a CD, Ubuntu install will work, but you'll have to
"apt-get install ssh" in at least one of them, and set a password for root.
For the sake of example, I'll assume that both computers are booted from CD,
that both are running SSH and that you are comfortably sitting at your desk
with one xterm open in each one. For the sake of example also, I'll also
assume that your src puter's HD has only one filesystem.

2.- In SRC puter do "mount -ext? -o ro /dev/sda? /mnt"
(Make RO as safety net...)

3.- In DST puter do:
mke2fs -Text4 -U USE-UUID-FROM-SRCputer-HERE /dev/sda1
"mount -text? /dev/sda? /mnt"

4.- In SRC puter do:
rsync -XHav --checksum --super /mnt/ root@DSTputer:/mnt
Go get a pizza...

5.- Reinstall grub, if you used the -U option, the UUIDs are OK and you
don't have to tinker with menu.lst.

7.- Verify that /etc/fstab matches your new parameters, including swap.
Either assign the same UUID to the swap partition or update /etc/fstab.

8.- Reboot your new puter and enjoy the ride... :)

There are only 245326532456 +1 variations to this recipe, but it has worked
flawlessly for me for years.
If you want to change the hostname, it may be more involving than just
changing /etc/hostname, but I won't go there...
YMMV
ET

PS: If you have any question you will get any answer... :)





Kevin Fries writes:

> Tricky question not because it is hard, but because there are multiple answers depending on what you are trying to achieve.
>
> Option 1 - backup the installed packages, etc, var, home then have Ubuntu simply install all your packages again (google for get-selections). This lets you move and upgrade at the same time (single core to multicore, etc)
>
> Option 2 - create a dd disk image of each of your partitions to a removable hard drive. Then recreate your partition scheme on the new machine (sfdisk makes this very easy), then restore you partitions. This will essentially clone your existing machine, exactly as before. Also great for tuning a standalone into a VM
>
> Option 3 - tar your system, then untar it on the new machine. Quite simple, but effective. You won't get new packages like you would in opion 1, but you can change your partition sizes unlike option 2.
>
> Linux is quite flexible, with a little more info, we could probably help you decide the best coarse of action.
>
> Good luck
> Kevin
>
> Sent from my Nokia phone
> -----Original Message-----
> From: Stephen
> Sent: 02/17/2010 4:09:44 PM
> Subject: Moving VM hosts with ubuntu install
>
> What is the best suggestion for moving an Ubuntu installation?
>
> I'm guessing a form of Backup and restore, but this oddly enough is
> not something i have done before in Linux.
>
> anyone have some place i should start?
>
> --
> A mouse trap, placed on top of your alarm clock, will prevent you from
> rolling over and going back to sleep after you hit the snooze button.
>
> Stephen
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss