Subject: Re: Cloning /dev/wd0
To: Frederick Bruckman <fredb@immanent.net>
From: David Laight <david@l8s.co.uk>
List: netbsd-help
Date: 12/10/2002 14:26:36
On Tue, Dec 10, 2002 at 08:05:17AM -0600, Frederick Bruckman wrote:
> On Tue, 10 Dec 2002, Nicolas Saurbier wrote:
> 
> > I have a Harddisk /dev/wd0 and I want to mirrow it on /dev/wd2. wd0 has several partitions.
> >
> > On Linux I would do a "dd if=/dev/hda of=/dev/hdc" and mirrow everything on hda on hdc.
> > Now I´m looking for a possibility to do a "dd" on NetBSD that copys all partitions on wd0 to wd2.
> >
> > How shall I do this? Is there something like "hda" (the whole HD), may be just wd0???? (I know,
> > there is no wd0)
> 
> On NetBSD, the whole (first) disk is "/dev/wd0d", the third is
> "/dev/wd2d".
> 
> One warning: sometimes when you try to write past the end, the kernel
> spews messages, then downgrades the DMA mode, which is inconvenient.
> The work-around is to calculate and supply the exact "count" to "dd"
> for a given "bs".

You will also, probably, find that netbsd will refuse to write
to the sector that is believes contains the netbsd disklabel.
This might be sector 0 if the disk doesn't have a netbsd partition.
The DIOCWLABEL ioctl will let you do the write...

	David

-- 
David Laight: david@l8s.co.uk