Re: Using dd to Make a Clone of a Drive

2006-02-15 Thread Jack Stone
I have used dump/restore and dd as well. For a block size, I chose 102400 
which was the fastest -- but still slow compared to dump/restore. 
Dump/restore is not limited to making a whole image, blanks and all like dd.


Once upon a time, I used this as the best:
dd if=/dev/ad0 of=/dev/ad1 bs=102400

The obvious intention is to minimize the number of transfers, so 
theoretically the larger the transfer, the better. The maximum I/O transfer 
size is limited to the value of MAXPHYS, which is defined in

sys/param.h:

 #ifndef MAXPHYS
 #define MAXPHYS(128 * 1024)/* max raw I/O transfer size */
 #endif

The ATA subsystem uses this value. SCSI drives were limited to 60 kB 
transfers, though this could have changed.  I don't currently have any 
machine with SCSI disks connected, so I can't confirm that.  A way to find 
is to run a command like will show the I/O:

#dd if=/dev/ad0c of=/dev/null bs=128k 

and in the background do an 'iostat ad0 1'.  Here's an example with an
IDE drive:

#iostat ad0 1
   tty ad0 cpu
  tin tout  KB/t tps  MB/s  us ni sy in id
03  5.19   7  0.03  11  0  4  1 84
0  126 127.36 183 22.74   0  0  6  2 92
0   44 128.00 190 23.76   0  0  2  0 98
0   44 128.00 191 23.89   0  0  5  0 95
0   44 128.00 191 23.88   0  0  7  1 92

As you can see, it's really doing 128 kB transfers, for an average transfer 
rate of almost 24 MB/s.

=

I do all of my backups every night by scripts by using dump/restore to a 
dedicated separate HD. It is bootable and ready to go in case of a problem 
with my master HD. Just shutdown, switch HDs and reboot -- voila! Back on 
line within a minute and the data is always only a few hours old at the 
most.


Once you master dump/restore, it is indispensable for handling file systems.

Best regards,
Jack

_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/


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


Re: Using dd to Make a Clone of a Drive

2006-02-14 Thread Kevin Kinsey

Kevin Kinsey wrote:


Giorgos Keramidas wrote:


On 2006-02-09 14:36, Martin McCormick [EMAIL PROTECTED] wrote:
 


After installing FreeBSD5.4, the ISC dhcp server and ISC bind
on a hard drive, I wanted to clone that drive to a second drive so as
to generate a second server, using what I had already installed as a
template.  I used the following command:

dd if=/dev/da0 of=/dev/da1 bs=512

It turns out that dd defaults to 512-byte blocks so I didn't
really need the bs=512, but I am not sure I haven't made some other
type of mistake.  The dd command has been running for about 4 hours on
a very fast system, with a 1-gig processor, 1 gig of RAM and two 31-GB
drives.  One would think it should have finished by now, but it is
still running.  Is this a valid method of copying the entire contents
of one drive to another?  Thank you.
  



Bah!  That's too slow for my taste.  I would usually go for a newfs,
dump, and restore option.  For instance, to create a copy of /usr on a
second disk:

   newfs -U /dev/ad1s1a
   mount /dev/ad1s1a /mnt
   dump -0 -a -L /usr | ( cd /mnt ; restore ruvf - )

Copying with dd(1) is not as fast :)
 


Sorry to butt in --- but I'm needing to start cloning too.  Looks
like a winner to me ... wouldn't this have the added advantage
of making same size and geometry (cf. Erik Trulsson, 4 hours ago,
this thread) less relevant?

As long as the new slice had enough space, geometry shouldn't
matter to dump|restore   ?

Kevin Kinsey



Just for the archives:

Giorgios' solution is very nice, but needs the -f option and another
- to work properly AFAICT, both from experience and from reading
dump(8):

 dump -0 -a -L -f - /usr | (cd /mnt ; restore ruvf - )

If you don't include -f (for file) and - (for stdout), then your
command will fail with:

 DUMP: Cannot open output /dev/sa0

   unless you actually have a tape drive, as, of course, any
experienced user could have told you would happen, if
not when they read the incorrect command line, then when
they saw, previously:

 DUMP: Dumping snapshot of /dev/$somedisk to /dev/sa0


I used the strategy above to clone a working installation of
Wine and a rather obscure Win32 program from a 20 GB IDE
HDD to an 8GB drive with good success after attempts to
re-create a similar installation manually had failed, presumably
because something in re: Wine had changed in the interim,
though we've been unable to establish this as fact.

