Bacula-users

Re: [Bacula-users] DVD Media in Raw mode

2008-11-20 20:52:03
Subject: Re: [Bacula-users] DVD Media in Raw mode
From: Evaldo Gardenali <evaldo AT gardenali DOT biz>
To: bacula-users AT lists.sourceforge DOT net
Date: Thu, 20 Nov 2008 21:47:00 -0200
Hi!

Arno Lehmann wrote:
>> Test to demonstrate the random WRITE access of the media (expected on 
>> DVD+RW and DVD-RAM, unexpected otherwise)
>> goldstein# dd if=/dev/urandom bs=1k count=1 of=/dev/cd0d seek=100000
>> 1+0 records in
>> 1+0 records out
>> 1024 bytes transferred in 3.046 secs (336 bytes/sec)
>> goldstein# dd if=/dev/cd0d bs=1k skip=100000 count=1 | hexdump -C
>> 00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  
>> |................|
>> *
>> 00000400
>> 1+0 records in
>> 1+0 records out
>> 1024 bytes transferred in 0.001 secs (1024000 bytes/sec)
>>     
>
> This one demonstrates that either your /dev/urandom is broken, or it's 
> not that simple writing raw data to and reading it from a DVD.
>
> Arno
>   

Let me redo it, I pasted the wrong line by accident.

Create a file I can count as reference for comparisons
goldstein# dd if=/dev/urandom of=1mrandom bs=1k count=1024
1024+0 records in
1024+0 records out
1048576 bytes transferred in 0.624 secs (1680410 bytes/sec)

Write it to the DVD+RW,  seek=100MB
goldstein# dd if=1mrandom of=/dev/cd0d bs=1m seek=100
1+0 records in
1+0 records out
1048576 bytes transferred in 0.517 secs (2028193 bytes/sec)

Read from the DVD+RW, skip=100MB (same chunk) into "1mrandom2" for 
comparison
goldstein# dd if=/dev/cd0d bs=1m skip=100 count=1 of=1mrandom2
1+0 records in
1+0 records out
1048576 bytes transferred in 0.732 secs (1432480 bytes/sec)

Read from the DVD+RW, skip=99MB (chunk just before the one I wrote) into 
"1mrandom3" for comparison
goldstein# dd if=/dev/cd0d bs=1m skip=99 count=1 of=1mrandom3
1+0 records in
1+0 records out
1048576 bytes transferred in 1.476 secs (710417 bytes/sec)

1mrandom1 should match 1mrandom2, but not 1mrandom3:
goldstein# diff ./1mrandom ./1mrandom2
goldstein# diff ./1mrandom ./1mrandom3
Binary files ./1mrandom and ./1mrandom3 differ

My /dev/urandom is not much borked, as you can see here: :)
goldstein# hexdump -C ./1mrandom | head -1
00000000  78 90 aa dc 4f 33 c1 22  26 71 5e f8 f9 dc fc 25  
|x...O3."&q^....%|
goldstein# hexdump -C ./1mrandom | tail -2
000ffff0  0f 2a a2 3e ad 6b 4a e4  ee 33 44 2a 8d b1 85 e4  
|.*.>.kJ..3D*....|
00100000
goldstein#

goldstein# ent 1mrandom
Entropy = 7.999786 bits per byte.  <<--- OK

Optimum compression would reduce the size
of this 1048576 byte file by 0 percent. <<--- OK

Chi square distribution for 1048576 samples is 311.30, and randomly
would exceed this value 0.92 percent of the times.   <<--- OK, not 
_THAT_ good in this sample

Arithmetic mean value of data bytes is 127.5141 (127.5 = random). <<--- OK
Monte Carlo value for Pi is 3.140522539 (error 0.03 percent). <<--- OK
Serial correlation coefficient is -0.000546 (totally uncorrelated = 
0.0). <<--- OK

I was not able to go to the store shop for blank media today, but will 
do soon. My guess is that you get "random" values, as some DVD+RW media 
come "preformatted", and DVD+RW features "background formatting", as I 
quote from the DVD+RW alliance at http://www.dvdrw.com/why/faq.htm

    *Can I use a DVD+RW disc to directly store my data files, or do I
    always need to use a burning program?*
    DVD+RW is the only rewritable DVD format that supports the Mt.
    Rainier or EasyWrite system. With an EasyWrite enabled DVD+RW drive
    and by using the forthcoming version of Microsoft Windows, Longhorn,
    you can directly store your data on a DVD+RW disc. Just as you would
    using a floppy diskette, although a DVD+RW offers you about 3,000
    times the storage capacity! Mt. Rainier performs important tasks in
    hardware instead of software (like background formatting and
    handling of defect management) resulting in a very robust system.
    Also refer to glossary: Mt. Rainier
    <http://www.dvdrw.com/why/glossary.htm#mtrainier>

And from their glossary page:

    *Mount Rainier (MRW)*
    Mount Rainier is an optional feature of the DVD+RW format, that
    allows for DVD+RW media to be used in a "hard disk-like" fashion on
    drives supporting this functionality. The drive will be accessible
    for reading and writing directly from the operating system and all
    applications without the need for dedicated recording-software.

    /<omitted windows-related content>
    /


DVD-RAM also supports such "hard disk-like" functionality, although it 
is completely different media. I will order some blank DVD-RAM on the 
net, since there are no suppliers in town, and mine were already used 
enough.

Regards

Evaldo



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>