FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-30-2008, 07:29 PM
"Benyamin Dvoskin"
 
Default Clone a running gentoo machine onto another machine

Hi All ,

I've been wondering how one can clone an entire gentoo system and copy it to another physical machine , while the original system is still running ( means , ghost , acronis and other tools that force me to shutdown the system are not acceptable )


So , someone told me to try just "tar" the whole system to the other machine and "untar" it there.

The question is how can I do that ? what are the correct attributes and flags ?

Or maybe someone have other ideas ?


Thanks

Benyamin
 
Old 03-30-2008, 07:48 PM
Hal Martin
 
Default Clone a running gentoo machine onto another machine

Benyamin Dvoskin wrote:
> Hi All ,
>
> I've been wondering how one can clone an entire gentoo system and copy
> it to another physical machine , while the original system is still
> running ( means , ghost , acronis and other tools that force me to
> shutdown the system are not acceptable )
>
> So , someone told me to try just "tar" the whole system to the other
> machine and "untar" it there.
It is possible, that I know, but it is also difficult.
>
> The question is how can I do that ? what are the correct attributes
> and flags ?
You cannot use tar unless you create an exclude file, as it will copy
the contents of /dev and /sys, which means the entire contents of RAM,
and anything that is currently being generated by your devices will be
copied as well.

Personally, I would use either tar or rsync to do this, however, in
saying that, I have never actually done this with a live system. This is
the tar command I use for copying inactive systems, and it works quite well.

(cd /mnt/source; tar cfpl - .) | (cd /mnt/dest; tar xfp -)

I assume you could just generate an exclude file, and include that in
the first command ('tar cfpl - .') and it *should* work for you.

The other way would be to use rsync, which I have less experience using,
but should do the job.

rsync -avHp --progress / /mnt/dest/

There's a space between / and /mnt/dest, just incase that's unclear...
>
> Or maybe someone have other ideas ?
Again, you'd have to find a way to exclude /dev /sys, and probably
another directory or two too, but again, I don't really have any
experience copying a live system. I'm sure other learned people on this
list will have lots of useful suggestions for you!
>
> Thanks
>
> Benyamin
-Hal
--
gentoo-user@lists.gentoo.org mailing list
 
Old 03-30-2008, 08:05 PM
Neil Bothwick
 
Default Clone a running gentoo machine onto another machine

On Sun, 30 Mar 2008 15:48:54 -0400, Hal Martin wrote:

> You cannot use tar unless you create an exclude file, as it will copy
> the contents of /dev and /sys, which means the entire contents of RAM,
> and anything that is currently being generated by your devices will be
> copied as well.
>
> Personally, I would use either tar or rsync to do this, however, in
> saying that, I have never actually done this with a live system. This is
> the tar command I use for copying inactive systems, and it works quite
> well.
>
> (cd /mnt/source; tar cfpl - .) | (cd /mnt/dest; tar xfp -)
>
> I assume you could just generate an exclude file, and include that in
> the first command

You don't need an exclude file to avoid /dev and /sys because they are on
separate filesystems, so your use of -l takes care of this.

Rsync may work, or it may complain that files have changed between
building the list and copying them and you'd need to use -x to do the
same as -l with tar. Either way, shut down as many services as possible
during the copy, particularly anything that uses databases.


--
Neil Bothwick

If you got the words it does not mean you got the knowledge.
 
Old 03-30-2008, 08:40 PM
Tim
 
Default Clone a running gentoo machine onto another machine

Benyamin Dvoskin wrote:
> Hi All ,
>
> I've been wondering how one can clone an entire gentoo system and copy
> it to another physical machine , while the original system is still
> running ( means , ghost , acronis and other tools that force me to
> shutdown the system are not acceptable )
>
> So , someone told me to try just "tar" the whole system to the other
> machine and "untar" it there.
>
> The question is how can I do that ? what are the correct attributes and
> flags ?
>
> Or maybe someone have other ideas ?
>
> Thanks
>
> Benyamin
Could you be more specific about the destination machine? Is it already
running some Linux distro, or is it a new machine with no OS? If it's
the latter, you'll have to be more careful with the boot procedure,
kernel options, etc.

-Tim
--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 04:22 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org