On Wed, 17 Oct 2007, Carlos E. R. wrote:-

>
>The Wednesday 2007-10-17 at 01:42 +0100, David Bolt wrote:

>> There is just one slight problem. You can't verify the burn using md5sum
>> if tar uses the default block size. You need to set tar to use a 32KiB
>> block size so it matches the default block size growisofs uses.
>
>
>Ah? Now, that's very interesting, it would explain a problem I had.
>But... why would the internal organization of the image file matters?

It doesn't. It's a matter of differing block lengths. A tar archive
writes in 10KiB blocks, whereas growisofs uses its internal dd with an
output block size of 32KiB. Since the growisofs block size isn't an
exact multiple of the tar block size, padding occurs.

>Do yo have some doc or link on this?

Not seen any mention of it in the documentation, and haven't searched to
see if I could find anything about it, just observed it. Here's a quick
example[0]:

[EMAIL PROTECTED]:/usr/src/packages/SOURCES> ls -l
total 173652
-rw------- 1 davjam users 67072000 2007-10-17 02:22 home.tar
-rw-r--r-- 1 davjam users 55280688 2007-10-17 02:51 home.tar.bz2
-rw-r--r-- 1 davjam users 55269298 2007-10-17 02:52 home.tar.gz
[EMAIL PROTECTED]:/usr/src/packages/SOURCES> for FILE in home.tar*
> do growisofs -Z /dev/hdc="${FILE}" -dvd-compat -speed 4 && dd if=/dev/dvd 
> of="dvd.${FILE}"
> eject /dev/hdc
> read DUMMY
> done
Executing 'builtin_dd if=home.tar of=/dev/hdc obs=32k seek=0'
/dev/hdc: "Current Write Speed" is 4.1x1352KBps.
    1572864/67072000 ( 2.3%) @0.0x, remaining 2:46 RBU 100.0% UBU   2.1%
    1572864/67072000 ( 2.3%) @0.0x, remaining 5:33 RBU 100.0% UBU 100.0%
    1572864/67072000 ( 2.3%) @0.0x, remaining 7:38 RBU 100.0% UBU 100.0%
    6324224/67072000 ( 9.4%) @1.0x, remaining 2:14 RBU 100.0% UBU 100.0%
   17465344/67072000 (26.0%) @2.4x, remaining 0:51 RBU  99.9% UBU 100.0%
   28573696/67072000 (42.6%) @2.4x, remaining 0:28 RBU 100.0% UBU 100.0%
   39682048/67072000 (59.2%) @2.4x, remaining 0:16 RBU  81.6% UBU 100.0%
   50823168/67072000 (75.8%) @2.4x, remaining 0:08 RBU  48.4% UBU 100.0%
   61931520/67072000 (92.3%) @2.4x, remaining 0:02 RBU  15.3% UBU 100.0%
builtin_dd: 32752*2KB out @ average 1.5x1352KBps
/dev/hdc: flushing cache
/dev/hdc: closing track
/dev/hdc: closing disc
131008+0 records in
131008+0 records out
67076096 bytes (67 MB) copied, 33.386 s, 2.0 MB/s

Executing 'builtin_dd if=home.tar.bz2 of=/dev/hdc obs=32k seek=0'
/dev/hdc: "Current Write Speed" is 4.1x1352KBps.
    1572864/55280688 ( 2.8%) @0.0x, remaining 2:16 RBU 100.0% UBU   2.1%
    1572864/55280688 ( 2.8%) @0.0x, remaining 3:59 RBU 100.0% UBU 100.0%
    1572864/55280688 ( 2.8%) @0.0x, remaining 5:41 RBU 100.0% UBU 100.0%
    6455296/55280688 (11.7%) @1.1x, remaining 1:45 RBU 100.0% UBU 100.0%
   17596416/55280688 (31.8%) @2.4x, remaining 0:36 RBU 100.0% UBU 100.0%
   28704768/55280688 (51.9%) @2.4x, remaining 0:18 RBU  79.3% UBU 100.0%
   39845888/55280688 (72.1%) @2.4x, remaining 0:09 RBU  46.1% UBU 100.0%
   50954240/55280688 (92.2%) @2.4x, remaining 0:02 RBU  13.0% UBU 100.0%
builtin_dd: 27008*2KB out @ average 1.4x1352KBps
/dev/hdc: flushing cache
/dev/hdc: closing track
/dev/hdc: closing disc
108032+0 records in
108032+0 records out
55312384 bytes (55 MB) copied, 28.3513 s, 2.0 MB/s

