Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Oct 2002 14:39:24 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        "Jack L. Stone" <jackstone@sage-one.net>
Cc:        Mike Hogsett <hogsett@csl.sri.com>, "Mr. Darren" <darren780@yahoo.com>, freebsd <freebsd-stable@FreeBSD.ORG>
Subject:   Re: copy harddrive image 
Message-ID:  <200210292239.g9TMdO64011366@apollo.backplane.com>
References:  <200210292048.g9TKmG1J015723@axp.csl.sri.com> <3.0.5.32.20021029162139.010ec928@mail.sage-one.net>

next in thread | previous in thread | raw e-mail | index | archive | help
:Hi, Matt: I've never tried your "cpdup" program I just installed the port
:to try it.
:....and wonder:
:
:1) why you prefer it to ole dump/restore?

    cpdup is not a replacement for dump/restore.  That is, the programs do 
    different things.  cpdup does not produce an archive, for example,
    it's just a glorified copy that is able to retain softlinks, hardlinks,
    and other special features of files.  On the otherhand, cpdup works
    quite well on live filesystems and cpdup works incrementally, meaning
    you can ^C it and restart it at any time and it will pick up where it
    left off.  dump does not work well at all on a live filesystem and
    if you kill it you have to rerun it from scratch.

:2) what would be the typical syntax of the line command you use to copy
:over the ad0s1f to ad1s1f partition for example.
:
:I like your dd/cpdup combo approach and would like to try it on a test box.
:
:Best regards,
:Jack L. Stone,
:Administrator

    Just do a 'man cpdup', or run cpdup without options.  I typically
    just use 'cpdup srcdir destdir'.  Remember, cpdup will remove items
    from the destination that do not exist in the source.  It will ask
    first by default.

	Fdisk/disklabel/newfs the new disk

	Mount newdisk partitions in /mnt, mimicking your normal mounts.  for
	example:

	    mount /dev/ad1s1a /mnt
	    mkdir /mnt/usr
	    mount /dev/ad1s1d /mnt/usr
	    mkdir /mnt/var
	    etc...

	    cpdup / /mnt
	    cpdup /usr /mnt/usr
	    cpdup /var /mnt/var

	    (go into single user)

	    cpdup them all again

	    shutdown, swap disks, reboot.


    For dd the person who posted the comment in regards to block size is
    absolutely correct.  It is safest to run dd only on idle 
    filesystems, leaving the source filesystems mounted and the destination
    partitions unmounted (of course).  This way if you accidently specify 
    a source filesystem as a destination the OS will not allow the source 
    to be openned for writing (it will return a 'device busy' error),
    which can save your ass if you make a mistake.  But it also means you
    have to be sure the source filesystem are idle and sync'd up
    (sync; sync; sync; sync; ...), and that you have to fsck the
    destination partitions after the dd finishes.

	    # example
	    dd if=/dev/ad0s1a of=/dev/ad1s1a bs=1m

    Using dd can be dangerous.  Be sure not to accidently specify a
    destination that winds up overwriting your source drive!  Leaving
    the source mounted mitigates the risk of accidently blowing something
    important away.

						-Matt


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210292239.g9TMdO64011366>