LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-02-2013, 01:55 PM   #1
linuxman2013
LQ Newbie
 
Registered: Mar 2013
Location: US of A
Distribution: bt, ubu and rh
Posts: 28

Rep: Reputation: Disabled
Dvd+rw-mediainfo Utility


I cannot find any detailed man info regarding the output of DVD+RW-MEDIAINFO DVD cmd. I want to convert the size info into GB using grep and bc. Here's what it generates when a blank DVD is inserted:

Code:
INQUIRY:                [TSSTcorp][DVD+-RW TS-L632H][D400]
GET [CURRENT] CONFIGURATION:
 Mounted Media:         1Bh, DVD+R
 Current Write Speed:   8.0x1385=11080KB/s
 Write Speed #0:        8.0x1385=11080KB/s
 Write Speed #1:        6.0x1385=8310KB/s
 Write Speed #2:        4.0x1385=5540KB/s
 Write Speed #3:        3.0x1385=4155KB/s
 Write Speed #4:        3.0x1385=4155KB/s
 Write Speed #5:        3.0x1385=4155KB/s
 Write Speed #6:        3.0x1385=4155KB/s
 Write Speed #7:        3.0x1385=4155KB/s
 Write Speed #8:        3.0x1385=4155KB/s
GET [CURRENT] PERFORMANCE:
 Write Performance:     8.0x1385=11080KB/s@[0 -> 2295104]
 Speed Descriptor#0:    00/2295103 R@8.0x1385=11080KB/s W@8.0x1385=11080KB/s
 Speed Descriptor#1:    00/2295103 R@8.0x1385=11080KB/s W@6.0x1385=8310KB/s
 Speed Descriptor#2:    00/2295103 R@8.0x1385=11080KB/s W@4.0x1385=5540KB/s
 Speed Descriptor#3:    00/2295103 R@8.0x1385=11080KB/s W@3.0x1385=4155KB/s
