Subject: Re: newfs trashes MBR/disklabel?
To: Dieter <netbsd@sopwith.solgatos.com>
From: David Laight <david@l8s.co.uk>
List: netbsd-help
Date: 08/28/2005 20:39:01
On Sun, Aug 28, 2005 at 08:55:37AM +0100, Dieter wrote:
> For me, /usr is the partition that runs out of space when installing
> all those bloated packages.

I don't run separate / and /usr - after all /usr used to be what /home is,
/usr/[s]bin only appeared becuase disks werem't big enough.

/tmp and /var (including /var/tmp) tend to sit in /

> Ah ha!  I figured that newfs must have overwritten something, but it wasn't
> obvious what, since I had left sectors 0-62 for MBR.  Thank you.

sysinst doesn't (yet maybe) create disklabel partitions for mbr partitions
you create inside sysinst.  However if teh disk doesn't have a netbsd
disklabel, the default label will contain entries for the mbe partitions.
 
> One more partition question.  Why does port-amd64 need to waste a partition
> for "netbsd" (partition c)?  Port-alpha only wastes one partition (for "whole
> disk", partition c on Alpha, partition d on amd64) so it would appear that
> NetBSD doesn't need it for anything.  Would anything bad happen if I used
> partition c for a filesystem?

You can't use 'c' for anything, the only thing I know it is used for is the
check against writing the disklabel sector.
I guess it is all steeped in the annals of history.
The initial BSD on i386 will have used 'c' as if it were a disk, and only
allowed filesystems to reside inside that area.
Later it was realised you needed access to the whole disk anyway, 'c'
was already used, so they stole 'd'.
When I did the stuff to make multiple netbsd mbr partitions work (and be
selectable by the bottselector) I realised that it all only made sense if
the netbsd disklabel described the partitioning of the whole disk, and that
it was saved at the beginning of EVERY type 169 partition (the first one
is used, the others are needed for when you change the type of the mbr
partition containing the first).

The big problem arises if you take a disk from another (non-mbr) system
and put it into an i386 (etc) one.  The disk has a nice 'd' partition
containing data - which you just can't access.  One possibility is to
swap c and d!  So 'd' is still the whole disk, but 'c' is the partition
that is 'd' elsewhere!

	David

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