LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 05-19-2006, 09:29 AM   #1
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 537

Rep: Reputation: 39
cloning multiple hard drives using bootable media


Hi folks,

Our church has a NetBSD system that we need to start maintaining. (The previous administrator lost a battle with cancer so suddenly that he didn't arrange to leave us access.) We will need to reset root access in order to adjust some configurations and eventually make such system changes as security updates. I'll ask the *BSD folks about that stuff, but first we will need to clone the system.

We may well arrange to have this done by professionals, but if that turns out to be too expensive, I may risk doing it myself. Since I have physical access to the machine, I should be able to remove the hard drives (it is set up with RAID for at least two drives) and put them back into the machine one at a time with an empty drive for cloning. What I could use some advice on is what a good and relatively simple and "fool-proof" way to do this is.

Since the machine is configured to boot from CD, I plan to take the Ultimate Boot CD and Knoppix with me this weekend and have a look at the partitions. Question 1: How can I be sure to not overlook any hard drives? I basically need to see how many hard drives there are in the system and of what type and size they are, in order to know what new hard drives to obtain for cloning.

Assuming that I will do this myself, once I have the clone hard drives ready, what is a good way to do the cloning? Here's how I imagine doing it. Let's say I can open the housing and remove all hard drives. Then I insert one of the system drives in the master position and the target clone drive in a slave position, and boot the machine from CD. Obviously I would have to be very careful about master/slave jumper settings and check that the devices are detected by the BIOS. Probably it's also best to try to find hard disks not only of the same type and (bigger) size but even from the same manufacturer. Question 2: How can I make absolutely sure to avoid confusing the hard drives so that I don't overwrite the valuable hard drive with the empty hard drive? Is "fdisk -l" enough? (I once had a system administrator overwrite my hard drive like this with Ghost.) Question 3: Shall I "simply" use dd to clone the devices? Question 4: Any special caveats or pitfalls to look out for?

Once I have done this for each hard drive, it would of course be a good idea to test the success of the cloning. I think an essential step will be to insert the clone drives into their respective slots and start the machine. Question 6: What kind of tests can I run to make sure everything is in order? Remember we're talking NetBSD here. I'm sure if the system boots properly it's a good sign, but what external tests could we run?

Anything I am overlooking? Thanks a lot for any help.

Regards,
Mike
 
Old 05-22-2006, 04:18 AM   #2
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 537

Original Poster
Rep: Reputation: 39
Although the problem is not in the next 2-3 days urgent, it would still be good to have some advice.
 
Old 05-25-2006, 03:08 AM   #3
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 537

Original Poster
Rep: Reputation: 39
Did I ask in the wrong forum?
 
Old 05-29-2006, 07:45 AM   #4
jasontn
Member
 
Registered: Feb 2004
Location: Malaysia
Distribution: Fedora Core 2
Posts: 60

Rep: Reputation: 15
You can use dd to copy the partitions. Do a search on dd in the previous posts.

First, you will need to create new partitions in the new drive with

fdisk /dev/hd[insert alphabet]

It doesn't matter if it's master or slave or primary or secondary. Just make sure you've get the partition names correct, e.g. hda1, hdc2, etc. Create the new partitions with the same size as ones in the old hard disk.

Then copy the partitions one by one. Don't forget to copy the MBR as well. And also format the swap partition after creating the swap partition.
 
Old 05-30-2006, 10:15 AM   #5
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 537

Original Poster
Rep: Reputation: 39
Thanks very much for the answer. For the use of dd, I found this thread:
http://www.linuxquestions.org/questi...d.php?t=366442

It offers advice for "Cloning an entire hard disk:"
Code:
dd if=/dev/sda of=/dev/sdb conv=notrunc,noerror
That should include the MBR.

I'm unsure on your answer about formatting the swap partition. I can imagine that if it is unformatted that it could cause system errors when booted, but would the above described method of copying the whole disk not effectively format the swap partition?

Is there a sure way to evaluate for sure which device is the original? Should fdisk -l be sufficient? If so, that covers questions 2 and 3. Question 5 appears not to exist, and I hope for but don't expect an answer to question 4. (Nevertheless, not screwing up the system is my number-one priority, so avoiding pitfalls is important.) That leaves questions 1 and 6. Anybody care to have a go at them?

As to question 1, opening the case and looking at the number of hard-disks seems the best solution, but shouldn't a Linux Live CD enable me to find all of the system disks before opening the case? How can I know which disks are being used where, especially considering the system uses a RAID array?

As to question 6, I really need an answer here. If making sure I don't screw up the system during the cloning process is my number one concern, then creating a system that is an effective instead of a broken clone is my number two concern. How best to test it?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Cloning different sized hard drives? jaykup Linux - General 3 03-10-2006 02:42 AM
Multiple Hard Drives TuxFreak Linux - General 3 12-22-2004 01:11 PM
Cloning Hard Drives and Partitions! an alternative to Norton ghost thebover Linux - Software 3 08-18-2004 04:40 PM
Multiple bootable drives problem billygotee Red Hat 2 11-17-2003 09:48 PM
cloning hard drives with RH8 willcox Linux - Hardware 0 06-10-2003 08:44 PM


All times are GMT -5. The time now is 02:51 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration