|
Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment. |
|
Thread Tools |
16th Jul 2011, 6:51 pm | #1 |
Retired Dormant Member
Join Date: Jul 2005
Location: West Yorkshire, UK.
Posts: 1,700
|
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. 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 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 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. 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 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 (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 |
16th Jul 2011, 7:35 pm | #2 |
Octode
Join Date: Nov 2004
Location: Hebden Bridge, West Yorkshire, UK.
Posts: 1,885
|
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 |
16th Jul 2011, 8:44 pm | #3 |
Retired Dormant Member
Join Date: Jul 2005
Location: West Yorkshire, UK.
Posts: 1,700
|
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 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 |
17th Jul 2011, 8:41 am | #4 |
Guest
Posts: n/a
|
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.
|