UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Closed Thread
 
Thread Tools
Old 16th Jul 2011, 6:51 pm   #1
Kat Manton
Retired Dormant Member
 
Kat Manton's Avatar
 
Join Date: Jul 2005
Location: West Yorkshire, UK.
Posts: 1,700
Default Rescuing old floppies

Hi,

I've been working through a load of old floppies containing MS-DOS files, the idea being to retrieve disk images which I can bung on my server or burn to CD; thereby creating backups which can either be used directly or can be put back onto floppy if needed. A lot of floppy images will fit on one CD-R!

First tool - 'ddrescue':

Code:
DDRESCUE(1)                      User Commands                     DDRESCUE(1)



NAME
       ddrescue - data recovery tool

SYNOPSIS
       ddrescue [options] infile outfile [logfile]

DESCRIPTION
       GNU  ddrescue - Data recovery tool.  Copies data from one file or block
       device to another, trying hard to rescue data in case of read errors.

       You should use a logfile unless you know what you are doing.
Here, I encountered errors while reading disk 17 of a set of 35 numbered disks (containing archived copies of old software.)

Code:
$ N="17"; ddrescue -v -r1 -c1 /dev/fd1 disk$N.img disk$N.log


About to copy 1474 kBytes from /dev/fd1 to disk17.img
    Starting positions: infile = 0 B,  outfile = 0 B
    Copy block size: 1 hard blocks
Hard block size: 512  bytes
Max_retries: 1    
Direct: no    Sparse: no    Split: yes    Truncate: no

Press Ctrl-C to interrupt
Initial status (read from logfile)
rescued:         0 B,  errsize:       0 B,  errors:       0
Current status
rescued:     1465 kB,  errsize:    8704 B,  current rate:        0 B/s
   ipos:     1380 kB,   errors:       3,    average rate:    11185 B/s
   opos:     1380 kB,     time from last successful read:      13 s
Finished
The fun with old floppies can be down to differing alignment between the drive the data was written with and the drive used for reading it.

So if we could read the data using two (or more) drives, then amalgamate the good bits, we'd end up with a complete image. This is where 'ddrescue' comes in handy. The log file indicates which bits read okay and which bits had errors.

So I then popped the floppy in the other drive in my system and ran the same command again (with /dev/fd1 changed to /dev/fd0):

Code:
 $ N="17"; ddrescue -v -r1 -c1 /dev/fd0 disk$N.img disk$N.log


About to copy 1474 kBytes from /dev/fd0 to disk17.img
    Starting positions: infile = 0 B,  outfile = 0 B
    Copy block size: 1 hard blocks
Hard block size: 512  bytes
Max_retries: 1    
Direct: no    Sparse: no    Split: yes    Truncate: no

Press Ctrl-C to interrupt
Initial status (read from logfile)
rescued:     1465 kB,  errsize:    8704 B,  errors:       3
Current status
rescued:     1474 kB,  errsize:       0 B,  current rate:      256 B/s
   ipos:    810496 B,   errors:       0,    average rate:      256 B/s
   opos:    810496 B,     time from last successful read:       0 s
Finished
Note the "Initial status (read from logfile)"; 'ddrescue' then retried only the failed sectors and, in this drive, managed to read them. Now, the .img file is complete.

A neat trick here is that if I read the floppy to .img and .log files on my server (which can be accessed from any other machine on the LAN), I could put the floppy in a different drive in a different machine and run ddrescue with the previously-retrieved incomplete image and log files.

Now I've got a disk image, I could write the image back to a good floppy. But it's possible to work with that .img file directly.

Second tool - 'mtools':

Code:
mtools(1)                                                            mtools(1)



Name
       mtools - utilities to access DOS disks in Unix.



Introduction
       Mtools is a collection of tools to allow Unix systems to manipulate MS-
       DOS files: read, write, and move around files on an MS-DOS file  system
       (typically  a floppy disk).  Where reasonable, each program attempts to
       emulate the MS-DOS equivalent command.
Apart from allowing access to MS-DOS floppies without mounting them, it'll work with images of MS-DOS floppies:

