Subject: Re: Lost target files until reboot
To: None <bwildasi@csulb.edu>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 07/01/1997 10:23:43
> **PROBLEM: Lost target files until reboot**
> Here's a long list of uglies; two netbsd currents were installed, one
> after the other (snapshots 970601 then 970402), with the tests repeated.
> Then follows a disklabel and dmesg for hardware info.
> 
>  Any help is appreciated!
> 
> -------------netbsd -current 970601 & GENERIC-32 on Q700
> # mount -u /
> /dev/sd2a on / type ffs (local)
> # cd root
> #ls -l
> -rw-r--r-- 2 0 wheel 721 Jun 7 04:06 .cshrc
> -rw------- 1 0 wheel   0 Jun 7 04:06 .klogin
> -rw-r--r-- 1 0 wheel  64 Jun 7 04:06 .login
> -rw-r--r-- 2 0 wheel 230 Jun 7 04:06 .profile
> # cp .profile  .profile_test
> # ls -l
> # <no files listed!>
> # pwd
> /root
> #ls
> #  <no files listed!>
> # sync
> # reboot
> NetBSD kernel security level changed from 0 to 1
> NetBSD doesn't trust itself ...<scrolled by too quickly for me to read
> it, sorry>
> booting...
> # cd root
> # pwd
> /root
> # ls -l
> -rw-r--r-- 2 0 wheel 721 Jun  7 04:06 .cshrc
> -rw------- 1 0 wheel   0 Jun  7 04:06 .klogin
> -rw-r--r-- 1 0 wheel  64 Jun  7 04:06 .login
> -rw-r--r-- 2 0 wheel 230 Jun  7 04:06 .profile
> -rw-r--r-- 1 0 wheel 230 Jun 29 11:02 .profile_test
> #cp .profile_test  .profile_test2
> cp: .profile_test2: Read-only file system
> mount -u /
> # ls -l .p*
> -rw-r--r-- 2 0 wheel 230 Jun 7 04:06 .profile
> -rw-r--r-- 1 0 wheel 230 Jun 29 11:02 .profile_test
> # cp .profile_test  .profile_test2
> # ls -l .p*
> ls: .p*: No such file or directory
> # ls -l
> # <no files listed; boo hiss!>
> # sync
> # reboot
> booting....
> #cd root
> # ls -l .p*
> -rw-r--r-- 2 0 wheel 230 Jun  7 04:06 .profile
> -rw-r--r-- 1 0 wheel 230 Jun 29 11:02 .profile_test
> -rw-r--r-- 1 0 wheel 230 Jun 29 11:32 .profile_test2
> # sync
> # reboot
> booting...
> -------------This looks like trouble here. See disklabel, dmesg, and
> mkfs at very end.
> # fsck -fy
> ** /dev/rsd2a
> ** Last Mounted on /
> ** Root file system
> ** Phase 1 - Check Blocks and Sizes
> ** Phase 2 - Check Pathnames
> ** Phase 3 - Check Connectivity
> ** Phase 4 - Check Reference Counts
> ** Phase 5 - Check Cyl groups
> 6901 files, 88196 used, 28499 free (331 frags, 3521 blocks, 0.3%
> fragmentation)
> MARK FILE SYSTEM CLEAN? yes
> CANNOT WRITE: BLK 16
> CONTINUE? yes
> THE FOLLOWING SECTORS COULD NOT BE WRITTEN:
> 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
> CANNOT WRITE: BLK 208
> CONTINUE? yes
> THE FOLLOWING SECTORS COULD NOT BE WRITTEN: 208,209,

This problem looks VERY bad. Can you try on of the disk partitioners
which does write integrity tests? Stress the drive and see how it
does.

Also, I think you should probably send EMail to current-users, as this
problem might not be mac specific (it might be...).

> # sync
> # reboot
> booting...
> # mount -u /
> # cd root
> #ls
> .cshrc   .klogin   .login   .profile   .profile_test   .profile_test2
> # rm .profile_test2
> # ls  .p*
> ls:  .p*: No such file or directory
> # pwd
> /root
> # sync
> # reboot
> ---------------Let's try a different Kernel!  GENERICSB-32

You don't need to do that as you aren't using the SCSI chip which has
two drivers. You're using the esp driver, which doesn't change
between an sbc and an ncrscsi kernel. You can tell by the
esp0 at obio and scsibus0 at esp0 lines in the message lines below.

