Re: dd question

2006-05-04 Thread Paul Chvostek
On Wed, May 03, 2006 at 05:36:46PM -0500, Andrew wrote:
 On Wed, 2006-05-03 at 14:11 -0600, Chad Leigh -- Shire.Net LLC wrote:
   Can I used dd from my freebsd box to  
  completely copy the whole disk, partition tables and all, to another  
  disk?
...
 have another suggestion. If you think the disk will be ok, use dd to
 zero-out the rest of the drive; i.e.
...
 One of these days, I am going to write a tool to do just this sort of
 thing, since it seems to be a fairly common practice.

I believe that tool would be g4u, http://www.feyrer.de/g4u/, along with
the FAQ at http://www.feyrer.de/g4u/#shrinkimg .

p

-- 
  Paul Chvostek [EMAIL PROTECTED]
  it.canadahttp://www.it.ca/

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


Re: dd question

2006-05-04 Thread Andrew
On Thu, 2006-05-04 at 10:15 -0400, Paul Chvostek wrote:
 On Wed, May 03, 2006 at 05:36:46PM -0500, Andrew wrote:
  On Wed, 2006-05-03 at 14:11 -0600, Chad Leigh -- Shire.Net LLC wrote:
Can I used dd from my freebsd box to  
   completely copy the whole disk, partition tables and all, to another  
   disk?
 ...
  have another suggestion. If you think the disk will be ok, use dd to
  zero-out the rest of the drive; i.e.
 ...
  One of these days, I am going to write a tool to do just this sort of
  thing, since it seems to be a fairly common practice.
 
 I believe that tool would be g4u, http://www.feyrer.de/g4u/, along with
 the FAQ at http://www.feyrer.de/g4u/#shrinkimg .

You are correct; although g4u is a collection of shell scripts, not an
executable. There is some debate about whether or not it needs to be
anything more than a shell script, but I think it makes sense. 

Right now we are using a re-write of g4u with FreeSBIE to install images
in a lab on campus. It sort of has a GUI; we're using 'cdialog' based
menus. I would like to re-write it in C, and add most of the features
listed at http://www.feyrer.de/g4u/#size. I know it would be quite
difficult, but I would like to add filesystem support to this
yet-to-be-written tool as well. And I think it should be multithreaded
too. This list of features seems to make this more of a programming
exercise than question of what's actually necessary to get the job done.
Anyway... When I get around to it...

-Andrew 

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


dd question

2006-05-03 Thread Chad Leigh -- Shire.Net LLC
I have a Windows machine that also has some linux partitions.  lilo  
is the main boot manager.  Can I used dd from my freebsd box to  
completely copy the whole disk, partition tables and all, to another  
disk?  The disk in the machine is starting to appear to be a little  
flaky and I have another of the same mechanisms here and would like  
to just basically clone the whole thing over.  I seldom use the  
machine but when I do need it I need it (tax time, an old website  
that uses a specific windows tool for updating, etc)


Thanks
Chad

---
Chad Leigh -- Shire.Net LLC
Your Web App and Email hosting provider
chad at shire.net



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


Re: dd question

2006-05-03 Thread Mike Hunter
On May 03 at 14:11, Chad Leigh -- Shire.Net LLC wrote:

 I have a Windows machine that also has some linux partitions.  lilo  
 is the main boot manager.  Can I used dd from my freebsd box to  
 completely copy the whole disk, partition tables and all, to another  
 disk?  The disk in the machine is starting to appear to be a little  
 flaky and I have another of the same mechanisms here and would like  
 to just basically clone the whole thing over.  I seldom use the  
 machine but when I do need it I need it (tax time, an old website  
 that uses a specific windows tool for updating, etc)

I've done this and had success.  You can boot the machine that you want to
dupe with a live CD, then dd from the disk to either a file somewhere or
straight to another disk, then you should be able to just boot from the
new disk (the new disk must be = the size of the old disk, people have
said that the exact same size is required, but I haven't found that to be
the case.)

A couple other quick plugs, check out ddrecover if you have bad sectors.
Last but not least, I've used netcat with success to do these dupes across
a (secure) network.

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


Re: dd question

2006-05-03 Thread Andrew
On Wed, 2006-05-03 at 14:11 -0600, Chad Leigh -- Shire.Net LLC wrote:
 I have a Windows machine that also has some linux partitions.  lilo  
 is the main boot manager.  Can I used dd from my freebsd box to  
 completely copy the whole disk, partition tables and all, to another  
 disk?  The disk in the machine is starting to appear to be a little  
 flaky and I have another of the same mechanisms here and would like  
 to just basically clone the whole thing over.  I seldom use the  
 machine but when I do need it I need it (tax time, an old website  
 that uses a specific windows tool for updating, etc)
 
 Thanks
 Chad

I've done this several times, and it works reasonably well. Someone
recommended piping the output through netcat, which will work; however I
have another suggestion. If you think the disk will be ok, use dd to
zero-out the rest of the drive; i.e.

dd if=/dev/zero of=zeros;
rm zeros; 
dd if=/dev/ad0 of=- | gzip - - | nc $HOSTNAME $PORT;

I've always used FTP instead of netcat, but you should be just fine.
netcat may even be a bit faster, since you don't have the overhead of
the FTP protocol. 

On the receiving end, just do the reverse:

nc -l $PORT | gzip -d - - | dd if=- of=/dev/ad0;

You can play around with blocksize too; sometimes it will speed up the
process a little bit.

One of these days, I am going to write a tool to do just this sort of
thing, since it seems to be a fairly common practice.

-Andrew


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