So, I've adopted dump(8) and restore(8) for disk cloning as
a result of this experience.  Next step: moving to dump|restore
for my home-brew backup routines

HTH Someone,

Kevin Kinsey

--
Heisenberg may have slept here


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


Re: Using dd to Make a Clone of a Drive

2006-02-14 Thread Giorgos Keramidas
On 2006-02-14 07:47, Kevin Kinsey [EMAIL PROTECTED] wrote:
Kevin Kinsey wrote:
Giorgos Keramidas wrote:
 Bah!  That's too slow for my taste.  I would usually go for a newfs,
 dump, and restore option.  For instance, to create a copy of /usr on a
 second disk:

newfs -U /dev/ad1s1a
mount /dev/ad1s1a /mnt
dump -0 -a -L /usr | ( cd /mnt ; restore ruvf - )

 Copying with dd(1) is not as fast :)

 Sorry to butt in --- but I'm needing to start cloning too.  Looks
 like a winner to me ... wouldn't this have the added advantage
 of making same size and geometry (cf. Erik Trulsson, 4 hours ago,
 this thread) less relevant?

 As long as the new slice had enough space, geometry shouldn't
 matter to dump|restore   ?

 Just for the archives:

 Giorgios' solution is very nice, but needs the -f option and another
 - to work properly AFAICT, both from experience and from reading
 dump(8):

  dump -0 -a -L -f - /usr | (cd /mnt ; restore ruvf - )

 If you don't include -f (for file) and - (for stdout), then your
 command will fail with:

  DUMP: Cannot open output /dev/sa0

Oops!  Yes, good catch :)

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


Re: Using dd to Make a Clone of a Drive

2006-02-10 Thread Giorgos Keramidas
On 2006-02-09 18:48, Kevin Kinsey [EMAIL PROTECTED] wrote:
Giorgos Keramidas wrote:
 Bah!  That's too slow for my taste.  I would usually go for a newfs,
 dump, and restore option.  For instance, to create a copy of /usr on a
 second disk:

newfs -U /dev/ad1s1a
mount /dev/ad1s1a /mnt
dump -0 -a -L /usr | ( cd /mnt ; restore ruvf - )

 Copying with dd(1) is not as fast :)

 Sorry to butt in --- but I'm needing to start cloning too.  Looks
 like a winner to me ... wouldn't this have the added advantage
 of making same size and geometry (cf. Erik Trulsson, 4 hours ago,
 this thread) less relevant?

Yes, this is pretty much the important point :)

 As long as the new slice had enough space, geometry shouldn't
 matter to dump|restore   ?

Right :)  It also allows restoring in a different partition layout.

I used this recently to 'recover' my laptop's installation, using a
spare partition.  Before running 'installkernel' and 'installworld',
a backup of my root, /var and /usr partitions was saved with:

# cd /home/backup
# dump -o -aL -f root.ad0s1a /
# dump -o -aL -f var.ad0s1d  /var
# dump -o -aL -f usr.ad0s1e  /usr

A 'copy' of the original /, /var and /usr was restored in ad0s2a, which
was a single UFS partition, large enough to hold a restored copy of my
old /, /var and /usr partitions:

# newfs -U /dev/ad0s2a
# mount /dev/ad0s2a /mnt
# ( cd /mnt;  restore -ruf /home/backup/root.ad0s1a )
# ( cd /mnt/var ; restore -ruf /home/backup/var.ad0s1d  )
# ( cd /mnt/usr ; restore -ruf /home/backup/var.ad0s1e  )

Then, when things went totally nuts after the installation of a new
system on ad0s1* partitions, I could still boot from ad0s2a and restore
my old backup copies from /home :)

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


Re: Using dd to Make a Clone of a Drive

2006-02-10 Thread Martin McCormick
Paul Schmehl quotes and then writes:
 Copying with dd(1) is not as fast :)

Have you tried dcfldd?  sysutils/dcfldd

Thank you.  I hadn't thought of that.  This is what I
appreciate about groups like this.

Martin McCormick WB5AGZ  Stillwater, OK 
Systems Engineer
OSU Information Technology Department Network Operations Group
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Using dd to Make a Clone of a Drive

2006-02-10 Thread Peter

