[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: copying disks with dd and cat



Geoff Crompton wrote:
> 
>   I've just been copying a floppy disk onto my hard drive to back it up.
>   I initially used
> % dd if=/dev/fd0 of=disk_image

Seems reasonable.

>   However it barfed with an IO error, and dmesg shows:
> [...]
>   So then for some reason I tried cating the file:
> % cat /dev/fd0 > disk_image.cat
>   This didn't produce any information about errors.

Floppies are not the most reliable media.  It looks like reading the
device with 'cat' worked.  It is possible that reading it again with
'dd' would work.  Or the the same cat would fail a second time.  In
any case I would be suspicious of the floppy and be glad you have your
data safe.

>   Can anyone explain how hexdump produces an almost identical listing
>   for a file that differs in size by 491520 bytes?

Look at the addresses surrounding the lines with a '*'.  The '*'
indicates that lines have been omitted.  Those lines all have
identical data and so are suppressed.  That is where your differences
exist which consumed the difference in file size.  Try your dump
command again but using the -v, --output-duplicates option specified.

The info page for od is a little sparse.  Therefore I recommend using
the online standards documentation.

  http://www.unix-systems.org/single_unix_specification_v2/xcu/od.html

  -v
    Write all input data. Without the -v option, any number of groups of
    output lines, which would be identical to the immediately preceding
    group of output lines (except for the byte offsets), will be replaced
    with a line containing only an asterisk (*).

Bob

Attachment: pgppuu2Wfn88Z.pgp
Description: PGP signature


Reply to: