Subject: Re: newfs complains "Read-only file system"
To: None <netbsd-help@netbsd.org>
From: Dieter <netbsd@sopwith.solgatos.com>
List: netbsd-help
Date: 06/02/2005 16:28:32
>> 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
>> (and some others as well) complains:
>> 
>> /dev/wd0a: 98.4MB (201600 sectors) block size 8192, fragment size 1024
>>         using 4 cylinder groups of 24.61MB, 3150 blks, 6080 inodes.
>> super-block backups (for fsck -b #) at:
>>      32,  50432, 100832, 151232,
>> 
>> /dev/wd0b: 5000.6MB (10241280 sectors) block size 16384, fragment size 2048
>>         using 28 cylinder groups of 178.59MB, 11430 blks, 22400 inodes.
>> super-block backups (for fsck -b #) at:
>>       32,  365792,  731552, 1097312, 1463072, 1828832, 2194592, 2560352,
>>  2926112, 3291872, 3657632, 4023392, 4389152, 4754912, 5120672, 5486432,
>>  5852192, 6217952, 6583712, 6949472, 7315232, 7680992, 8046752, 8412512,
>>  8778272, 9144032, 9509792, 9875552,
>> wtfs: write error for sector 16: Read-only file system
>
> Can you show the disklabel for this drive ? Could be that it's trying to
> write to a protected sector.

I tried changing the block/frag size from 16384/2048 to 8192/1024 and
the Read-only complaint went away (at least for partition b).
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 8192, fragment size 1024
        using 110 cylinder groups of 45.46MB, 5819 blks, 11264 inodes.
super-block backups (for fsck -b #) at:
       32,    93136,   186240,   279344,   372448,   465552,   558656,   651760,
   744864,   837968,   931072,  1024176,  1117280,  1210384,  1303488,  1396592,
[ ... ]


# /dev/rwd0c:
type: ESDI
disk: ST3250823AS     
label: SATA 0 Seagate
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 484521
total sectors: 488397168
rpm: 7200
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

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)