tech-install archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Anyone working on an automated install?

On Sat, Oct 27, 2012 at 08:29:40PM +0100, Julian Yon wrote:
> > # Zap existing mbr, should also hide any label
> > dd if=/dev/zero of=/dev/rwd0d count=1
> > 
> > # Zap early part of disk, things can get confused
> > dd if=/dev/zero of=/dev/rwd0d bs=1m count=2
> > [...]
> > The two zaps from /dev/zero are probably a good idea anyway (depending
> > on what the dsk was used for before).
> The first looks kind of redundant. Am I missing something?

You want to be able to zero the sector that contains any existing
NetBSD disk label.
The kernel won't let you do that unless you do an ioctl() first, and
the flag is cleared on last clse of all the disk partitions.
Zeroing the mbr sector stops the kernel finding a disk label [1] - so it
won't error the next write.


[1] Not entirely true if the label is in sector 0 or 1 (which might happen
if the disk has come from a non-i386 system).

David Laight:

Home | Main Index | Thread Index | Old Index