Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2002 20:42:15 -0400
From:      Rob Ellis <rob@web.ca>
To:        "Jack L. Stone" <jackstone@sage-one.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: how to use 'dd' to create image of a hard drive?
Message-ID:  <20021001004215.GU28962@web.ca>
In-Reply-To: <3.0.5.32.20020930173951.028ece30@mail.sage-one.net>
References:  <3.0.5.32.20020930155536.028ece30@mail.sage-one.net> <Pine.GSO.4.33.0209181612280.9213-100000@themis.cs.uh.edu> <3.0.5.32.20020930155536.028ece30@mail.sage-one.net> <3.0.5.32.20020930173951.028ece30@mail.sage-one.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 30, 2002 at 05:39:51PM -0500, Jack L. Stone wrote:
> At 05:16 PM 9.30.2002 -0400, Rob Ellis wrote:
> >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
> >
> 
> NO! An entire image is taken of the ad0 and no labeling is necessary. It is
> bootable already.
> 

Thanks, that's good to know.

The disklabel command on the slice does work though?
I was doing that on a two-slice config (os/data), when I wanted 
to copy just the first (small) slice and make it bootable... but now 
that you mention it, it is kind of roundabout when you have one slice 
and the disks are the same... :-)

If you're backing up a small disk onto new big disk, you might
want to slice the big disk differently?

- Rob

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?20021001004215.GU28962>