--- Giorgos Keramidas [EMAIL PROTECTED] wrote:

 On 2006-02-09 18:48, Kevin Kinsey [EMAIL PROTECTED] wrote:
 Giorgos Keramidas wrote:
  Bah!  That's too slow for my taste.  I would usually go for a newfs,
  dump, and restore option.  For instance, to create a copy of /usr on
 a
  second disk:
 
 newfs -U /dev/ad1s1a
 mount /dev/ad1s1a /mnt
 dump -0 -a -L /usr | ( cd /mnt ; restore ruvf - )
 
  Copying with dd(1) is not as fast :)
 
  Sorry to butt in --- but I'm needing to start cloning too.  Looks
  like a winner to me ... wouldn't this have the added advantage
  of making same size and geometry (cf. Erik Trulsson, 4 hours ago,
  this thread) less relevant?
 
 Yes, this is pretty much the important point :)
 
  As long as the new slice had enough space, geometry shouldn't
  matter to dump|restore   ?
 
 Right :)  It also allows restoring in a different partition layout.
 

Any chance of there being a way like this to restore to windows systems
from the FreeBSD box?






__ 
Find your next car at http://autos.yahoo.ca
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Using dd to Make a Clone of a Drive

2006-02-10 Thread Giorgos Keramidas
On 2006-02-10 09:44, Peter [EMAIL PROTECTED] wrote:
--- Giorgos Keramidas [EMAIL PROTECTED] wrote:
 As long as the new slice had enough space, geometry shouldn't
 matter to dump|restore   ?

 Right :)  It also allows restoring in a different partition layout.

 Any chance of there being a way like this to restore to windows systems
 from the FreeBSD box?

Not really.  I'm far from being a Windows expert though, so YMMV.

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


Re: Using dd to Make a Clone of a Drive

2006-02-10 Thread Bart Silverstrim


On Feb 10, 2006, at 9:50 AM, Giorgos Keramidas wrote:


On 2006-02-10 09:44, Peter [EMAIL PROTECTED] wrote:

--- Giorgos Keramidas [EMAIL PROTECTED] wrote:

As long as the new slice had enough space, geometry shouldn't
matter to dump|restore   ?


Right :)  It also allows restoring in a different partition layout.


Any chance of there being a way like this to restore to windows 
systems

from the FreeBSD box?


Not really.  I'm far from being a Windows expert though, so YMMV.


As an image?  Look up partimage and partimaged.  We've had some luck 
restoring from both a Linux system running the Partimaged daemon and 
booting from a Linux disk and restoring images off a samba/Windows 
share using partimage.


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


Re: Using dd to Make a Clone of a Drive

2006-02-10 Thread Ken Stevenson

Giorgos Keramidas wrote:

On 2006-02-09 14:36, Martin McCormick [EMAIL PROTECTED] wrote:

After installing FreeBSD5.4, the ISC dhcp server and ISC bind
on a hard drive, I wanted to clone that drive to a second drive so as
to generate a second server, using what I had already installed as a
template.  I used the following command:

dd if=/dev/da0 of=/dev/da1 bs=512

It turns out that dd defaults to 512-byte blocks so I didn't
really need the bs=512, but I am not sure I haven't made some other
type of mistake.  The dd command has been running for about 4 hours on
a very fast system, with a 1-gig processor, 1 gig of RAM and two 31-GB
drives.  One would think it should have finished by now, but it is
still running.  Is this a valid method of copying the entire contents
of one drive to another?  Thank you.


Bah!  That's too slow for my taste.  I would usually go for a newfs,
dump, and restore option.  For instance, to create a copy of /usr on a
second disk:

newfs -U /dev/ad1s1a
mount /dev/ad1s1a /mnt
dump -0 -a -L /usr | ( cd /mnt ; restore ruvf - )

Copying with dd(1) is not as fast :)


I had to clone a couple systems a while back, and I also did it with
dump/restore. The best part was this was the first time I actually
restored my backups to a bare hard drive. It gave me a lot of
confidence that my backups actually work. I think a lot of people find
out too late that whatever backup solution they're using is flawed and
they can't rebuild their system from it.

--
Ken Stevenson
Allen-Myland Inc.

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


Re: Using dd to Make a Clone of a Drive

2006-02-10 Thread Peter

