Image Map Image Map
Results 1 to 6 of 6

Thread: Question about AT&T Unix "dd" command

  1. #1

    Default Question about AT&T Unix "dd" command

    On old versions of SYSV Unix, you could use the dd command to take a dump or image of an entire drive. You would do something like dd if=/dev/sda of=/mnt/dumps/dump_sda.img to create a dump (probably in single user mode). Question: When doing this, is it preserving the way the drive is formatted, or is it just preserving data? I know it's doing a sector-by-sector dump without regard to used space (files), but is it preserving the formatting as well? My reason for asking is, it would be nice to be able to restore that dump, if need be, onto a drive with different characteristics. The current drive I'd like to back up has 256 byte sectors, and any replacement I put in there would probably be 512. These are MFM drives, btw. If you want to read the gory details in my other thread, it's here.

  2. #2
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    28,500
    Blog Entries
    20

    Default

    What, specifically, do you mean by "formatting"? Are you referring to the content of the sector address headers and perhaps the interleave? The answer there is "no"--all of that is concealed by the driver. dd has always operated under the model of consecutively-numbered blocks.

  3. #3

    Default

    Quote Originally Posted by Chuck(G) View Post
    What, specifically, do you mean by "formatting"? Are you referring to the content of the sector address headers and perhaps the interleave? The answer there is "no"--all of that is concealed by the driver. dd has always operated under the model of consecutively-numbered blocks.
    Aha! So, if dd is dealing with Unix blocks, and all the low-level stuff is handled by the drive controller, then all is good. Next question, is there a way to use dd to list the content of such a drive image?

  4. #4
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    28,500
    Blog Entries
    20

    Default

    I don't know when the "loop" device came into common Unix usage, but it's certainly possible under Linux and BSD.

    https://en.wikipedia.org/wiki/Loop_device

  5. #5

    Default

    DD is copying bytes from the sectors. It knows nothing of formatting details.

    The answer is always "it depends", but filesystems generally use block numbers, not disk geometry for addressing data. Even DOS uses block numbers within a partition. So this makes it fairly simple to "snapshot" a partition with data in it and move it around. If the data happens to be a filesystem it works great because the block numbers are relative to the start of the partition.

  6. #6

    Default

    Quote Originally Posted by Chuck(G) View Post
    I don't know when the "loop" device came into common Unix usage, but it's certainly possible under Linux and BSD.

    https://en.wikipedia.org/wiki/Loop_device
    I can try that on a later Linux system. I think SYS5 R2 is way too old to have such niceties, but I'll check.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •