Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 21st January 2009, 02:36 AM
griffinmt's Avatar
griffinmt Offline
Registered User
 
Join Date: Oct 2005
Location: Central Michigan
Age: 63
Posts: 189
Question System Cloning

Given that I have a system that is configured and ready to use, is it possible to 'clone' it onto a similar system (some hardware differences) without having to spend the time building it from scratch and risk making typos/taking different options etc.
__________________
Martyn Griffin
Reply With Quote
  #2  
Old 21st January 2009, 03:25 AM
Mikko Offline
Registered User
 
Join Date: Nov 2008
Location: Finland
Posts: 157
Yes. There are specific tools for this, but it can be done simply with tar or rsync.

I've often done approximately the following

- boot the target machine from live cd

- partition and mkfs as needed

- mount the root partition and cd into it

- rsync (options -a and -H, at least) over the network from an existing system the following directories: bin dev lib sbin selinux usr boot etc opt root srv var

- mkdir the following: misc net proc sys home media mnt tmp (assuming you want an empty /home)

- chmod 1777 tmp

- delete /etc/ssh/*key* and /etc/udev/rules.d/*persistent* files; they will be regenerated

- edit /boot/grub.conf and /etc/fstab to point to the correct partitions; 'blkid' is your friend if you use UUIDs

- possibly edit /etc/sysconfig/network and the contents of network-scripts, if static ip is needed

- run grub and do 'root (hdX,Y)' and 'setup (hdX)' with appropriate drive X and partition Y

The system should then boot (unless I forgot something essential ). It's very easy to make a silly mistake in grub.conf or fstab such that you need to boot from the live cd again and fix them in order to get the system to boot. Also, doing the above will clone user accounts but not /home. Of course, you can create a tarball and drop that into multiple machines instead of using rsync. You just need to take care to preserve permissions and hard links. Regardless, transferring the system over a 100 mbit or a gbit ethernet only takes a couple of minutes and is almost certainly much faster than running the installer.

Hardware configuration is usually not a problem. You may want to delete the cloned xorg.conf if you have one. In my experience everything else has just worked (so long as the persistent udev rules from the source installation are removed).

If you don't have an ethernet switch, you can still connect the machines directly to each other with a regular ethernet cable. Current hardware will automatically negotiate a straight ethernet connection. Then just stop NetworkManager on both machines and set ip addresses and routes manually.

Last edited by Mikko; 21st January 2009 at 03:33 AM.
Reply With Quote
  #3  
Old 21st January 2009, 03:42 AM
griffinmt's Avatar
griffinmt Offline
Registered User
 
Join Date: Oct 2005
Location: Central Michigan
Age: 63
Posts: 189
Thanks for that info.

I did not mention that I might want to do this without a network active between systems.

Therefore I am looking for something that can be built onto one or more DVDs, taken to the remote system, boot from the DVD and have it do the job semi-automatically.

If I know these are all single disk setups with a single root partition and one swap partition and a single ethernet using DHCP, Then the only 'real' variable is the hostname, plus additional user account(s).

That being said, could this be scripted on the DVD such that someone else could insert and boot the DVD, answer a few questions and then have it complete?

TIA,
__________________
Martyn Griffin
Reply With Quote
  #4  
Old 21st January 2009, 04:15 AM
Mikko Offline
Registered User
 
Join Date: Nov 2008
Location: Finland
Posts: 157
Quote:
Originally Posted by griffinmt View Post
If I know these are all single disk setups with a single root partition and one swap partition and a single ethernet using DHCP, Then the only 'real' variable is the hostname, plus additional user account(s).
I think you can actually set the hostname to localhost.localdomain in /etc/sysconfig/network and then use dhcp and the hostname will be set automatically.

Quote:
Originally Posted by griffinmt View Post
That being said, could this be scripted on the DVD such that someone else could insert and boot the DVD, answer a few questions and then have it complete?
Sure, but there is probably some trial and error before you get a working DVD, and you end up burning and test-booting a few more DVDs than you'd like. If the machines can boot from a thumb drive, then that would be a much less painful way to do it since you can easily edit the contents of the thumb drive. Even if they can't boot, I'd still probably boot from a standard live cd and put the system image and the installation script on a thumb drive. I think your users would be able to run a script from a thumb drive?

If you actually have a homogenous set of machines with identical partitioning, you might be able to use one of the cloning tools. Try googling. There are several, many of them created for cloning compute clusters. It's been many years since I looked at them, so I can't really give pointers. Then there's Red Hat's Kickstart, which I've found thoroughly useless, but I haven't tried it in several years. Then again it's not very difficult to write your own script to clone a set of (nearly) identical machines. I've always worked with a bunch of very different machines with different partitioning schemes, so it's been less trouble to do the syncing and fstab editing manually than to try to force one of the existing automatic tools to do something different for each machine.

Last edited by Mikko; 21st January 2009 at 04:20 AM.
Reply With Quote
  #5  
Old 21st January 2009, 06:39 PM
griffinmt's Avatar
griffinmt Offline
Registered User
 
Join Date: Oct 2005
Location: Central Michigan
Age: 63
Posts: 189
Thanks.

I'll do some tinkering based upon the info you provided. I don't mind the extra work with the DVD etc if I am learning something in the process. And this is only for 3-4 systems.
__________________
Martyn Griffin
Reply With Quote
Reply

Tags
cloning

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cloning Fedora VM FusionX Using Fedora 1 6th September 2009 11:01 AM
Cloning a 20G to 40G HD with LVM Partitions seby Using Fedora 1 19th February 2008 09:49 AM
Cloning a FC5 install warp_kez Using Fedora 4 16th May 2006 08:32 AM
disk cloning and LVM Lutz Installation and Live Media 0 18th March 2006 06:34 PM


Current GMT-time: 03:52 (Monday, 20-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat