Subject: fsck_msdos vs. bad sectors
To: None <port-i386@NetBSD.ORG>
From: Rafal Boni <rkboni@concentric.net>
List: port-i386
Date: 01/01/1997 07:13:20
Folks:
	First of all, before I start my tale of woe, I would like to thank
	all those that have contributed to the NetBSD project and wish them
	a happy New Year!  We appreciate your work even when it occasionally
	causes us 'growing pains'.

	Now, on to my problem:
	I think I've just discovered another dandy way to screw up your DOS
	partitions from NetBSD... Two of my MS-DOS partitions were pretty 
	handily nuked after fsck_msdos had their way with them.

	My hypothesis is that fsck_msdos does not play nice with drives that
	have bad sectors re-mapped by DOS.  Running fsck_msdos on a partition
	that does have bad sectors mapped out gives this message for starters:

	"Cluster XXX in FAT 0 continues with reserved cluster number 65xxx"
	After which fsck_msdos prompts you whether you would like to truncate
	the entry.  If you answer "yes", prepare to say goodbye to your data.

	If you don't answer yes, it will (possibly) complain about further 
	cases of in FAT 0, and then again with the same error messages for
	FAT 1.  Skipping all the requests for truncation, I get erros in phase
	2 of the sort "Cluster chain starting at XXX ends with cluster marked 
	bad.  Clear chain starting at XXX? [yn]", where XXX coincides with one
	of the XXX values in phase 1.

	Since my two DOS partitions were pretty well toasted by my answering 
	"yes" to all of fsck_msdos's questions in a previous run, I'm more than
	game for doing some more experiments to help in fixing this... Or if I
	don't see any interest, I'll try and document this as well as I can and
	send-pr it, although I'd like some enlightened input before I do that.

--rafal

----
Rafal Boni                                                rkboni@concentric.net