Re: Extracting directories from an ISO image, command line tool?
Hi,
Richard Owlett wrote:
> richard@jessie:~$ ls -l /media/richard/Lexar/dvd8_2.iso
> -rw-r--r-- 1 richard richard 3976200192 Sep 9 07:36 /media/richard/Lexar/dvd8_2.iso
>
> richard@jessie:~$ /sbin/isosize /media/richard/Lexar/dvd8_2.iso
> 4677738496
You will need to get a new dvd8_2.iso of at least 4677738496
bytes size.
> I've got some links "somewhere" for copying DVDs to files such that
> checksums can be verified. Suspect that info may useful.
Depending on the DVD medium type you have to expect trailing
garbage after the end of the ISO. This has to be taken into
respect when copying, diffing, or md5summing.
I would use for copying from DVD to disk:
blocks=$(expr $(/sbin/isosize /dev/sr0) / 2048)
echo "Byte count: $(expr $blocks '*' 2048)"
dd if=/dev/sr0 bs=2048 count=$blocks of=dvd8_2.iso
(It would be nice if Debian's MD5SUMS would not only tell
MD5 and image name but also the image size, or if there
was a SIZES file.)
Error messages from dd or dvd8_2.iso turning out smaller than
the announced byte count indicate failure of copying.
If the size is ok, compute the MD5 of dvd8_2.iso
md5sum dvd8_2.iso
If you have no checksum for the image, then eject and reload
the medium and run
dd if=/dev/sr0 bs=2048 count=$blocks | diff - dvd8_2.iso
in order to detect instabilities with repeated copying.
If so, then diff should report
Binary files - and dvd8_2.iso differ
--------------------------------------------------------------
If everything stays suspiciously silent, make a damage test.
Before damaging the ISO, get the original state
dd if=dvd8_2.iso bs=1 skip=30000 count=1 2>/dev/null | od -t x1
I get told
0000000 00
0000001
So byte 30000 has value 0. I replace it by a NewLine character
(value 10):
echo | dd conv=notrunc of=dvd8_2.iso bs=1 seek=30000 count=1
Now the above tests must report mismatch.
Repair ISO:
dd if=/dev/zero conv=notrunc of=dvd8_2.iso bs=1 seek=30000 count=1
If the original value was not 0, but hex "43":
echo -n $'\0x43' | dd conv=notrunc of=dvd8_2.iso bs=1 seek=30000 count=1
Have a nice day :)
Thomas
Reply to: