Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2002 17:16:26 -0400
From:      Rob Ellis <rob@web.ca>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: how to use 'dd' to create image of a hard drive?
Message-ID:  <20020930211626.GS28962@web.ca>
In-Reply-To: <3.0.5.32.20020930155536.028ece30@mail.sage-one.net>
References:  <Pine.GSO.4.33.0209181612280.9213-100000@themis.cs.uh.edu> <3.0.5.32.20020930155536.028ece30@mail.sage-one.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 30, 2002 at 03:55:36PM -0500, Jack L. Stone wrote:
> At 03:50 PM 9.30.2002 -0500, Pranav A. Desai wrote:
> >
> >Hi all!
> >
> >	Can I use something like
> >
> >dd if=/dev/ad0 of=/dev/ad1
> >
> >to copy every thing from first drive to the second and be able to boot
> >from the second drive? Do I need to specify block size ? The second drive
> >doesnt have anything on it (filesystem or slices).
> >
> >Thanks
> >
> >-Pranav
> >
> 
> You would use this for IDE HDs:
> # dd if=/dev/ad0 of=/dev/ad1 bs=8192 #Change the "bs" switch to something
> that works best for you.
> 
> Of importance is that ad1 be equal to or larger than ad0. If larger, then
> that larger portion will be unusable.
> 

To make the new disk bootable you want to copy the disklabel 
and bootstrap code -- but then you probably also want to do that 
on a slice rather than the disk device (e.g., "ad0s1" rather than "ad0") --
check your setup.

So you might do something like this:

  # example only, don't cut & paste
  dd if=/dev/ad0s1 of=/dev/ad1s1 bs=128k # for ata
  disklabel /dev/ad0s1 > disklabel.ad0s1
  disklabel -R -B /dev/ad1s1 disklabel.ad0s1

- Rob

--
Rob Ellis <rob@web.ca>
System Administrator, Web Networks

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




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