Dd-mount-tar

From wikipost
Revision as of 12:00, 23 December 2013 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
  • Extract from a .tar.gzipped dd file straight to another device
 When creating a dd image of a whole disk it can be worthwhile compressing it using .tar.gz
 The resulting file can still be extracted and dd'ed to a new disk all in one go:
 # tar xz0f disk-image_dd.tar.gz | dd of=/dev/sda bs=1M


  • To watch the progress of an ongoing dd command, send it the -USR1 kill signal:
 - find the pid of the dd command
 - send the kill command: 
      # kill -USR1 <pid>
  This will not kill the running dd process, it's just a method of communicating signals to the dd program.


  • mount a partition inside a whole-disk dd image
 - install parted if you haven't done so already
 - run parted on the dd file
 - switch to bytes  'unit B'
 - print the partition table 'print'
 - take note of the Start value of the partition you wish to mount (drop the 'B' at the end of the number!)
 - quit parted 'quit'
 - mount the partition using the offset argument
    
      # mount whole-disk.dd -o loop,offset=<startposition> /mnt/partition


  • mount a partition inside a tar.gzipped whole-disk dd image
 - use the above technique to obtain the offset for the partition you wish to mount
 - install kpartx if you haven't done so already
 (http://unix.stackexchange.com/questions/31669/is-it-possible-to-mount-a-gzip-compressed-dd-image-on-the-fly)