Code:
$ mdir -i disk17.img
 Volume in drive : has no label
Directory for ::/

SPICE    ZIP    828261 1991-11-23   0:08 
BRADFORD ZIP    305489 1991-11-23  14:39 
IMAGEPRT ZIP    285112 1991-11-23  14:46 
        3 files           1 418 862 bytes
                             38 400 bytes free
From the man page:
The drive letter : (colon) has a special meaning. It is used to access image files which are directly specified on the command line using the -i options.
So I can now copy the files from the image to the current directory:

Code:
$ mcopy -i disk17.img ::
$ ls -l
total 2832
-rw-r--r-- 1 kat users  305489 Jul 16 18:13 BRADFORD.ZIP
-rw-r--r-- 1 kat users 1474560 Jul 16 18:13 disk17.img
-rw-r--r-- 1 kat users  285112 Jul 16 18:13 IMAGEPRT.ZIP
-rw-r--r-- 1 kat users  828261 Jul 16 18:13 SPICE.ZIP
Simples!

(Note that the multiple-drive 'ddrescue' technique can also be used for CD-R; I've had some old ones go a bit flaky but by reading them with 'ddrescue' in different CD-ROM drives in different machines, using the same image and log files on the server, I've managed to recover complete images.)

I thought I'd share this; 'ddrescue' isn't just useful for pulling partition images off failing hard disks (though it's extremely good at that, too.)

Kat
Kat Manton is offline  
Old 16th Jul 2011, 7:35 pm   #2
dominicbeesley
Octode
 
dominicbeesley's Avatar
 
Join Date: Nov 2004
Location: Hebden Bridge, West Yorkshire, UK.
Posts: 1,885
Default Re: Rescuing old floppies

Nice one Kat,

Something I keep meaning to get round to trying doing with some disks but hadn't realised it was so simple!

Cheers

Dom
dominicbeesley is offline  
Old 16th Jul 2011, 8:44 pm   #3
Kat Manton
Retired Dormant Member
 
Kat Manton's Avatar
 
Join Date: Jul 2005
Location: West Yorkshire, UK.
Posts: 1,700
Default Re: Rescuing old floppies

It's turning out to be a fairly rapid process, fortunately.

I'm interleaving reads using two drives in the same system, one TEAC and one Sony. (I felt that having two drives from different manufacturers might help.) I have two xterms up, one for each drive; but only start one 'ddrescue' run after the one in the other xterm has finished, in case I need to retry a disk in the other drive.

Including 'N="xx"' before the command and '$N' in the two file names (along with bash command history) means there's just one thing to edit for each floppy.

Some don't contain what's written on the label, some aren't labelled; so I'm not too concerned about recovering them to meaningfully-named image files. Once there's a load of numbered image files retrieved; this gets me a listing of their contents in one text file:
Code:
$ for i in disk*.img; \
> do echo -e "\n$i\n" >> directory.txt; \
> mdir -i $i >> directory.txt; \
> done
Most are reading with just one pass and could probably have been read/copied directly. But as they're ancient, I feel it's better/safer to read them to images then work with the images; it keeps the amount of head activity on the floppies to a minimum.

Reading disks to image files with 'ddrescue' should work for any floppy with a low-level format which a PC can read; this includes some samplers and other music-production equipment as well as other computers (though notably not the Commodore Amiga's native format.)

It may not be possible to read the files/data in the disk image with the PC but it is, at least, possible to preserve a backup disk image then write it to a fresh, good floppy to be used in the original hardware.

I have some 5.25" ones to do too; that could get interesting as I know I have 40- and 80-track disks and some may be CP/M...

Kat
Kat Manton is offline  
Old 17th Jul 2011, 8:41 am   #4
Guest
Guest
 
Posts: n/a
Default Re: Rescuing old floppies

In the past with dodgy floppies, and before Linux, I have had the drive in the open and wiggling the head while it is doing the 'repeat read' worked quite often.
 
Closed Thread

Thread Tools



All times are GMT +1. The time now is 1:18 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.