--- Bart Silverstrim [EMAIL PROTECTED] wrote:

 
 On Feb 10, 2006, at 9:50 AM, Giorgos Keramidas wrote:
 
  On 2006-02-10 09:44, Peter [EMAIL PROTECTED] wrote:
  --- Giorgos Keramidas [EMAIL PROTECTED] wrote:
  As long as the new slice had enough space, geometry shouldn't
  matter to dump|restore   ?
 
  Right :)  It also allows restoring in a different partition layout.
 
  Any chance of there being a way like this to restore to windows 
  systems
  from the FreeBSD box?
 
  Not really.  I'm far from being a Windows expert though, so YMMV.
 
 As an image?  Look up partimage and partimaged.  We've had some luck 
 restoring from both a Linux system running the Partimaged daemon and 
 booting from a Linux disk and restoring images off a samba/Windows 
 share using partimage.

I intend to use g4u.  I have done some preliminary testing and I am quite
confident that I can upload and download an image.  I am now wondering
about the situation where I need to recreate the partition that is to
contain the image.  It needs to be exactly the same size (sectors) as the
image.  That's what I'm worried about.  Any suggestions?







__ 
Find your next car at http://autos.yahoo.ca
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Using dd to Make a Clone of a Drive

2006-02-10 Thread Ken Stevenson

Peter wrote:


I intend to use g4u.  I have done some preliminary testing and I am quite
confident that I can upload and download an image.  I am now wondering
about the situation where I need to recreate the partition that is to
contain the image.  It needs to be exactly the same size (sectors) as the
image.  That's what I'm worried about.  Any suggestions?



You don't create a partition to restore to when you're using g4u. It 
does a bit by bit copy so it creates the slice and partitions for you 
automatically. As the documentation for g4u says, it's most useful 
when the source disk and target disk are the same size. It works when 
the target disk is bigger, but the slice will only be as big as the 
original slice.


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


Re: Using dd to Make a Clone of a Drive

2006-02-10 Thread Peter

--- Ken Stevenson [EMAIL PROTECTED] wrote:

 Peter wrote:
  
  I intend to use g4u.  I have done some preliminary testing and I am
 quite
  confident that I can upload and download an image.  I am now wondering
  about the situation where I need to recreate the partition that is to
  contain the image.  It needs to be exactly the same size (sectors) as
 the
  image.  That's what I'm worried about.  Any suggestions?
  
 
 You don't create a partition to restore to when you're using g4u. It 
 does a bit by bit copy so it creates the slice and partitions for you 
 automatically.

Rock on!  I missed that part I guess.  Looks like I'm all set with g4u
then.

Thanks a million.






__ 
Find your next car at http://autos.yahoo.ca
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Using dd to Make a Clone of a Drive

2006-02-10 Thread Bart Silverstrim


On Feb 10, 2006, at 11:11 AM, Peter wrote:



--- Bart Silverstrim [EMAIL PROTECTED] wrote:



On Feb 10, 2006, at 9:50 AM, Giorgos Keramidas wrote:


On 2006-02-10 09:44, Peter [EMAIL PROTECTED] wrote:

--- Giorgos Keramidas [EMAIL PROTECTED] wrote:

As long as the new slice had enough space, geometry shouldn't
matter to dump|restore   ?


Right :)  It also allows restoring in a different partition layout.


Any chance of there being a way like this to restore to windows
systems
from the FreeBSD box?


Not really.  I'm far from being a Windows expert though, so YMMV.


As an image?  Look up partimage and partimaged.  We've had some luck
restoring from both a Linux system running the Partimaged daemon and
booting from a Linux disk and restoring images off a samba/Windows
share using partimage.


I intend to use g4u.  I have done some preliminary testing and I am 
quite

confident that I can upload and download an image.  I am now wondering
about the situation where I need to recreate the partition that is to
contain the image.  It needs to be exactly the same size (sectors) as 
the

image.  That's what I'm worried about.  Any suggestions?


Never used g4u...I know that with partimage, if I imaged, say, a 4 gig 
drive, then pulled it down to a 6 gig drive and booted Windows, Windows 
(2000) would see 4 gig.  I had to use a partition editor (there was a 
graphical one on one of the Linux rescue CDs) that I used to enlarge 
the partition, and Win2k didn't seem to care at all.  Qtparted, maybe?


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


Re: Using dd to Make a Clone of a Drive

