[buug] dd to clone

Tony Godshall togo at of.net
Thu Mar 8 22:22:54 PST 2007


Oh, and I should mention that you can also dd just the MBR area, redo
the partions on the new drive, mkfs then new partions, and copy the
contents (I like rsync -avH).  The Filesystems-HOWTO has a good
section on imaging- looks like GNU parted is a single tool that can
make the partitions right and copy (and even resize in place if you
want to risk that).

On 3/8/07, Tony Godshall <togo at of.net> wrote:
> It usually works for me, as long as I don't go over those odd
> historical boundarys (like head/track/cyl-to-LBA or or 2GB or 8GB or
> old-LBA-to-48-bit).  Forgive me if I'm fuzzy on the specifics- the
> trick seems to be that the partition tables are compatible.
>
> I often save off images for future use too, like this...
>
>   # make sure empty space is compressible
>   mount /dev/hdx1 /mnt
>   dd if=/dev/zero of=/mnt/tmpzero; rm -f /mnt/tmpzero
>   umount /mnt
>   #(repeat for other partitions)
>   cat /dev/hdx | gzip > /bigexternaldrive/hdx.img.gz
>
> On 3/8/07, Bruce Ferrell <bferrell at baywinds.org> wrote:
> > I'm not too sure about putting the MBR from one disk onto a dissimilar
> > disk.  As I recall there may be stuff specific to the disk geometry...
> > been a long time and I could be wrong there
> >
> > John de la Garza wrote:
> > > This kind of gets back to me wanting to use dd.  From what I see this
> > > is a gui to dd (and some other things like netcat).  I'm kind of in
> > > need of a command line tool.  I only have a shell interface to work  with.
> > >
> > > Although, if I play with this I may get some ideas from looking at  what
> > > it does to image a drive.
> > >
> > >
> > > On Mar 8, 2007, at 2:17 PM, Bruce Ferrell wrote:
> > >
> > >> true, no mbr.  got something different:
> > >>
> > >> http://air-imager.sourceforge.net/
> > >>
> > >> Just saw it today
> > >>
> > >> John de la Garza wrote:
> > >>
> > >>> This wont copy the MBR or the partition table.  I am looking for  a
> > >>> way to clone a harddrive, not just a directory.
> > >>> On Mar 7, 2007, at 3:09 PM, Bruce Ferrell wrote:
> > >>>
> > >>>> use tar.  it'll give you an accurate copy independant of the
> > >>>> underlying hardware.  something like this:
> > >>>>
> > >>>> tar cvf - <hda root> | (cd <hdb root> ; tar xvf -)
> > >>>>
> > >>>>
> > >>>>
> > >>>> John de la Garza wrote:
> > >>>>
> > >>>>> I have a linux box that is up and running in a production
> > >>>>> environment.
> > >>>>> I want to reproduce the box for a backup server.  If I want to  use dd
> > >>>>> to copy the harddrive could I simply do something like:
> > >>>>> dd if=/dev/hda bs=1024k  of=/dev/hdb
> > >>>>> or must I know more about the hard drives and do some
> > >>>>> calculations  for
> > >>>>> how much data to copy?
> > >>>>> hdb is greater than or equal to the size of hda in this case
> > >>>>> _______________________________________________
> > >>>>> Buug mailing list
> > >>>>> Buug at weak.org
> > >>>>> http://www.weak.org/mailman/listinfo/buug
> > >
> > >
> > >
> > _______________________________________________
> > Buug mailing list
> > Buug at weak.org
> > http://www.weak.org/mailman/listinfo/buug
> >
>
>
> --
> --
> Tony Godshall
> g
>


-- 
--
Tony Godshall
g



More information about the buug mailing list