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-...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questi...@freebsd.org"
make same partitions, same newfs, copy files and then bsdlabel -B disk
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, dke...@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.
> 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
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
> 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
> 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