Subject: Re: newfs complains "Read-only file system"
To: None <sopwith.solgatos.com!netbsd@sopwith.solgatos.com>
From: David Laight <david@l8s.co.uk>
List: netbsd-help
Date: 06/03/2005 17:26:13
On Thu, Jun 02, 2005 at 04:28:32PM +0100, Dieter wrote:
> >> Trying to newfs my new SATA drive and install 2.0.2, but getting a strange
> >> "Read-only file system" error message from some (not all) partitions.
> >> Partition A appears to have worked fine, but partition B
...
> 
> I tried changing the block/frag size from 16384/2048 to 8192/1024 and
> I'm no FFS expert, but it seems odd that changing the block/frag size
> by a factor of 2 changed the cylinder groups?

> >> /dev/wd0b: 5000.6MB (10241280 sectors) block size 16384, fragment size 2048
> >>         using 28 cylinder groups of 178.59MB, 11430 blks, 22400 inodes.
> 
> /dev/wd0b: 5000.6MB (10241280 sectors) block size 8192, fragment size 1024
>         using 110 cylinder groups of 45.46MB, 5819 blks, 11264 inodes.

Yes - there is an allocation bitmap within each cylinder group that needs
one bit per fragment (+ inode) and is limited to the size of a fragment.
So doubling the fragment size allows each cylinder group to contain 4 times
as many fragments - so the filesystem requires 1/4 the number of cylinder
groups.

> > Can you show the disklabel for this drive ? Could be that it's trying to
> > write to a protected sector.
> 
> # /dev/rwd0c:
> total sectors: 488397168
> 
> 8 partitions:
> #        size  offset   fstype [fsize bsize cpg/sgs]
>  a:    201600       0   4.2BSD   1024  8192 25200  # (Cyl.      0 -    199)
>  b:  10241280       0   4.2BSD   1024  8192 46552  # (Cyl.      0 -  10159)
>  c: 488397168       0   unused      0     0        # (Cyl.      0 - 484520)
>  d:   4032000       0   4.2BSD   1024  8192 45824  # (Cyl.      0 -   3999)
>  e:  10241280       0   4.2BSD   2048 16384     0  # (Cyl.      0 -  10159)
>  f:  20482560       0   4.2BSD   2048 16384     0  # (Cyl.      0 -  20319)
>  g: 378686448       0   4.2BSD   2048 16384     0  # (Cyl.      0 - 375680)
>  h:  64512000       0   4.2BSD   2048 16384     0  # (Cyl.      0 -  63999)

I can't possibly image that is what you had in mind!
All those filesystems overlap!

Also you don't really want a filesystem in partition 'b', IIRC there isn't
much to stop the kernel dumping to it.
On i386 both 'c' and 'd' are reserved as well.

	David

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