Executing 'builtin_dd if=home.tar.gz of=/dev/hdc obs=32k seek=0'
/dev/hdc: "Current Write Speed" is 4.1x1352KBps.
    1572864/55269298 ( 2.8%) @0.0x, remaining 3:24 RBU 100.0% UBU   2.1%
    1572864/55269298 ( 2.8%) @0.0x, remaining 5:07 RBU 100.0% UBU 100.0%
    3112960/55269298 ( 5.6%) @0.3x, remaining 3:21 RBU 100.0% UBU 100.0%
    9928704/55269298 (18.0%) @1.5x, remaining 1:13 RBU 100.0% UBU 100.0%
   21069824/55269298 (38.1%) @2.4x, remaining 0:30 RBU 100.0% UBU 100.0%
   32178176/55269298 (58.2%) @2.4x, remaining 0:15 RBU 100.0% UBU 100.0%
   43319296/55269298 (78.4%) @2.4x, remaining 0:07 RBU  71.3% UBU 100.0%
   54427648/55269298 (98.5%) @2.4x, remaining 0:00 RBU   5.1% UBU 100.0%
builtin_dd: 26992*2KB out @ average 1.4x1352KBps
/dev/hdc: flushing cache
/dev/hdc: closing track
/dev/hdc: closing disc
107968+0 records in
107968+0 records out
55279616 bytes (55 MB) copied, 36.1937 s, 1.5 MB/s

[EMAIL PROTECTED]:/usr/src/packages/SOURCES> ls -l
total 347344
-rw-r--r-- 1 davjam users 67076096 2007-10-17 03:30 dvd.home.tar
-rw-r--r-- 1 davjam users 55312384 2007-10-17 03:32 dvd.home.tar.bz2
-rw-r--r-- 1 davjam users 55279616 2007-10-17 03:37 dvd.home.tar.gz
-rw------- 1 davjam users 67072000 2007-10-17 02:22 home.tar
-rw-r--r-- 1 davjam users 55280688 2007-10-17 02:51 home.tar.bz2
-rw-r--r-- 1 davjam users 55269298 2007-10-17 02:52 home.tar.gz
[EMAIL PROTECTED]:/usr/src/packages/SOURCES> for FILE in dvd.*
> do
> read -p "Insert disc equivalent of ${FILE}" DUMMY
> case "${FILE:14}" in
> bz2)
> echo "disc equivalent of ${FILE}"
> tar xjf /dev/hdc
> ;;
> gz)
> echo "disc equivalent of ${FILE}"
> tar xzf /dev/hdc
> ;;
> *)
> echo "disc equivalent of ${FILE}"
> tar xf /dev/hdc
> ;;
> esac
> eject /dev/hdc
> done
Insert disc equivalent of dvd.home.tar
disc equivalent of dvd.home.tar
Insert disc equivalent of dvd.home.tar.bz2
disc equivalent of dvd.home.tar.bz2

bzip2: (stdin): trailing garbage after EOF ignored
Insert disc equivalent of dvd.home.tar.gz
disc equivalent of dvd.home.tar.gz
[EMAIL PROTECTED]:/usr/src/packages/SOURCES> ls -l
total 347348
-rw-r--r-- 1 davjam users 67076096 2007-10-17 03:30 dvd.home.tar
-rw-r--r-- 1 davjam users 55312384 2007-10-17 03:32 dvd.home.tar.bz2
-rw-r--r-- 1 davjam users 55279616 2007-10-17 03:37 dvd.home.tar.gz
drwxr-xr-x 3 davjam users     4096 2007-10-10 00:13 home
-rw------- 1 davjam users 67072000 2007-10-17 02:22 home.tar
-rw-r--r-- 1 davjam users 55280688 2007-10-17 02:51 home.tar.bz2
-rw-r--r-- 1 davjam users 55269298 2007-10-17 02:52 home.tar.gz

>It would mean that md5sum wouldn't read back the same bits that were
>supposedly written, there is some thing else... padding?

That's what it seems to be. A quick check shows that you can get around
it by using either of these tar options:

--blocking-factor=64
--record-size=32768

A quick test shows they both produce tar archives where the length is
exactly divisible by the growisofs block length:

[EMAIL PROTECTED]:/usr/src/packages/SOURCES> tar cf home.2.tar 
--record-size=32768 home
[EMAIL PROTECTED]:/usr/src/packages/SOURCES> tar cf home.3.tar 
--blocking-factor=64 home
[EMAIL PROTECTED]:/usr/src/packages/SOURCES> ls -l
total 478492
-rw-r--r-- 1 davjam users 67076096 2007-10-17 03:30 dvd.home.tar
-rw-r--r-- 1 davjam users 55312384 2007-10-17 03:32 dvd.home.tar.bz2
-rw-r--r-- 1 davjam users 55279616 2007-10-17 03:37 dvd.home.tar.gz
drwxr-xr-x 3 davjam users     4096 2007-10-10 00:13 home
-rw-r--r-- 1 davjam users 67076096 2007-10-17 04:01 home.2.tar
-rw-r--r-- 1 davjam users 67076096 2007-10-17 04:02 home.3.tar
-rw------- 1 davjam users 67072000 2007-10-17 02:22 home.tar
-rw-r--r-- 1 davjam users 55280688 2007-10-17 02:51 home.tar.bz2
-rw-r--r-- 1 davjam users 55269298 2007-10-17 02:52 home.tar.gz
[EMAIL PROTECTED]:/usr/src/packages/SOURCES> growisofs -Z /dev/hdc="home.2.tar" 
-dvd-compat -speed 4 && dd if=/dev/dvd of="dvd.home.2.tar"
Executing 'builtin_dd if=home.2.tar of=/dev/hdc obs=32k seek=0'
/dev/hdc: "Current Write Speed" is 4.1x1352KBps.
    1572864/67076096 ( 2.3%) @0.0x, remaining 4:09 RBU 100.0% UBU   2.1%
    1572864/67076096 ( 2.3%) @0.0x, remaining 6:56 RBU 100.0% UBU 100.0%
    3440640/67076096 ( 5.1%) @0.4x, remaining 4:00 RBU 100.0% UBU  95.8%
    9207808/67076096 (13.7%) @1.2x, remaining 1:40 RBU 100.0% UBU  27.1%
   16220160/67076096 (24.2%) @1.5x, remaining 1:02 RBU 100.0% UBU  14.6%
   23232512/67076096 (34.6%) @1.5x, remaining 0:43 RBU 100.0% UBU   6.2%
   30212096/67076096 (45.0%) @1.5x, remaining 0:32 RBU 100.0% UBU  10.4%
   37224448/67076096 (55.5%) @1.5x, remaining 0:24 RBU 100.0% UBU  18.8%
   44236800/67076096 (66.0%) @1.5x, remaining 0:17 RBU 100.0% UBU  22.9%
   51249152/67076096 (76.4%) @1.5x, remaining 0:11 RBU 100.0% UBU   6.2%
   58261504/67076096 (86.9%) @1.5x, remaining 0:06 RBU 100.0% UBU   8.3%
   65273856/67076096 (97.3%) @1.5x, remaining 0:01 RBU 100.0% UBU  16.7%
builtin_dd: 32752*2KB out @ average 1.1x1352KBps
/dev/hdc: flushing cache
/dev/hdc: closing track
/dev/hdc: closing disc
131008+0 records in
131008+0 records out
67076096 bytes (67 MB) copied, 50.1566 s, 1.3 MB/s
[EMAIL PROTECTED]:/usr/src/packages/SOURCES> md5sum home.2.tar dvd.home.2.tar 
/dev/hdc
377f9a42287c631d7367f7ee53e681df  home.2.tar
377f9a42287c631d7367f7ee53e681df  dvd.home.2.tar
377f9a42287c631d7367f7ee53e681df  /dev/hdc

And, as you can see above, using either of those two options results in
all three test subjects being binary identical.

>> Or even just use tar to do it:
>>
>> tar xf /dev/dvd
>> tar xzf /dev/dvd
>> tar xjf /dev/dvd
>>
>> expand a plain tar, gzipped or bzip2'd tar straight from then DVD.
>
>Right.

Forgot to mention, the "tar xjf /dev/dvd" pops up a warning about
ignoring extra data after the EOF marker whereas the other two don't.


>I'll save this for future reference. When I wanted to know the exact
>size of a dvd I found the 4.7 GB figure.

I always use a figure of 4.2GiB. Gives me a little leeway, just in case.


[0] Had to use DVD+R for this. Trying it with a +RW resulted in the
entire contents of the disc being read, all 4.3GiB of it :|

Regards,
        David Bolt

-- 
Team Acorn: http://www.distributed.net/ OGR-P2 @ 100Mnodes RC5-72 @ 15Mkeys
SUSE 10.0 32bit  | SUSE 10.1 32bit  | openSUSE 10.2 32bit | openSUSE 10.3 32bit
SUSE 10.0 64bit  | SUSE 10.1 64bit  | openSUSE 10.2 64bit |
RISC OS 3.11     | RISC OS 3.6      | TOS 4.02            | openSUSE 10.3 PPC
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to