Subject: Re: panic: bad dir
To: Ruibiao Qiu <ruibiao@arl.wustl.edu>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 01/11/2001 16:59:14
>> About all I can suggest is to boot from another disk and try to
>> patch the filesystem up.  If necessary, take the disk to another
>> machine and do it there.

> This is a disk on an SS5 box.  Can I fsck it on an i386 box?

Yes, provided

- the i386 has a compatible interface (ISTR you said sd1, hence SCSI)
  and its kernel knows about it;

- your i386's fsck is recent enough to have byte-swapping support;

- either the filesystem begins at the beginning of the disk or you have
  a tool that can set up an in-core disklabel for the disk.

If you want to actually mount the filesystem on the i386 you'll
additionally need FFS_EI turned on in its kernel.

I assume you've thought of the first point.

The second point is probably a non-issue, but needs mentioning.

The third point is problematic, except that the filesystem was an a
partition IIRC, which usually means it begins at offset zero.  This
means you can use the d partition on the i386 box and you won't need to
worry about disklabels.  (If you do need a disklabel reader, I have
something called sunlabel that can read the Sun label from the disk and
set an in-core label.)

The third point *can* be avoided at the price of some effort and pain
if you know the offset of the partition and have enough spare space on
the i386 to dd off the whole partition, fsck it, and dd it back.

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B