Subject: Rebuild the kernel?
To: Dave Huang <khym@bga.com>
From: brian <bwildasi@csulb.edu>
List: port-mac68k
Date: 07/04/1997 09:03:47
Hi Dave!

To rebuild or not to rebuild...

Can netbsd rebuild its kernel given that the installed system looses its
target directory and files until reboot?

> Problem: Lost target files until reboot
[a suggested  patch]
> The problem you're seeing is similar to something I experienced
> about a year ago. Some scsi drives don't handle residual data
> pointers correctly (I don't fully understand the problem, just
> know of a potential fix). On my drive, I would create a file
> on the drive and the partition would no longer be accessable like
> you describe. The solution was to add an entry into the quirk
> table to force the "SDEV_AUTOSAVE" then build a new kernel with
> the change.
> 
> Here's an example entry in src/sys/scsi/scsiconf.c:
> 
>         {{T_DIRECT, T_FIXED,
>          "DEC     ", "RZ55     (C) DEC", ""},     SDEV_AUTOSAVE},
>
[the rebellious harddrive?]
> > 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
>
[the bug]
> -------------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

Any help is appreciated!

sincerely....brian w.
bwildasi@csulb.edu