READ DVD STRUCTURE[#0h]:
 Media Book Type:       00h, DVD-ROM book [revision 0]
 Media ID:              SONY/D21
 Legacy lead-out at:    2295104*2KB=4700372992
READ DISC INFORMATION:
 Disc status:           blank
 Number of Sessions:    1
 State of Last Session: empty
 "Next" Track:          1
 Number of Tracks:      1
READ TRACK INFORMATION[#1]:
 Track State:           blank
 Track Start Address:   0*2KB
 Next Writable Address: 0*2KB
 Free Blocks:           2295104*2KB
 Track Size:            2295104*2KB
READ CAPACITY:          0*2048=0
DVD+RW-MEDIAINFO DVD | GREP "Free Blocks:" returns Free Blocks: 2295104*2KB. Whats the best way to display it as 4GB. I know theres 1024MB in Gig. But whats with the *2KB. The documentation I found is too much to digest. Any suggestions or references?

Last edited by linuxman2013; 04-02-2013 at 01:59 PM.
 
Old 04-02-2013, 09:01 PM   #2
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
The number of free blocks is 2295104 for this media (any single layer dvd actually....).
Each block can hold 2kBytes, so the disk capacity, in bytes, is 2295104*2kbytes, or almost 4,377 Gbytes.
The number of blocks is important because the disk can only allocate a integer number of blocks for a file. If you have a lot small files, lets say, files less than 2kbytes each, the disk can hold only 2,295,104 files that will not sum 4,377 Gbytes.....

The same is with your hard drive. Using 4k sectors on modern disks and using a file system that can not use the spare space at end of each sector, you could not fill the disk to its nominal capacity.

I hope that can help you....

Last edited by marozsas; 04-02-2013 at 09:03 PM.
 
Old 04-03-2013, 04:51 AM   #3
linuxman2013
LQ Newbie
 
Registered: Mar 2013
Location: US of A
Distribution: bt, ubu and rh
Posts: 28

Original Poster
Rep: Reputation: Disabled
@marozsas I don't really understand the memory addressing scheme. From your reply it seems like a way for manufacturers to ensure that small files (less than 2k) will fit on a standard 4GB w/out scarificing space on the DVD. Is there a way to extract how much data is stored on a DVD? What if I decided to burn just 42mb to a DVD?

Last edited by linuxman2013; 04-04-2013 at 07:21 AM.
 
Old 04-03-2013, 06:54 AM   #4
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
me neither !
I am not sure why is in that way. Some sort of optimization I guess....
I guess it has to do the mapping of used/free blocks on the media.
If your mapping scheme maps each byte on disk, your mapping is as big is the data. In this scheme (1:1) you will have only half of total space for data and the other half to mapping this data.
Using a 1:2048 mapping scheme you get a good balance between data and and the mapping for point to this data. But I am just guessing here...

If you write 42*2^20 bytes you will use 42*2^20 bytes/2*2^10 bytes/block = 21*2^10 blocks = 21,504 blocks from the 2,295,104 free blocks on the disk, which leaves 2,273,600 blocks of 2kbytes to write additional data (supposing media/drives/filesystems that support "open" disks).
 
Old 04-04-2013, 07:26 AM   #5
linuxman2013
LQ Newbie
 
Registered: Mar 2013
Location: US of A
Distribution: bt, ubu and rh
Posts: 28

Original Poster
Rep: Reputation: Disabled
That makes sense. I don't see how it can hold more than 4.3GB. When I execute the cmd on a DVD that I burned yrs ago, I get strange results. According to Nautilus the DVD holds 4.6GB, more than the 4.3GB cap. Here's the ouput:

Code:
INQUIRY:                [TSSTcorp][DVD+-RW TS-L632H][D400]
GET [CURRENT] CONFIGURATION:
 Mounted Media:         1Bh, DVD+R
 Media ID:              SONY/D21
 Current Write Speed:   8.0x1385=11080KB/s
 Write Speed #0:        8.0x1385=11080KB/s
 Write Speed #1:        6.0x1385=8310KB/s
 Write Speed #2:        4.0x1385=5540KB/s
 Write Speed #3:        3.0x1385=4155KB/s
 Write Speed #4:        3.0x1385=4155KB/s
 Write Speed #5:        3.0x1385=4155KB/s
 Write Speed #6:        3.0x1385=4155KB/s
 Write Speed #7:        3.0x1385=4155KB/s
 Write Speed #8:        3.0x1385=4155KB/s
GET [CURRENT] PERFORMANCE:
 Write Performance:     8.0x1385=11080KB/s@[0 -> 2295104]
 Speed Descriptor#0:    00/2295103 R@8.0x1385=11080KB/s W@8.0x1385=11080KB/s
 Speed Descriptor#1:    00/2295103 R@8.0x1385=11080KB/s W@6.0x1385=8310KB/s
 Speed Descriptor#2:    00/2295103 R@8.0x1385=11080KB/s W@4.0x1385=5540KB/s
 Speed Descriptor#3:    00/2295103 R@8.0x1385=11080KB/s W@3.0x1385=4155KB/s
READ DVD STRUCTURE[#0h]:
 Media Book Type:       00h, DVD-ROM book [revision 0]
 Legacy lead-out at:    2242464*2KB=4592566272
READ DISC INFORMATION:
 Disc status:           complete
 Number of Sessions:    1
 State of Last Session: complete
 Number of Tracks:      1
READ TRACK INFORMATION[#1]:
 Track State:           invisible
 Track Start Address:   0*2KB
 Free Blocks:           0*2KB
 Track Size:            2242464*2KB
FABRICATED TOC:
 Track#1  :             17@0
 Track#AA :             17@2242464
 Multi-session Info:    #1@0
READ CAPACITY:          2242464*2048=4592566272
joe@name-comp-000:/dev$ dvd+rw-mediainfo dvd
INQUIRY:                [TSSTcorp][DVD+-RW TS-L632H][D400]
GET [CURRENT] CONFIGURATION:
 Mounted Media:         1Bh, DVD+R
 Media ID:              SONY/D21
 Current Write Speed:   8.0x1385=11080KB/s
 Write Speed #0:        8.0x1385=11080KB/s
 Write Speed #1:        6.0x1385=8310KB/s
 Write Speed #2:        4.0x1385=5540KB/s
 Write Speed #3:        3.0x1385=4155KB/s
 Write Speed #4:        3.0x1385=4155KB/s
 Write Speed #5:        3.0x1385=4155KB/s
 Write Speed #6:        3.0x1385=4155KB/s
 Write Speed #7:        3.0x1385=4155KB/s
 Write Speed #8:        3.0x1385=4155KB/s
GET [CURRENT] PERFORMANCE:
 Write Performance:     8.0x1385=11080KB/s@[0 -> 2295104]
 Speed Descriptor#0:    00/2295103 R@8.0x1385=11080KB/s W@8.0x1385=11080KB/s
 Speed Descriptor#1:    00/2295103 R@8.0x1385=11080KB/s W@6.0x1385=8310KB/s
 Speed Descriptor#2:    00/2295103 R@8.0x1385=11080KB/s W@4.0x1385=5540KB/s
 Speed Descriptor#3:    00/2295103 R@8.0x1385=11080KB/s W@3.0x1385=4155KB/s
READ DVD STRUCTURE[#0h]:
 Media Book Type:       00h, DVD-ROM book [revision 0]
 Legacy lead-out at:    2242464*2KB=4592566272
READ DISC INFORMATION:
 Disc status:           complete
 Number of Sessions:    1
 State of Last Session: complete
 Number of Tracks:      1
READ TRACK INFORMATION[#1]:
 Track State:           invisible
 Track Start Address:   0*2KB
 Free Blocks:           0*2KB
 Track Size:            2242464*2KB
FABRICATED TOC:
 Track#1  :             17@0
 Track#AA :             17@2242464
 Multi-session Info:    #1@0
READ CAPACITY:          2242464*2048=4592566272
How can I extract the amount of used space on a DVD w/out writing a script? Is there another function in Bash?

Last edited by linuxman2013; 04-04-2013 at 08:10 AM.
 
Old 04-04-2013, 09:36 AM   #6
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
I believe there is not a direct, specific function to return how much space is left in a disk.
You must use some kind of scripting to have this, but it is not complicated.
One possible approach could be something like this:
Code:
miguel@GMF23V1-x:~$ function freedvd {
dvd+rw-mediainfo $1 | grep "Free Blocks:" | rev | awk '{print $1}' | rev | sed 's/KB//' | bc
}
and use it like this:
Code:
miguel@GMF23V1-x:~$ freedvd /dev/sr0
4595776
to get the free space in kbytes, on a blank dvd on my machine.

Last edited by marozsas; 04-04-2013 at 02:54 PM. Reason: Correcting: it returns the size in kilo bytes, not bytes as originally stated.
 
Old 04-04-2013, 02:16 PM   #7
linuxman2013
LQ Newbie
 
Registered: Mar 2013
Location: US of A
Distribution: bt, ubu and rh
Posts: 28

Original Poster
Rep: Reputation: Disabled
@marozsas neat script! dividing it twice by 1024 yields 4.3GB, what we originally determined to be the size of the DVD. My question now why it shows a max cap of 4.3 when there's actually more stored on the DVD. The DVD max cap according to Sony is actually 4.7GB, not the 4.3 we caculated from the output of dvd+rw-media info. So, it appears that its off by like .4GB. Any ideas?

Last edited by linuxman2013; 04-04-2013 at 02:29 PM.
 
Old 04-04-2013, 03:10 PM   #8
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
Hi linuxman2013,

I have an ideia...it is because what is known by overburning. Google about "dvd overburning" to learn more about it.
The media has some extra tracks that can be used write data past its nominal size, but this is not a guaranteed process.

PS: I make a correction in my previous post. You should read "to get the free space in kbytes" not just "bytes" as in the original sentence;

PS2: I'm glad you liked my little function. You can play/mess with the multipliers. For instance, to get the size in bytes, not in kbytes, change it to
Code:
dvd+rw-mediainfo $1 | grep "Free Blocks:" | rev | awk '{print $1}' | rev | sed 's/KB/*1024/' | bc
to get 4706074624, or to get the size in Gbytes, change it to :

Code:
dvd+rw-mediainfo $1 | grep "Free Blocks:" | rev | awk '{print $1}' | rev | sed 's#KB#/1024.0/1024.0#' | bc -l
to get 4.38287353515625000000

Last edited by marozsas; 04-04-2013 at 03:13 PM.
 
Old 04-05-2013, 01:28 AM   #9
linuxman2013
LQ Newbie
 
Registered: Mar 2013
Location: US of A
Distribution: bt, ubu and rh
Posts: 28

Original Poster
Rep: Reputation: Disabled
I believe so too. Its very unlikely that dvd+rw failed to calculate the entire freespace. I'll have to play a lot with these scripts....thanks!
 
  


Reply

Tags
dvd+rw



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Burning dual layer dvd (DVD DL +R) fails using k3b, Nero 4 Linux, Gnome CD/DVD Creat skyxn3t Linux - General 1 09-03-2010 08:26 PM
how do i burn a dvd on the el1300g-01w ive installed roxio easy cd & dvd burning fenyxone@yahoo.com General 3 08-11-2009 07:14 AM
DVD format & DVD shrink Synesthesia Linux - Software 2 07-08-2007 09:57 PM
K3B DVD & Gnome CD/DVD creators worked perfectly, but now won't>Errors Balarabay1 Linux - Software 2 10-08-2006 11:19 AM
k3b & dvd+rw-tools, can't write dvd-r Daliz Linux - Software 28 07-10-2004 08:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration