Subject: Re: NetBSD 2.0_BETA on iBook
To: James Lemke <jim@TheLemkes.ca>
From: Darrin B. Jewell <dbj@NetBSD.org>
List: port-macppc
Date: 06/11/2004 12:38:24
James Lemke <jim@TheLemkes.ca> writes:

> > Well, I don't see anything wrong there.  I'm wondering if something
> > tried to use your NetBSD root filesystem as if it were apple ufs and
> > in the process corrupted it.
> > 
> > Can you boot a 2.0_BETA install kernel, get a shell and run:
> >   fsck_ffs -d -n -f /dev/rwd0a
> > 
> > and send the output, or at least the start of the output if it is long?
> 
> I grabbed the daily build 2.0 200406060000 install kernel.
> It doesn't boot properly, but it ends with the following on the screen,
> and then the beginning of fsck:
> 
> :
> boot device: wd0
> root on md0a dumps on md0b
> root file system type: ffs
> erase ^H...
> mount_mfs: unable to determine file system size
> Terminal type? [vt100]
> uid 0, pid 16, command tset, on /: file system full
> 
> /: write failed, file system is full
> [1] Segmentation fault    tset -s -m ":?${TERM}"
> (I)nstall, (S)hell, (H)alt? s
> #fsck_ffs...
> ** /dev/rwd0a (NO WRITE)
> detected ufs1 superblock not yet updated for ufs2 kernels
> clean = 1
> ** File system is already clean
> isappleufs = 1, dirblksiz = 1024
> ** Last mounted on /
> ** Phase 1 - Check Blocks and Sizes
> ** Phase 2 - Check Pathnames
> DIRECTORY /usr: LENGTH 512 NOT MULTIPLE OF 1024
> ADJUST? no
> DIRECTORY CORRUPTED  I=E  OWNER=root MODE=40755
> SIZE=512 MTIME=Jun 18 22:19 2003
> DIR=/usr
> 
> SALVAGE? no
> 

The problem is that there is an apple ufs disklabel
at offset 7k of the partition.  This is probably leftover
from having had a previous apple ufs filesystem there
without having had it zeroed when you installed netbsd.

To verify this, you can
  hexdump -Cv -s 7168 -n 1024 /dev/rwd0a
and see if that starts with 'LABL' in the first 4 bytes.

The fix is to
  dd if=/dev/zero of=/dev/rwd0a bs=512 count=2 seek=14

Which will blow away the apple disklabel and allow
NetBSD to use its filesystem.

I hope this problem is not terribly widespread.

Darrin

> 
> -- 
> Jim Lemke   jim@TheLemkes.ca   Orillia, Ontario
> 1992 ST1100, STOC #3750;   FWD# M:245401 H:246889
> "Time is the fire in which we burn." Dr. Tolian Soran