2006-02-09 Thread Erik Trulsson
On Thu, Feb 09, 2006 at 02:36:18PM -0600, Martin McCormick wrote:
   After installing FreeBSD5.4, the ISC dhcp server and ISC bind
 on a hard drive, I wanted to clone that drive to a second drive so as
 to generate a second server, using what I had already installed as a
 template.  I used the following command:
 
 dd if=/dev/da0 of=/dev/da1 bs=512
 
   It turns out that dd defaults to 512-byte blocks so I didn't
 really need the bs=512, but I am not sure I haven't made some other
 type of mistake.  The dd command has been running for about 4 hours on
 a very fast system, with a 1-gig processor, 1 gig of RAM and two 31-GB
 drives.  One would think it should have finished by now, but it is
 still running.  Is this a valid method of copying the entire contents
 of one drive to another?  Thank you.

The reason it is taking so long is almost certainly because you are using
such a small blocksize.  

As it is 'dd' will read 512 bytes from da0, write those 512 bytes to da1,
read another 512 bytes from da0 (which will probably mean waiting a couple
of milliseconds for the head to get into the right position since the disk
will have rotated sinc the last read), etc.   The speed of your CPU, or the
amount of RAM you have, is quite irrelevant in this case.

If you try with bs=64k I can almost guarantee it will be a lot faster.


Otherwise it is a perfectly good way of making a copy of a disk, provided
both disks have the same size and geometry.


-- 
Insert your favourite quote here.
Erik Trulsson
[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: Using dd to Make a Clone of a Drive

2006-02-09 Thread Mike Jeays
On Thu, 2006-02-09 at 14:36 -0600, Martin McCormick wrote:
   After installing FreeBSD5.4, the ISC dhcp server and ISC bind
 on a hard drive, I wanted to clone that drive to a second drive so as
 to generate a second server, using what I had already installed as a
 template.  I used the following command:
 
 dd if=/dev/da0 of=/dev/da1 bs=512
 
   It turns out that dd defaults to 512-byte blocks so I didn't
 really need the bs=512, but I am not sure I haven't made some other
 type of mistake.  The dd command has been running for about 4 hours on
 a very fast system, with a 1-gig processor, 1 gig of RAM and two 31-GB
 drives.  One would think it should have finished by now, but it is
 still running.  Is this a valid method of copying the entire contents
 of one drive to another?  Thank you.
 
 
 Martin McCormick WB5AGZ  Stillwater, OK 
 Systems Engineer
 OSU Information Technology Department Network Operations Group
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
-- 
Mike Jeays
http://ca.geocities.com/[EMAIL PROTECTED]

You can use a much bigger block size, and the job will take significantly less 
time to run.
I have successfully used a blocksize of 512000.  Keep it to a multiple of 512.
 
I haven't tried even larger block sizes, but I think they would work fine.

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


RE: Using dd to Make a Clone of a Drive

2006-02-09 Thread Gayn Winters
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Martin McCormick
 Sent: Thursday, February 09, 2006 12:36 PM
 To: freebsd-questions@freebsd.org
 Subject: Using dd to Make a Clone of a Drive
 
 
   After installing FreeBSD5.4, the ISC dhcp server and ISC bind
 on a hard drive, I wanted to clone that drive to a second drive so as
 to generate a second server, using what I had already installed as a
 template.  I used the following command:
 
 dd if=/dev/da0 of=/dev/da1 bs=512
 
   It turns out that dd defaults to 512-byte blocks so I didn't
 really need the bs=512, but I am not sure I haven't made some other
 type of mistake.  The dd command has been running for about 4 hours on
 a very fast system, with a 1-gig processor, 1 gig of RAM and two 31-GB
 drives.  One would think it should have finished by now, but it is
 still running.  Is this a valid method of copying the entire contents
 of one drive to another?  Thank you.

At this point, let it run.  There was a discussion last month on the
hackers distribution list on increasing dd disk to disk transfer rate;
it discussed larger block size, piping (dd if=... | dd of=...), and
disk_recover.  It is also possible to create your own distribution disk,
which may be appealing if you do a lot of cloning.  Finally, there is
always backup|restore.  As for speed, dd will probably be last in a
race, especially with large, mostly empty, disks.

-gayn

Bristol Systems Inc.
714/532-6776
www.bristolsystems.com 


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


Re: Using dd to Make a Clone of a Drive

2006-02-09 Thread Martin McCormick
I thought I was limited to only the block size of the disks.
I am now trying a much larger block size as suggested and will see
what happens.  Many thanks.

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


Re: Using dd to Make a Clone of a Drive

2006-02-09 Thread Giorgos Keramidas
On 2006-02-09 14:36, Martin McCormick [EMAIL PROTECTED] wrote:
   After installing FreeBSD5.4, the ISC dhcp server and ISC bind
 on a hard drive, I wanted to clone that drive to a second drive so as
 to generate a second server, using what I had already installed as a
 template.  I used the following command:

 dd if=/dev/da0 of=/dev/da1 bs=512

   It turns out that dd defaults to 512-byte blocks so I didn't
 really need the bs=512, but I am not sure I haven't made some other
 type of mistake.  The dd command has been running for about 4 hours on
 a very fast system, with a 1-gig processor, 1 gig of RAM and two 31-GB
 drives.  One would think it should have finished by now, but it is
 still running.  Is this a valid method of copying the entire contents
 of one drive to another?  Thank you.

Bah!  That's too slow for my taste.  I would usually go for a newfs,
dump, and restore option.  For instance, to create a copy of /usr on a
second disk:

newfs -U /dev/ad1s1a
mount /dev/ad1s1a /mnt
dump -0 -a -L /usr | ( cd /mnt ; restore ruvf - )

Copying with dd(1) is not as fast :)

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


