LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-11-2006, 03:26 PM   #1
fw12
Member
 
Registered: Mar 2006
Distribution: Fedora core, Ubuntu
Posts: 175

Rep: Reputation: 31
How to clone a linux machine


I just installed Fedora Core 4 successfully, and I'm working on configuring it the way I want, including updates, installing extra apps, disabling services, etc.

When all this is done, I'll have an identical machine, that I'd like to be a clone of the fully configured one.

Is there an easy way to do this cloning?
 
Old 05-11-2006, 03:38 PM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
The easiest way i can think of is to tar the root directory, then copy the archive and extract it. the only problem that might arise is with the /dev directory you might have to add some devices by hand on the clone.

Another way is the dd command. Just install both hd in the running system and do something like
dd bs=1024 if=/dev/hda of=/dev/hdb

check out the man page of dd for clearance. This way would save you the hassle with the /dev directory (i hope )
 
Old 05-11-2006, 04:24 PM   #3
fw12
Member
 
Registered: Mar 2006
Distribution: Fedora core, Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 31
Thank you, I'll give your suggestions a try.
 
Old 05-11-2006, 05:17 PM   #4
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
if you have norton ghost you should also be able to run that from a windows system. IIRC ghost will make an image of linux systems and can put that image on a seperate system. you will need a NIC that ghost knows how to boot to and the ability to make a boot floppy but things should work rather well for you if you can do that.
 
Old 05-11-2006, 06:39 PM   #5
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
If you use the tar method, you still gotta copy over the boot block and re-partition the drive identical to the first?

I think the 'dd' method is the easiest.

-twantrd
 
Old 05-12-2006, 11:31 AM   #6
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
what exactly does the dd do? will it also partition and duplicate exactly the system like ghost does?
 
Old 05-12-2006, 11:55 AM   #7
fw12
Member
 
Registered: Mar 2006
Distribution: Fedora core, Ubuntu
Posts: 175

Original Poster
Rep: Reputation: 31
twantrd, you raised a good point about partitioning. This is something I've been wondering about too.

Here's what I intend to do:

Install linux on the second machine, with identical partitions as the first.
If I then go ahead and do a

tar -zcvpf /

of the first machine, then

tar -zxvpf

on the destination machine, would that work?

The dd method may not work for me, since I have several hard drives configured as a raid array.

I guess the only way to find out is to actually test it when I'm ready.
 
Old 05-12-2006, 06:37 PM   #8
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I remembered one forum where it was mandatory that you searched on your subject before you were allowed to post a new thread. Was that this forum?

Why should more experienced users waste their time answering the same questions over and over instead of helping people with new and real problems?

Search for "learn the dd command" on this forum, and you'll find every conceivable use of dd, including 17 alternative ways to clone a drive.

jlinkels
 
Old 05-12-2006, 07:59 PM   #9
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by jlinkels
I remembered one forum where it was mandatory that you searched on your subject before you were allowed to post a new thread. Was that this forum?

Why should more experienced users waste their time answering the same questions over and over instead of helping people with new and real problems?

Search for "learn the dd command" on this forum, and you'll find every conceivable use of dd, including 17 alternative ways to clone a drive.

jlinkels
As correct as you are, attitudes like that are one thing that prevent new users from trying linux for any real amount of time.

that is just as bad as RTFM replies. some people may of read the man pages and just not understood what was said. others may be to new to even know about the search function here to use it.

as for my question about dd, it was simple, this thread is talking about that subject so to keep the thread on track and to learn something i asked a very simple question. if you know the answere, then please provide useful information. if you do not know the answere move on and stop with the pissy attitude towards newbies.

hmm linux is based on SHARING of information, not on flaming the new people for asking questions. if a question is asked a million times, then wow maybe it is important for new people to KNOW HOWTO do those things.
 
Old 05-12-2006, 09:41 PM   #10
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
All flames aside, there's a tool called SystemImager that handles creating a cloning images. I'm planning to try it out on my next large scale machine deployment at work.
 
