Subject: file system and X problems
To: None <port-mac68k@NetBSD.ORG>
From: Taras Ivanenko <ivanenko@ctpa03.mit.edu>
List: port-mac68k
Date: 03/17/1996 09:19:47
I was trying to install NetBSD on my mac IIcx + external CONNER 1Gb
hard drive. I have partitioned the drive as 
500M HFS + 32 Mb Swap + 500M NetBSD (in this order). After I installed
base+etc, the system did not want to fsck the partition. After some
hacking, I found the problem: fsck trys to read the alternative
superblock from the last CG. It got zeros in my case. It also tried to
make up superblock from the disklabel information but some fields in
the structure returned by getdisklabel() were zero. When fsck computed
the block offsets for zero block size, it died because of zero
division (cf. function calcsb()). I do not know if this feature is a
bug by itself, is anyone willing to check?

So I hacked the fsck code so that it did not complain and the system
worked smoothly for some time. I have installed all distribution, X,
extra GNU sources, some 200M of data. After I rebooted, my MAC
died. The reason: NetBSD put some junk onto the first blocks of the
disk overwriting the partition table, the driver and HFS system
blocks. Actually, I saw this problem twice but at first thought that
it may be my fault. 

I can think of two possible sources of this problem:
1) NetBSD SCSI driver does not check partition limits (yes, the
   relevant code is commented out in the distribution!) and my disk or
   the driver wrapped  the sectors numbers.
2) Mkfs rounded integers wrong way. I had the partition size not
   multiple of CG size and Mkfs complained that some sectors were left
   out. Did it actually count those sectors and also some sectors
   beyond the partition?

I have partitioned the disk now by NetBSD+Swap+HFS to have some buffer
before HFS partition. I also checked that NetBSD partition is divided
evenly by Mkfs. It would be interesting to see what happens when
swap space is overwritten with junk.

Finally, some X problems. Before that nasty disk crash I was running
X.11Mar95 + Xmacbsd-961027. After I run xinit I got console message
about video, correct screen size and some addresses. ( I do not
remember and can not repet it). After that the upper part screen was
divided into 8 colored squares with smaller white rectangles in
them. It seems that X has created 8 identical small displays. The
mouse movement and text were identical in all windows and I can even
run X clients (but I can not read the text!). xdm worked the same: 8
identical login screens. Did I forget some options or some config
files?

I will start all over again filling MAC and Unix partitions with
files. For a moment I am very unhappy with those crashes (this was the
third one since I started to play with NetBSD).

	Taras Ivanenko <ivanenko@ctpa03.mit.edu>