Hamilton LaboratoriesHamilton C shell 2012User guideExternal utilities

dskread

Oregon Coast

dskread
Previous | Next

        Read Raw Sectors from a Disk

Usage:  dskread [-bcdEhHLS-] [-n name] [-N sectors]
                 [-s size] [-t tracks]
                 [ disk: ] [ <sectorlist> ]

   dskread copies low-level raw sectors on the disk you specify
   to stdout.

   In conjunction with dskwrite, dskread is most useful as a quick
   diskette duplication utility:  you can read a whole diskette
   image into a file with dskread, then write it back out with
   dskwrite to a new diskette.  But it's also useful for restoring
   a long stream of data dumped across a series of diskettes with
   dskwrite.

   The disk is given as a a single alphabetic drive letter plus a
   colon.  If no disk is specified, the first logical drive is
   assumed (in most machines, this is the a: drive).

Operation:

   dskread normally starts at cylinder 0, head 0, sector 0 and
   walks through the whole disk, reading all the sectors on a track
   under one head and then all tracks in a cylinder before
   repositioning the heads to the next cylinder.

   dskread always reads whole sectors except when reading from a
   file using the -d option.

Options:

   -b            Boot record.  Skip sector 0 on the assumption it
                 simply contains a standard boot record and
                 parameter block corresponding to the particular
                 media.
   -c            Continuation.  Assume the data has been split
                 across several diskettes.  After each disk
                 has been read, prompt for the next one.  If
                 -d is specified also, the filename extension on
                 each disk will be the disk number, i.e., 001,
                 002, 003, etc.
   -d            Dummy filesystem.  Assume the data is in a single
                 file on the disk.  If neither the -d nor the -b
                 options is given, the disk will be read beginning
                 with sector 0.
   -h            Help.  (This screen.)
   -n <name>     The filename to look for if the -d (dummy file-
                 system) option is used.  Default is 'bindata'.
   -S            Share the drive for read/write access by other
                 processes.
   --            End of options.


Formatting:

   Default is to let Windows NT try to determine the formatting
   that was used.  If the disk was written in an unusual format
   or has non-standard data in sector 0, the following options
   can be used to override OS/2's attempt to guess the format:

   -E            Extended density (2.88M) format.
   -H            High density format.
   -L            Low density format.
   -N <sectors>  Sectors per track.
   -s <size>     Sector size.  Normally only 512 is supported but,
                 depending on your hardware, you may also be able
                 to create 128, 256 or 1024-byte sectors.
   -t <tracks>   Number of tracks.

Sector lists:

   Optionally, you can specify a list of sectors you want read.
   Sectors are given in

                 (cylinder, head, sector)

   coordinates with parentheses around and commas or white space
   to separate the numeric values you write.  Cylinders, heads and
   sectors are counted from zero and can be specified in decimal,
   hex or octal.

   A single sector specified alone means just that sector.
   Listing several separated by commas or spaces means each one
   individually.

   A pair of sectors joined by a hyphen means a range:  all the
   consecutive sectors beginning with the first and running
   through to the second.

   Specifying a negative number as an ordinate means use the
   highest possible value for that disk.

   If any of the ordinates of a sector are omitted, they're assumed
   to be zero except when it closes a range, in which case it means
   use the highest possible value.

Examples:

  1.  To duplicate a whole diskette image, autoformatting the
      output media if it's not already formatted:

          dskread a: > dskimage.a
          dskwrite -av a: < dskimage.a

  2.  To use a diskette as a serial archive media:

      The -d option allows you to request just enough dummy file
      system "envelope" around the otherwise arbitrary data you
      intend to write to ensure the disk can still be used with
      other Windows NT utilities.  Here's an example writing the
      result of a tar'ing (archiving) a whole directory to a series
      of diskettes, again autoformatting:

          tar -cs mydir | dskwrite -avcd -n mydir a:

      It's restored with

          dskread -dc -n mydir a: | tar -xs

      The diskettes used do not all have to be the same density;
      any mix of high and low is okay.  But remember that if a disk
      isn't already formatted, there's no way for dskwrite to tell
      whether it should be high or low density; any disks it has
      to format will all be formatted the same way.

  3.  Reading or writing tar-format floppies:

      Many UNIX machines support the use of a floppy as a tar
      archive media, just as if it were a tape.  Every sector
      contains data; there's no filesystem and no boot record
      at all.  This allows the greatest possible amount of data
      to be written to the disk and it does allow interchange
      with a UNIX machine, but tar-format floppies are not
      readable by any ordinary utilities.
      
      Here's an example, tar'ing mydir to a single tar-format
      floppy:

          tar -cs mydir | dskwrite -vx a:

      It's restored with

          dskread a: | tar -xs

      If the amount of data you're archiving is more than will
      fit on one diskette, use the -c option with dskread and
      dskwrite.  But since there's no labeling recorded on
      the diskettes and the data just runs continuously from
      one diskette to the next, you will need to pay attention
      to the order in which they're written or read.

Previous | Next