On Thu, Dec 23, 2010 at 13:07, Robert W wrote:
> If I use DD to back up my USB drive to a file, should I expect the checksum
> of the image file created to be the same as the checksum produced by the
> device (for instance, /dev/sdb)?
>
> I've been getting different checksums and I wanted to know if it was because
> of an error writing the image file, or because of something else.
I discovered this with dd if=/dev/scd0 may be 2 years ago. dd produces
an output file which is a certain size (has a one or more trailing
sectors from memory). Then I burnt that image back to disc, ran dd on
the new disc and got an _additional_ sector or so over and above the
extra I already got the first time.
So I did some research and came across wodim and readom (aptitude
install wodim).
wodim/readom knows the magic to not include extra sectors. At least
AFAICT/remember.
hth
zen
PS Here's my rough n hacky cheat sheet for cd/dvd commands (sorry
about any line wrapping):
genisoimage -J -r -f -V myvolname -o image.iso -graft-points /=symlink-farm-dir
# -J, -joliet Generate Joliet directory information
# -r, -rational-rock Generate rationalized Rock Ridge
directory information
# -R, -rock Generate Rock Ridge directory
information - -r better/modern
# -o FILE, -output FILE Set output file name
# -path-list FILE File with list of pathnames to process
# -f, -follow-links Follow symbolic links
# -V ID, -volid IDSet Volume ID
# -graft-points Allow to use graft points for filenames
# -T, -translation-table Generate translation tables for systems
that don't understand long filenames
# -hide-joliet-trans-tbl Hide TRANS.TBL from Joliet tree
# -joliet-longAllow Joliet file names to be 103
Unicode characters
# -hide-rr-moved Rename RR_MOVED to .rr_moved in Rock Ridge tree
# -hide-hfs GLOBFILE Hide HFS file
# -g, -apple Add Apple ISO9660 extensions
# -h, -hfsCreate ISO9660/HFS hybrid
# -split-output Split output into files of approx. 1GB size
# -cache-inodes Cache inodes (needed to detect hard links)
# RECORD ISO IMAGE, from FILE onto BLANK DISC ::
sudo wodim -v -eject dev=/dev/scd0 image.iso
#sudo wodim -v -eject speed=4 dev=/dev/sr0 image.iso
#If the overall speed of the system is sufficient and the structure of
#the filesystem is not too complex, wodim will run without creating an
#image of the ISO 9660 filesystem. Simply run the pipeline:
# genisoimage -R /master/tree | wodim -v fs=6m speed=2 dev=2,0 -
# CREATE/ RIP ISO IMAGE data CD/DVD, from DISC to ISO FILE ::
sudo readom dev=/dev/scd0 f=free-nrg.iso
# To write a tar archive directly to a CD that will later contain a simple
# ISO9660 filesystem with the tar archive call:
tar cf - . | genisoimage -stream-media-size 333000 | wodim dev=b,t,l
-dao tsize=333000s -
# combine gen image/ write:
genisoimage -J -r -f -V myvolname -graft-points /=symlink-farm-dir
-stream-media-size 333000 | wodim dev=/dev/sr0 -dao tsize=333000s -
???check???
# Example of two alternating (actually, parallel), commands,
# to optimally read in a bunch of DVDs into a local mirror:
sudo readom dev=/dev/scd0 f=s.img && eject # (alternate with
filename 't.img' instead of 's.img')
sudo mount -o loop s.img u/ && sudo nice rsync -av u/ my-mirror/ &&
sudo umount u/ && sudo rm s.img # ditto for alternate t.img
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html