> booting...
> MacOS - side applications:
> installer...
> SCSI ID6,   IBM,   KZ-C,   [OK]
> minishell
> > rm netbsd
> > install   ->  GENERIC-32
> Cmd+q
> booting...
> #cd root
> #pwd
> /root
> # ls
> .cshrc    .klogin    .login    .profile    .profile_test
> # cp  .profile    .profile_test2
> cp: .profile_test2: Read-only file system
> # mount -u /
> # cp .profile  .profile_test2
> # ls
> # <no files show!>
> # pwd
> /root
> #reboot
> ---------------- Let's try an earlier file system and kernel!
> mkfs_1.43
> installer...
> SCSI  ID6, IBM, KZ-C, [OK]
> installed netbsd current 970402 & GENERIC-27
> #mount -u /
> # /dev/rsd2a: file system not clean; please fsck(8)
> #reboot
> booting....
> # dmesg >  dmesg_bootinfo
> # ls
> # <no files listed!>
> # sync
> # reboot
> booting...
> # ls -l dm*
> -rw-r--r-- 1 root wheel  2252 Jun 30 17:54 dmesg_bootinfo
> 
> --------------Here's the hardware info for this machine
> # disklabel sd2
> # /dev/rsd2c:
> type: SCSI
> disk: SCSI disk
> label: fictitious
> flags:
> bytes/sector: 512
> sectors/track: 38
> tracks/cylinder: 8
> sectors/cylinder: 304
> cylinders: 1058
> total sectors: 325864
> rpm: 3600
> interleave: 1
> trackskew: 0
> head switch: 0
>     # milliseconds
> track-to-track seek: 0 # milliseconds
> drivedata: 0
> 
> 4 partitions
> #    size  offset     fstype  [fsize  bsize  cpg]
> a: 242048      64     4.2BSD   0      0      0      #(Cyl.   0*-796*)
> b:  83720  242112       swap                        #(Cyl. 796*-1071*)
> c: 325864       0     unused   0      0             #(Cyl. 0-1071*)
> d:     32    325832   unknown                       #(Cyl. 1071*-1071*)
> disklabel: boot block size 0
> disklabel: super block size 0
> 
> less dmesg_bootinfo
> NetBSD 1.2D (GENERICSBC) #27: Tues Apr 8 01:27:24 CDT 1997
>     scottr@beech: /a/src/sys/arch/mac68k/compile/GENERIC
> Apple Macintosh Quadra 700 (68040)
> real mem = 20971520
> avail mem = 17068032
> using 204 buffers containing 835584 bytes of memory
> mrg: macIIci/Q700 ROMs ROM glue, tracing off, debug off, silent traps
> mrg: I/O map kludge for ROMs that use harware addresses directly.
> adb: bus subsystem
> \^H\^Hadb: extended keyboard at 2
> adb: relative positioning device (mouse?) (50) at 3
> adb: relative positioning device (tablet?) (58) at 4
> adb: 100 dpi mouse at 15
> adb: 200 dpt mouse at 14
> mainbus0 (root)
> obio0 at mainbus0
> adb0 at obio0 (ADB event device)
> asc0 at obio0:  Apple Sound Chip
> intvid0 at obio0: DAFB: Monitor Sense 1.
> intvid0: 640x480, monochrome
> grf0 at intvid0
> ite at grf0 not configured
> sn0 at obio0 address 08:00:07:54:0f:66
  vvvvvvvvvvv Here's the scsi chip
> esp0 at obio0: address 0x896000: NCR53C96, 25MHz, SCSI ID7
> scsibus0 at esp0: 8 targets
  ^^^^^^^^^^^ Here's the scsi bus it's on.
> sd0 at scsibus0 targ 0 lun 0: <SEAGATE, ST31230N, 0594> SCSI 0/direct
> fixed
> sd0: 1010MB, 3992 Cyl, 5 head, 103 sec, 512 bytes/sec
> cd0 at scsibus0 targ 2 lun 0: <MEDAVIS, RENO CD-ROMX2A, 2.03> SCSI2
> 5/cdrom removeable

All of the uk's can be fixed. Some SCSI devices don't respect Logical
Unit Numbers. There's a quirk database, which this one needs to join.
Please send in a send-pr on it (just copying the lines as you
posted them should be enough, I think).

> uk at scsibus0 targ 2 lun 1: < , , > SCSI7 16/unknown fixed offline
> uk0: unknown device
> uk1 at scsibus0 targ 2 lun 2: < , , > SCSI7 16/unknown fixed offline
> uk1: unknown device
> uk2 at scsibus0 targ 2 lun 3: < , , > SCSI7 16/unknown fixed offline
> uk2: unknown device
> uk3 at scsibus0 targ 2 lun 4: < , , > SCSI7 16/unknown fixed offline
> uk3: unknown device
> uk4 at scsibus0 targ 2 lun 5: < , , > SCSI7 16/unknown fixed offline
> uk4: unknown device
> uk5 at scsibus0 targ 2 lun 6: < , , > SCSI7 16/unknown fixed offline
> uk5: unknown device
> uk6 at scsibus0 targ 2 lun 7: < , , > SCSI7 16/unknown fixed offline
> uk6: unknown device
> sd1 at scsibus0 targ 4 lun 0: <iomega, jaz 1GB, J.83> SCSI2  0/direct
> removeable
> sd1: drive offline
> sd2 at scsibus0 targ 6 lun 0: <IBM, KZ-C, R167> SCSI1 0/direct fixed
> sd2: 159MB, 1058 cyl, 8 head, 38 sec, 512 bytes/sec
> zsc0 at obio0 chip type 0
> 

Take care,

Bill