Tech Support > Operating Systems > Linux / Variants > reading a corrupt floppy
reading a corrupt floppy
Posted by andy richardson on February 3rd, 2004


I work in a school and kids always come to me with floppies that the
school computers no longer read.

Usually I can do something useful with my linux box but the floppy I
have at the moment is BAD.

I have had to resort to my Acorn riscPC which has a great little utility
wherby it reads a sector at a time and allows me to spot text and copy
the ascii to a text file - hey presto, text is recovered without ever
mounting the disk or being able to read the file/directory tables.

Unfortunately with 2880 sectors to look thru, it gets a little time
consuming.


Is there a similar/ cleverer linux utility?

I have tried reading from /dev/fd0 without mounting (it won't mount
anyway), but I cannot get it to read past 8192 bytes.

is there something in bash/perl/php to allow me to move the filepointer
a byte at a time and write the character to a text file?



--
Andy Richardson
99% of Linux users moved away from Windows
99% of Windows users don't know there's a choice

Posted by andy richardson on February 3rd, 2004


P.S.
I have tried searching but attempt to look up floppy rescue corrupt and
so on just gives me lots of rescue-floppy utilities NOT utilities to
rescue floppies:-(


--
Andy Richardson
99% of Linux users moved away from Windows
99% of Windows users don't know there's a choice

Posted by Michael Heiming on February 3rd, 2004


andy richardson <andy@mrbumpy.co.uk> wrote:

[ Rescue broken floppy ]

How did you try?

The common thing to try is using 'dd' to read from the device,
try in addition to the obvious 'man dd', 'info dd' it contains
some examples how to use dd, However be sure not to mix "if" and
"of".

Good luck

--
Michael Heiming

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM

Posted by Dances With Crows on February 3rd, 2004


On Wed, 4 Feb 2004 00:58:01 +0100, Michael Heiming staggered into the
Black Sun and said:
Then when you've found it doesn't work well for broken devices, Google
for dd_rescue and use that instead. Like so:

dd_rescue if=/dev/fd0 of=somefile.raw
dosfsck somefile.raw
(answer Y to everything unless you know a bit about FAT...)
mount -t vfat somefile.raw /mnt/somewhere -o loop
(copy salvageable data somewhere safe)

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / Hire me!
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume

Posted by Michael Heiming on February 3rd, 2004


Dances With Crows <danSPANceswitTRAPhcrows@usa.net> wrote:
Ah, well only used dd for something like this once/twice and it
did work. However 'dd_rescue' sounds like another good hint for
the OP.

--
Michael Heiming

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of SPAM

Posted by Jim Richardson on February 4th, 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 03 Feb 2004 20:22:55 +0000,
andy richardson <andy@mrbumpy.co.uk> wrote:

dd if=/dev/fd0 of=floppy.img

might help to set the block size and count, but not sure what they'd be.
Probably 512 and 2880, but that's just a guess.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAIE9Bd90bcYOAWPYRAnKLAKDmC6FUMDoGiDz3RQ7Ry4 Vf/4EcpQCgytTC
XUdw6/JZbncdpymMMoW+f6M=
=3dkw
-----END PGP SIGNATURE-----

--
Jim Richardson http://www.eskimo.com/~warlock
If you can tell the difference between good advice and bad advice,
you don't need advice.

Posted by David Douthitt on February 4th, 2004


On Tue, 03 Feb 2004 20:22:55 +0000, andy richardson
<andy@mrbumpy.co.uk> wrote:

What I did a few times was something like this:

for i in $(seq 1 2880) ; do
dd if=/dev/fd0 bs=512 skip=$i count=1 || dd if=/dev/zero bs=512
count=1
done > floppy.dat

Be sure to check this out before running - but you get the idea.

If you want to pull the text out of it, use strings:

strings floppy.dat

David Douthitt (david@douthitt.net)
UNIX System Administrator
HP-UX, Unixware, Linux
Linux+, LPIC-1

Posted by David Douthitt on February 4th, 2004


On Tue, 03 Feb 2004 20:22:55 +0000, andy richardson
<andy@mrbumpy.co.uk> wrote:

Someone mentioned dd_rescue. dd_rescue is at:

http://www.garloff.de/kurt/linux/ddrescue/

David Douthitt (david@douthitt.net)
UNIX System Administrator
HP-UX, Unixware, Linux
Linux+, LPIC-1

Posted by andy richardson on February 4th, 2004


thanks folks, I now have a copy of dd_rescue which should speed up
things somewhat

cheers again

andy


--
Andy Richardson
99% of Linux users moved away from Windows
99% of Windows users don't know there's a choice

Posted by Vilmos Soti on February 9th, 2004


Michael Heiming <michael+USENET@www.heiming.de> writes:

Try something along this lines in an empty directory:

for x in `seq 0 2880`; do
echo $x
dd if=/dev/fd0 of=$x bs=512 count=1 skip=$x > /dev/null 2>&1
done

This will individually try to read each sector and save it in a
file named by the offset from the beginning. Then you can play
with it.

Vilmos


Similar Posts