Re: [gentoo-user] 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
Re: [gentoo-user] Clone a running gentoo machine onto another machine
On Sun, Mar 30, 2008 at 4:05 PM, Neil Bothwick [EMAIL PROTECTED] 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
Re: [gentoo-user] 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 [EMAIL PROTECTED] Woodhaven, NY 11421 -- gentoo-user@lists.gentoo.org mailing list
Re: [gentoo-user] 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. signature.asc Description: PGP signature
Re: [gentoo-user] Clone a running gentoo machine onto another machine
On Tue, Apr 1, 2008 at 4:55 PM, Neil Bothwick [EMAIL PROTECTED] 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
Re: [gentoo-user] 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
Re: [gentoo-user] 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
Re: [gentoo-user] Clone a running gentoo machine onto another machine
Hello On Sun, Mar 30, 2008 at 10:29:39PM +0300, Benyamin Dvoskin wrote: 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. rsync is usually faster, as it reads the first one and writes to the second one at the same time. You should read its' man page, there are nice things like '-x' flag (so it copies only one filesystem and does not enter sub-filesystems, like dev and) As it uses ssh by default, you need only sshd on the remote server and you can tweak thinks like compression while transferring. -- All flame and insults will go to /dev/null (if they fit) Michal 'vorner' Vaner pgpJAfTajkT6S.pgp Description: PGP signature
Re: [gentoo-user] 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. signature.asc Description: PGP signature
Re: [gentoo-user] 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
Re: [gentoo-user] 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 [EMAIL PROTECTED] 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