Subject: Inode trash fixing
To: None <port-arm32@NetBSD.ORG>
From: Mark Brinicombe <amb@physig.ph.kcl.ac.uk>
List: port-arm32
Date: 11/17/1996 03:40:14
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---1991703386-1038391908-848202014=:22339
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hi,
  People who have been building their own kernels may have a few trashed 
inodes on their discs that they will only see if they fsck. At this point 
fsck will normally remove the files etc.

The solution is to run with a kernel with the ffs_inode.c patch and force the
kernel to access the trashed inodes. When the kernel tries to rewrite the
inodes it will patch them thus fixing them

To find out if you have trahsed inodes, try

fsck -n -f /dev/rwd0a

and similarly for other partition. fsck will report that names of files 
that have trashed inodes.

Attached is a simple script that can be used to force the kernel to patch 
these inodes.
To use just

fsck -n -f /dev/rwd0a >/tmp/wd0a
./forceinodepatch /tmp/wd0a

The script will copy each of the files with trashed inodes to /dev/null thus
force the kernel to update the access time and thus the inode will get 
patched when written back to disc.
Subsequent fsck'sshould show that these inodes are now fine.

Any q's then just ask.

Cheers,
				Mark


Mark Brinicombe				amb@physig.ph.kcl.ac.uk
Research Associate			http://www.ph.kcl.ac.uk/~amb/
Department of Physics			tel: 0171 873 2894
King's College London			fax: 0171 873 2716

---1991703386-1038391908-848202014=:22339
Content-Type: TEXT/PLAIN; charset=US-ASCII; name=forceinodepatch
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.SGI.3.91.961117034014.22339E@physig4.ph.kcl.ac.uk>
Content-Description: Script to force the kernel to patch trashed inodes.

IyEvYmluL3NoDQojDQojIFNjcmlwdCB0byBmb3JjZSB0cmFzaGVkIGlub2Rl
cyB0byBiZSBhY2Nlc3NlcyBhbmQgdGh1cyBwYXRjaGVkIGJ5IHRoZQ0KIyBr
ZXJuZWwNCiMNCiMgVG8gdXNlOg0KIw0KIyAgZnNjayAtbiAtZiAvZGV2L3dk
MGEgPmZzY2sud2QwYQ0KIyAgLi9mb3JjZWlub2RlcGF0Y2ggZnNjay53ZDBh
DQojDQojICBmc2NrIC1uIC1mIC9kZXYvd2QwZSA+ZnNjay53ZDBlDQojICAu
L2ZvcmNlaW5vZGVwYXRjaCBmc2NrLndkMGUNCiMNCiMgVGhpcyBuZWVkcyB0
byBiZSByZXBlYXRlZCBmb3IgZWFjaCBmaWxlc3lzdGVtDQojDQojDQpGSUxF
PSQxDQpNT1VOVD1gZ3JlcCAiTW91bnRlZCBvbiIgJEZJTEUgfCBhd2sgJ3tw
cmludCAkNX0nYA0KZWNobyAiRmlsZT0kRklMRSINCmVjaG8gIk1vdW50PSRN
T1VOVCINCmVjaG8gIkZpeGluZyBmaWxlczoiDQpmb3IgRklMRSBpbiBgY2F0
ICRGSUxFIHwgZ3JlcCAnRklMRT0nIHwgY3V0IC1kPSAtZjIgfCB1bmlxYDsg
ZG8NCgllY2hvICRNT1VOVC8kRklMRQ0KCWNhdCAkTU9VTlQvJEZJTEUgPi9k
ZXYvbnVsbA0KZG9uZQ0Kc3luYw0KZXhpdA0K
---1991703386-1038391908-848202014=:22339--