Old 05-13-2006, 12:11 AM   #11
Mithrilhall
Member
 
Registered: Feb 2002
Location: Adamstown, Pitcairn Islands
Distribution: Neon
Posts: 291

Rep: Reputation: 30
jlinkels, you might want to think before you post.

What if he never heard of the "dd command"...DF!
 
Old 05-13-2006, 05:00 AM   #12
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Your missing the name of the tar-archive you wanna create. It should be like

tar -zcvpf filename.tar directory_to_tar

the option f stands for file(name).

Also when you extract put the name of the tar after -f

You might consider to skip some dirs like /tmp maybe /home and /var/log. Check man page for optionname.

The dd command might still be an option because its working on the hardware level not on filesystem level and i think it does not care if you got a raid going. The only thing that might araise if the clone machine has bigger or smaller hd, but i think it only effects the partition table.

If any more question i´m happy to answer. got enough free time
 
Old 05-13-2006, 09:08 AM   #13
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
lleb,

Quote:
that is just as bad as RTFM replies. some people may of read the man pages and just not understood what was said.
If there would be a prize for not understanding man pages, I would probable eligible for it. I mean: I agree with you that man pages are utterly terse and incomprehensible, and that it is useful to have a HOWTO aside.

Quote:
others may be to new to even know about the search function here to use it.
Then my statement still holds. Force the user to search, make search easier etc.

Quote:
if you do not know the answere move on and stop with the pissy attitude towards newbies.
I gave a pointer, didn't I? "Learn the dd command" is the title of a thread on this forum, not a statement.

Quote:
then wow maybe it is important for new people to KNOW HOWTO do those things.
That is why another member (his name is AwesomeMachine, we are not related in any way) wrote an elaborate howto on the dd command. He not only explained the dd command, but also gave numerous examples about how to clone a disk. Where I could, I added my knowledge to that thread.

It also sad to see that due to the huge amount of repeated, basic questions about how to clone a disk, it becomes more difficult to find this or other relevant threads.


Mithrilhall:
Quote:
jlinkels, you might want to think before you post.

What if he never heard of the "dd command"...DF!
The "dd" commmand was mentioned in the first reply in this thread. Who should think here before posting?

Just for my knowledge: DF = Da Fuck?

jlinkels
 
Old 05-13-2006, 09:48 AM   #14
robbbert
Member
 
Registered: Oct 2005
Location: Hannover, Germany
Distribution: Let there be Ubuntu... :o)
Posts: 573

Rep: Reputation: 32
Quote:
Is there an easy way to do this cloning?
Linux System Imager?
 
Old 05-13-2006, 10:20 AM   #15
dtcs
LQ Newbie
 
Registered: Jul 2005
Distribution: Slackware, Debian
Posts: 28

Rep: Reputation: 15
Quote:
Originally Posted by lleb
what exactly does the dd do? will it also partition and duplicate exactly the system like ghost does?
No, In Unix/Linux, every tool is designed to do one job and do it good, thats one of the philosophies of UNIX and that you should know. Therefore "dd"'s job will not be to partition your drive since theres another great tool that does that, its called "fdisk" and if you want to format your drive there's another tool called "mkfs"
obviously you seem to have come from windowz world
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sharing internet from a windows 98 machine to a Red Hat Linux machine ritwiksolutions Linux - Newbie 7 03-14-2006 10:20 AM
how to access internet from a linux machine via a linux machine as gateway b0nd Linux - Newbie 5 03-21-2005 11:59 AM
Looking for clone of Frontapage for Linux gcossiaux Linux - Software 3 02-19-2004 01:40 AM
Using SMB to copy files from one linux machine to second linux machine. coppersky Linux - Networking 9 06-24-2003 12:07 PM
Linux have a napster clone? Chijtska Linux - General 12 03-05-2002 04:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration