LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-12-2007, 04:51 AM   #1
nakko
Member
 
Registered: Oct 2004
Location: Austin, TX
Distribution: Ubuntu Dapper Drake
Posts: 39

Rep: Reputation: 15
Pad DVD data? Disc layout?


Just curious, this is not really a "problem" per se, but I'm interested in a solution nonetheless.

I'm aware that certain things like PC & console games control their disc layout for maximum performance. Some examples are files that usually need to be read together are placed physically close to each other on the disc to reduce seek-time, and files that need to be read the fastest are placed at the outermost edge of the disc to get the fastest read-speed (and with discs that use less than maximum available space might have nearly the entire set of files towards the outer edge, with blank or useless padded data on the innermost area of the disk).

How might I similarly control the specific particulars of my file order in my disc layout? How could I add dummy padded data, and what is the best way to go about this?

Let me try to give a hypothetical example:
I have an 850MB file, which is too large to fit on a CD, so I must burn this file on a DVD. For some reason, speed is my utmost concern, so I would like to place this file on the outer edge of the DVD. How might I pad the inner area of the DVD with ~3500MB worth of dummy data? How do I ensure that this dummy data is on the inner portion of the disc; how do I ensure that the real file is written last to get the speed gain, not written first?
 
Old 12-12-2007, 11:40 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 76
You could look into creating a multisession disc. The first session would just be a sector range filled by /dev/zero. The second session would be your actual data session (since of course the last session is usually the one that “counts”). You might not even need to make a “first session” (if you use mkisofs).

For example, suppose you have a 100MB file which you want to put on a 650MB/74Min CD, but you want it at the “end” and not the beginning. This might be all that’s required:
Code:
mkisofs -C 0,281800 -o image.iso bigfile.txt
cdrecord /dev/cdrw image.iso
Of course you might need this extra step in the beginning:
Code:
dd if=/dev/zero of=padfile count=1126400
mkisofs -o padding.iso padfile
cdrecord /dev/cdrw -multi padding.iso
mkisofs -C 0,281800 -o image.iso bigfile.txt #Obtain these numbers by doing cdrecord -msinfo with the partially-burnt CD in the drive
cdrecord /dev/cdrw image.iso
I have not actually experimented with this, so I could be wrong on both of the suggestions.

As an aside, do you really think the read-performance increase will be noticeable?

Last edited by osor; 12-13-2007 at 01:51 PM. Reason: Corrections
 
Old 12-13-2007, 01:24 AM   #3
nakko
Member
 
Registered: Oct 2004
Location: Austin, TX
Distribution: Ubuntu Dapper Drake
Posts: 39

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by osor View Post
As an aside, do you really think the read-performance increase will be noticeable?
Well, for my dinky little example, proooobably not. But if there are a ton of files, and you're in a fairly high-performance environment like for games, then yeah, you need seek times to be really really low. Although since you ask, I can't really think of an example other than games where you'd 'need' something like this...

I guess the speed benefit for most everyday file usage would not recoup the amount of time spent burning the extra pad data to the disc. As an aside, this is why I don't use Gentoo... compiling my own optimized programs is probably not worth the extra time and effort. (I'm sure a lot has been said on that subject, and it's a little off-topic.)

Thanks for the suggestion, if I fool around with this, I'll post the results here.
 
Old 12-13-2007, 01:51 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 76
Quote:
Originally Posted by nakko View Post
Thanks for the suggestion, if I fool around with this, I'll post the results here.
I think I made a few mistakes in the syntax of my commands. The -C flag doesn’t take the beginning and end of the session you want to write, rather it takes the beginning of the last session and the beginning of the new session. This means for the second session, instead of 281800,33299, you want something like 0,281800. This also means that you cannot just write a limited amount from /dev/zero, you’ll have to create a sized padding on disk (if you happen to use the second method).

Btw, the you’ll most likely need to change the way you do the numbers. I just use the fact that a 74Min CD has 333000 sectors (presumably numbered 0 to 332999. Each sector holds 2KB worth of data. So 100MB translates into 51200 sectors. If you want this on the end of the disk, you want to start at either 281800 or 281799. In real life, you’ll be able to measure exactly the number of writable sectors your disk has with “cdrecord -msinfo” (when your media is in the drive).
Quote:
Originally Posted by nakko View Post
As an aside, this is why I don't use Gentoo... compiling my own optimized programs is probably not worth the extra time and effort. (I'm sure a lot has been said on that subject, and it's a little off-topic.)
I’m not sure if that comment was directed at me or at Gentoo in general. Personally, I don’t use Gentoo for the “performance” increases, but for other things such as useflags (which allow you to select or deselect functionality in a package, usually akin to doing “-with-foo -without-bar” during configure) and the ability to compile everything as position-independent for use with grsec (which does in fact reduce performance).
 
Old 12-13-2007, 02:02 PM   #5
nakko
Member
 
Registered: Oct 2004
Location: Austin, TX
Distribution: Ubuntu Dapper Drake
Posts: 39

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by osor View Post
I just use the fact that a 74Min CD has 333000 sectors (presumably numbered 0 to 332999. Each sector holds 2KB worth of data. So 100MB translates into 51200 sectors.
Right. For a second I was convinced that CD's and DVD's had different sector sizes, but I looked it up, and was wrong.

Quote:
Iím not sure if that comment was directed at me or at Gentoo in general.
Oh no, certainly it wasn't directed at you. I must now sheepishly admit I didn't even bother to read the little details thingy under your username, so I didn't realize you're a Gentoo user, heh. More of just me commenting that if I chose Gentoo, it would be for that reason, but I didn't since that's not worth it. Which is funny since I am interested in this case with optical media burning... But obviously there can't be a whole distro with just one sole benefit. Even if it was, I can imagine in either a distributed environment, or a production server environment or something, saving just a few clock cycles here and there could very likely add up fast.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
will removing a raid disc delete its data? nadroj Linux - Hardware 15 02-15-2006 06:15 AM
k3b hangs when trying to burn dvd+rw disc but not cd rw disc laiboonh Slackware 0 11-06-2004 12:22 PM
Noob asks for help in burning a data dvd disc steelyken Linux - Newbie 14 09-18-2004 12:26 AM
copy hard disc data, with permissions tidasu Linux - Newbie 3 08-29-2004 09:30 PM
Mandrake 9.2/10 CD Data disc access. ruse Linux - Newbie 2 08-17-2004 05:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration