Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ihwpt!knudsen From: knudsen@ihwpt.ATT.COM (mike knudsen) Newsgroups: comp.sys.m6809 Subject: Suggestion for an OS9 utility Keywords: Bad Disk Sectors Message-ID: <2265@ihwpt.ATT.COM> Date: 20 Jan 88 19:23:42 GMT Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 36 I'd like to find, or get help to write, a simple (?) utility that would read thru an entire diskette and find all the bad (as in unreadable) sectors and mark them as in-use on the sector allocation bitmap so that they would never be assigned to any future files. Options from the command line would control: *what to do if a bad sector is already allocated (at least type warning; better to find what file it belongs to; maybe unlink it from that file); *whether to try and re-format just each bad sector (write some pattern on it and try to re-read it. If this works, then media itself is not [quite as] faulty.) *whether to create a single file in the root directory, named BAD.SECTORS, which would contain all the baddies. (I dislike this, since now a user could DEL that file and have all those bad sectors "loose" again.) I know that FORMAT is supposed to identify bad sectors when a disk is first formatted and set their allocation bits. However, I often find bad sectors showing up later, especially on DS80-track disks. I know how to read thru all the sectors (open /Dn@), but need some serious study of the allocation bitmap area. Also I assume it's very hard to find what file a given sector belongs to -- must search every file in every directory. Or is there a faster way? I know DCHECK can identify files with duplicate sectors, but I assume it starts with a recursive descent thru the directory tree anyway. -- Mike J Knudsen ...ihnp4!ihwpt!knudsen Bell Labs(AT&T) Delphi: RAGTIMER CIS: "Just say NO to MS-DOS!" "OS/2 == 1/2 of an OS"