Re: Using dd to Make a Clone of a Drive

2006-02-09 Thread Paul Schmehl
--On Friday, February 10, 2006 00:01:23 +0200 Giorgos Keramidas 
[EMAIL PROTECTED] wrote:



On 2006-02-09 14:36, Martin McCormick [EMAIL PROTECTED] wrote:

After installing FreeBSD5.4, the ISC dhcp server and ISC bind
on a hard drive, I wanted to clone that drive to a second drive so as
to generate a second server, using what I had already installed as a
template.  I used the following command:

dd if=/dev/da0 of=/dev/da1 bs=512

It turns out that dd defaults to 512-byte blocks so I didn't
really need the bs=512, but I am not sure I haven't made some other
type of mistake.  The dd command has been running for about 4 hours on
a very fast system, with a 1-gig processor, 1 gig of RAM and two 31-GB
drives.  One would think it should have finished by now, but it is
still running.  Is this a valid method of copying the entire contents
of one drive to another?  Thank you.


Bah!  That's too slow for my taste.  I would usually go for a newfs,
dump, and restore option.  For instance, to create a copy of /usr on a
second disk:

newfs -U /dev/ad1s1a
mount /dev/ad1s1a /mnt
dump -0 -a -L /usr | ( cd /mnt ; restore ruvf - )

Copying with dd(1) is not as fast :)


Have you tried dcfldd?  sysutils/dcfldd

It's both faster and more informative than dd.  Cat the pkg-descr file.

Paul Schmehl ([EMAIL PROTECTED])
Adjunct Information Security Officer
University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu/ir/security/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Using dd to Make a Clone of a Drive

2006-02-09 Thread Kevin Kinsey

Giorgos Keramidas wrote:


On 2006-02-09 14:36, Martin McCormick [EMAIL PROTECTED] wrote:
 


After installing FreeBSD5.4, the ISC dhcp server and ISC bind
on a hard drive, I wanted to clone that drive to a second drive so as
to generate a second server, using what I had already installed as a
template.  I used the following command:

dd if=/dev/da0 of=/dev/da1 bs=512

It turns out that dd defaults to 512-byte blocks so I didn't
really need the bs=512, but I am not sure I haven't made some other
type of mistake.  The dd command has been running for about 4 hours on
a very fast system, with a 1-gig processor, 1 gig of RAM and two 31-GB
drives.  One would think it should have finished by now, but it is
still running.  Is this a valid method of copying the entire contents
of one drive to another?  Thank you.
   



Bah!  That's too slow for my taste.  I would usually go for a newfs,
dump, and restore option.  For instance, to create a copy of /usr on a
second disk:

   newfs -U /dev/ad1s1a
   mount /dev/ad1s1a /mnt
   dump -0 -a -L /usr | ( cd /mnt ; restore ruvf - )

Copying with dd(1) is not as fast :)

 


Sorry to butt in --- but I'm needing to start cloning too.  Looks
like a winner to me ... wouldn't this have the added advantage 
of making same size and geometry (cf. Erik Trulsson, 4 hours ago,

this thread) less relevant?

As long as the new slice had enough space, geometry shouldn't
matter to dump|restore   ?

Kevin Kinsey


--
A committee is a group that keeps the minutes and loses hours.
-- Milton Berle


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