Re: clone a drive, no raid involved

2008-06-20 Thread D G Teed
On Thu, Jun 19, 2008 at 1:08 PM, Brad Mettee [EMAIL PROTECTED] wrote:

 I'm setting up a pair of machines with almost identical OS config, and
 completely identical hardware. One is a primary DNS server, the other is
 secondary. NS1 will also serve web, NS2 will be a mail server. Both are low
 volume/loads.

 It looks like I can use DD to copy an entire drive, but it's a 500G drive
 and that's going to take a really long time (especially since it's brand new
 with no data besides base OS).

 My question: Is there a better way to duplicate a drive including boot
 info?


You've got lots of useful answers on duplicating the system other ways,
but I thought I'd mention that dd's performance can be enhanced by
providing a blocksize.  You might want to time some reads and writes
with a set of numbers that divides evenly into the byte count of your disk.
Years ago I found I could write a 40 GB laptop (4200RPM) disk in
21 minutes rather than one hour.

--Donald
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


clone a drive, no raid involved

2008-06-19 Thread Brad Mettee
I'm setting up a pair of machines with almost identical OS config, and 
completely identical hardware. One is a primary DNS server, the other is 
secondary. NS1 will also serve web, NS2 will be a mail server. Both are low 
volume/loads.


It looks like I can use DD to copy an entire drive, but it's a 500G drive 
and that's going to take a really long time (especially since it's brand 
new with no data besides base OS).


My question: Is there a better way to duplicate a drive including boot info?

Brad Mettee
PC HotShots, Inc.
Baltimore, MD
(410) 426-7617

 - Let us bring out the *Power* of your PCs. -
- Custom Business Software Solutions since 1991 -

visit http://www.pchotshots.com for information about our company.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: clone a drive, no raid involved

2008-06-19 Thread Wojciech Puchar
that's going to take a really long time (especially since it's brand new with 
no data besides base OS).


My question: Is there a better way to duplicate a drive including boot info?


make same partitions, same newfs, copy files and then bsdlabel -B disk



   Brad Mettee
   PC HotShots, Inc.
   Baltimore, MD
   (410) 426-7617

- Let us bring out the *Power* of your PCs. -
- Custom Business Software Solutions since 1991 -

visit http://www.pchotshots.com for information about our company.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: clone a drive, no raid involved

2008-06-19 Thread David Kelly
On Thu, Jun 19, 2008 at 12:08:34PM -0400, Brad Mettee wrote:
 I'm setting up a pair of machines with almost identical OS config, and
 completely identical hardware. One is a primary DNS server, the other
 is secondary. NS1 will also serve web, NS2 will be a mail server. Both
 are low volume/loads.
 
 It looks like I can use DD to copy an entire drive, but it's a 500G
 drive and that's going to take a really long time (especially since
 it's brand new with no data besides base OS).

Yes dd(1) works, especially if the 2nd drive is equal size or larger
than the original.

 My question: Is there a better way to duplicate a drive including boot
 info?

Mount both drives on same machine, right? Then move one to the other?

I think you will find its not all that hard to build the 2nd machine
from install CDs. But it is a useful learning exercise to learn how to
clone a drive before all hell breaks loose and the whole world is
depending on you.

Study the man page for bsdlabel(8) and reproduce the configuration on
your 2nd drive that you see on your first.

Write the new filesystems with newfs(8).

Then for each filesystem (only showing / below):

mount /dev/your-2nd-drive's-root /mnt
dump -0aL -f - / | ( cd /mnt/ ; restore -r )

-- 
David Kelly N4HHE, [EMAIL PROTECTED]

Whom computers would destroy, they must first drive mad.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: clone a drive, no raid involved

2008-06-19 Thread Jerry McAllister
On Thu, Jun 19, 2008 at 12:08:34PM -0400, Brad Mettee wrote:

 I'm setting up a pair of machines with almost identical OS config, and 
 completely identical hardware. One is a primary DNS server, the other is 
 secondary. NS1 will also serve web, NS2 will be a mail server. Both are low 
 volume/loads.
 
 It looks like I can use DD to copy an entire drive, but it's a 500G drive 
 and that's going to take a really long time (especially since it's brand 
 new with no data besides base OS).
 
 My question: Is there a better way to duplicate a drive including boot info?

Really, the better way is to use fdisk/bsdlabel/newfs to create the
identical file systems and boot/label blocks.   Then use dump(8) piped
to restore(8) to populate them with the data from the old file
systems.   It is generally better than making a byte-by-byte copy
with dd unless you are experimenting with some oddities of unformatted
disk access or whatever.

Also, using dump/restore will allow for those small differences from
disk to disk that are usually there without causing the problems dd
copies of whole disks can have.

jerry


 
 Brad Mettee
 PC HotShots, Inc.
 Baltimore, MD
 (410) 426-7617
 
  - Let us bring out the *Power* of your PCs. -
 - Custom Business Software Solutions since 1991 -
 
 visit http://www.pchotshots.com for information about our company.
 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: clone a drive, no raid involved

2008-06-19 Thread Alexander Motin

Brad Mettee wrote:
I'm setting up a pair of machines with almost identical OS config, and 
completely identical hardware. One is a primary DNS server, the other is 
secondary. NS1 will also serve web, NS2 will be a mail server. Both are 
low volume/loads.


It looks like I can use DD to copy an entire drive, but it's a 500G 
drive and that's going to take a really long time (especially since it's 
brand new with no data besides base OS).


My question: Is there a better way to duplicate a drive including boot 
info?


Partition second drive (I usually prefer sysinstall which also installs 
loaders), mount it and use dump/restore:


cd /mnt
dump -aLf - -C32 / | restore -rf -

--
Alexander Motin
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: clone a drive, no raid involved

2008-06-19 Thread Warren Block

On Thu, 19 Jun 2008, Brad Mettee wrote:

I'm setting up a pair of machines with almost identical OS config, and 
completely identical hardware. One is a primary DNS server, the other is 
secondary. NS1 will also serve web, NS2 will be a mail server. Both are low 
volume/loads.


It looks like I can use DD to copy an entire drive, but it's a 500G drive and 
that's going to take a really long time (especially since it's brand new with 
no data besides base OS).


My question: Is there a better way to duplicate a drive including boot info?


The way I've done that in the past is to backup the source system with 
dump for /, /var, and /usr.


Then do a minimal install on the clone, setting up the appropriate 
partition sizes.  That is quicker for me than trying to remember fdisk 
and bsdlabel options.  It also avoids the embarrassing situation of 
getting source and destination disks mixed up when they're both on the 
same machine.


On the clone, restore from the original dump files over the new system 
with restore -ruf dumpfile.


This may be helpful:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#NEW-HUGE-DISK

-Warren Block * Rapid City, South Dakota USA
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]