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, 09:52 PM
"Benyamin Dvoskin"
 
Default Clone a running gentoo machine onto another machine

It is a running gentoo system in this case

But it doesnt make a difference to me. I want to know generally.


anyway I will try what everyone wrote here and we'll see how it goes.

Thanks again.




On Sun, Mar 30, 2008 at 11:40 PM, Tim <root@pneumaticsystem.com> wrote:

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
 
Old 03-31-2008, 03:29 PM
YoYo Siska
 
Default Clone a running gentoo machine onto another machine

Benyamin Dvoskin wrote:

It is a running gentoo system in this case

But it doesnt make a difference to me. I want to know generally.


anyway I will try what everyone wrote here and we'll see how it goes.

Thanks again.




Btw You can also do a
mount --bind / /mnt/something
and then you will see the "original" root in /mnt/something without any
of the other filesystems. This is sometimes better if you want an exact
copy, because fex /dev usually has some basic nodes which get covered by
the udev's tmpfs, and althought you normally don't need them...


I "cloned" a few running systems this way (copied it to an usb disk,
setup lilo and took the disk to another machine but it was always
with mount -o remount,ro / and the systems were minimal (system+few
packages, almost nothing running, so it was possible to remount it ro)


yoyo
--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-01-2008, 07:53 PM
Eric Martin
 
Default Clone a running gentoo machine onto another machine

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Neil Bothwick wrote:

| 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.

If you are using lvm you could also make a snapshot of your running
system (after stopping databases etc) and then start the services and
just grab stuff off of the snapshot. That way you're getting a snapshot
in time as opposed to a very large window of data.
- --
Eric Martin
PGP fingerprint = D1C4 086E DBB5 C18E 6FDA B215 6A25 7174 A941 3B9F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH8pKxdheOldgSlQgRAhO3AJ9+rZB8E/DSZ4vGe0+I1MdXf9IaYgCgqRNm
/W8YU6zPMbuMjH5EMo9Rc28=
=AvYH
-----END PGP SIGNATURE-----
--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-01-2008, 08:45 PM
"Dan Cowsill"
 
Default Clone a running gentoo machine onto another machine

On Sun, Mar 30, 2008 at 4:05 PM, Neil Bothwick <neil@digimed.co.uk> wrote:
> 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.
>

Now, correct me if I'm wrong, but I had read that if you don't copy
the files in /dev, udev won't mount properly on the machine you're
cloning to and all hell will break lose. Also, iirc, I believe I
tarred a running machine (including /dev, excluding /sys) and the
clone was successful.

Any thoughts?

--
Dan Cowsill
http://www.danthehat.net
--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-01-2008, 08:55 PM
Steven Lembark
 
Default Clone a running gentoo machine onto another machine

> Now, correct me if I'm wrong, but I had read that if you don't copy
> the files in /dev, udev won't mount properly on the machine you're
> cloning to and all hell will break lose. Also, iirc, I believe I
> tarred a running machine (including /dev, excluding /sys) and the
> clone was successful.
>
> Any thoughts?

One other way: mirror the boot/root/install devices
(maybe a single partition). You can make, sync,
and drop the mirror, install grub on the new mbr
and have a clone of the system (basically you'd
be in the same situaiton as if the primary drive
of a mirrored setup croaked).

--
Steven Lembark +1 888 359 3508
Workhorse Computing 85-09 90th St
lembark@wrkhors.com Woodhaven, NY 11421
--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-01-2008, 08:55 PM
Neil Bothwick
 
Default Clone a running gentoo machine onto another machine

On Tue, 1 Apr 2008 16:45:49 -0400, Dan Cowsill wrote:

> Now, correct me if I'm wrong, but I had read that if you don't copy
> the files in /dev, udev won't mount properly on the machine you're
> cloning to and all hell will break lose.

There are two files you need in the dev directory of the root
filesystem, console and null. Create those, or bind mount the root
directory as a;ready suggested.

> Also, iirc, I believe I
> tarred a running machine (including /dev, excluding /sys) and the
> clone was successful.

There's no reason why it wouldn't be, but you're wasting a bunch of pace
and inodes on your root filesystem by putting a load of stuff in /dev
that is then hidden when udev starts.


--
Neil Bothwick

Snacktrek, n.:
The peculiar habit, when searching for a snack, of constantly
returning to the refrigerator in hopes that something new will have
materialized.
 
Old 04-01-2008, 09:13 PM
"Dan Cowsill"
 
Default Clone a running gentoo machine onto another machine

On Tue, Apr 1, 2008 at 4:55 PM, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Tue, 1 Apr 2008 16:45:49 -0400, Dan Cowsill wrote:
>
> > Now, correct me if I'm wrong, but I had read that if you don't copy
> > the files in /dev, udev won't mount properly on the machine you're
> > cloning to and all hell will break lose.
>
> There are two files you need in the dev directory of the root
> filesystem, console and null. Create those, or bind mount the root
> directory as a;ready suggested.
>
>
> > Also, iirc, I believe I
> > tarred a running machine (including /dev, excluding /sys) and the
> > clone was successful.
>
> There's no reason why it wouldn't be, but you're wasting a bunch of pace
> and inodes on your root filesystem by putting a load of stuff in /dev
> that is then hidden when udev starts.
>
>
> --
> Neil Bothwick
>
> Snacktrek, n.:
> The peculiar habit, when searching for a snack, of constantly
> returning to the refrigerator in hopes that something new will have
> materialized.
>

Oooh I see I see. Thanks!

--
Dan Cowsill
http://www.danthehat.net
--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 12:02 AM.

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