From owner-freebsd-hackers Wed May 9 22:41:22 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by hub.freebsd.org (Postfix) with ESMTP id 7225137B422 for ; Wed, 9 May 2001 22:41:18 -0700 (PDT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id 930A36ACBC; Thu, 10 May 2001 15:11:16 +0930 (CST) Date: Thu, 10 May 2001 15:11:16 +0930 From: Greg Lehey To: "Brian W. Buchanan" Cc: hackers@freebsd.org Subject: Re: fd driver hacking to recover data Message-ID: <20010510151116.L56501@wantadilla.lemis.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from brian@CSUA.Berkeley.EDU on Wed, May 09, 2001 at 10:04:34PM -0700 Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wednesday, 9 May 2001 at 22:04:34 -0700, Brian W. Buchanan wrote: > Any fdc driver gurus in the house? > > I have a bunch of old floppy disks with some text files I'd like to > recover. Many of them have errors and are unreadable past a certain point > in the disk. Others I can't read from at all. > > The ones I can't read, period, are all 1.44MB-size floppies. I've tried > dd'ing from /dev/fd0c, /dev/fd0.1440, etc., but exits with "Input/Output > Error" before copying anything. > > The kernel prints: > > fd0c: hard error reading fsbn 0 of 0-31 (ST0 40 ST1 1 ST2 0 > cyl 0 hd 0 sec 1) > > > I've been more successful reading 720K floppies from /dev/fd0.720, but > many of them have errors that stop dd in its tracks, yielding another > Input/Output error. > > The kernel prints: > > fd0c: hard error reading fsbn 1503 of 1488-1503 (ST0 44 > ST1 20 ST2 20 cyl 41 hd 1 sec 10) > > > Since the files on the disks are just text, all I want to do is to be able > to extract as many of the bits on the disk as possible, even if some of > the bits are wrong, and then run strings over it and sort out the > content. I've looked at the floppy driver source and it seems to be > incredibly low-level, i.e. it turns the drive motor on and off, even. Can > someone familiar with the driver give me some pointers as to what I'd have > to modify to let it 1) read those 1.44MB disks, and 2) tolerate data > errors? One possibility that I've used in the past is to use a 'read track' command. This was back in the days of 8" floppies, but I think the controllers still understand it. Basically the command starts at the index mark and transfers data with no kind of interpretation until the next index mark. It's up to the program to then find the start of each sector and extract the data. If you're up to this kind of hack, I can check for more details. Greg -- Finger grog@lemis.com for PGP public key See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message