|
Post by ZF on Oct 14, 2010 23:05:19 GMT -5
ddrescue -b 2048 -d -e 20 -r 300 -v /dev/hdc /home/sam/dvd.iso log.txt
If /home/sam/dvd.iso won't mount, carved it: foremost -t all -k 256 -v -b 2048 -i ~/dvd.iso -o ~/dvd/
OR
Use dd dd if=<file> of=<dest file> conv=noerror,sync
noerror,sync will continue thru read erros and pad the output to match the input block size
|
|
|
Post by ZF on Oct 14, 2010 23:07:44 GMT -5
Image a CD or DVD
Note that /dev/cdrom, /dev/dvd, /dev/cdrw, and /dev/scd0 are usually just sym links to /dev/sr0 or some other optical disc device.
The following shows the naive, bad way to a CD-ROM or DVD to an iso file. This works, but it will usually grab a few extra null blocks which may throw off the checksum of the disc image. If you burn this image onto a new disc the checksum of that disc will not match the checksum of the image file. This also makes it impossible to compare this disc image with another to see if they are the same.
dd if=/dev/cdrom of=disc.iso
The following will create a correct image a CD-ROM or DVD. This ensures that the image will have exactly the same md5sum or checksum no matter what device or operating system is used to burn the image.
This is a two-step process. isoinfo -d -i /dev/cdrom
# Take the values of '''Logical Block Size''' and '''Volume Space Size''' and plug into '''bs''' and '''count''' below:
dd if=/dev/cdrom bs=2048 count=326239 conv=notrunc,noerror > disc.iso
You can do this in one line: dd if=/dev/dvd bs=2048 count=`isosize -d 2048 /dev/dvd` conv=notrunc,noerror > disc.iso
You can turn this into an alias. This alias, `cdgen`, generates an ISO image from a directory tree and dumps it to stdout. The alias, `cddump`, dumps an ISO image to stdout. The alias, `cdburn`, reads an ISO image from stdin and burns it to a disc. These assume the primary device, /dev/dvd, is the one you want (it works for CD as well as DVD). alias cdgen='genisoimage -quiet -iso-level 3 -J -force-rr -l -N -d -allow-leading-dots -allow-multidot -V "`date --rfc-3339=seconds`" -r ' alias cddump='dd if=/dev/dvd bs=2048 count=`isosize -d 2048 /dev/dvd` conv=notrunc,noerror' alias cdburn='cdrecord fs=16m speed=8 padsize=63s -pad -dao -v -' Here are some examples of how these can be used: cddump | md5sum cddump > disc.iso cat disc.iso | cdburn
Steve Litt's `rawread` script does this automatically with the added advantage this it gets the Logical Block Size as reported by the drive instead of assuming that it is 2048; although, all ISO formatted CDs and DVDs use 2048 for the Logical Block Size, so I usually just use the aliases above. #!/bin/sh device=$1
blocksize=`isoinfo -d -i $device | grep "^Logical block size is:" | cut -d " " -f 5` if test "$blocksize" = ""; then echo catdevice FATAL ERROR: Blank blocksize >&2 exit fi
blockcount=`isoinfo -d -i $device | grep "^Volume size is:" | cut -d " " -f 4` if test "$blockcount" = ""; then echo catdevice FATAL ERROR: Blank blockcount >&2 exit fi
command="dd if=$device bs=$blocksize count=$blockcount conv=notrunc,noerror" echo "$command" >&2 $command
Steve Litt's `rawread` script can be used to do things like the following. Create an ISO disc dump: rawread /dev/cdrom > disc.iso check the md5sum of the physical optical disk: rawread /dev/cdrom | md5sum
|
|
|
Post by ZF on Oct 14, 2010 23:12:06 GMT -5
|
|