How to determine the physical location of data on a disc?

13

3

Does anybody know of a way to find out where, physically on a CD or DVD a given piece of data would be located?

I am trying to watch a DVD at the moment, and am about half-way through, but it keeps dying at a specific spot in the film, presumably because of a scratch. I have a repair kit, but I don’t know where to focus my repair because there are several scuffs and scratches on the disc and I have no way of knowing which one is causing the issue.

Obviously, cleaning all of them is inadvisable because not only does it waste the consumable materials in the kit, but not all of them are a problem, and by working them, some may become unreadable. Moreover, just because I am half-way through the movie does not mean that it would be half-way from the hub to the edge for several reasons:

  • Discs have more data towards the outer edge than the inner edge (circles are more mathematically complicated than rectangles)
  • The disc is not completely filled up (and even if it were, the movie itself would be be using it all, there are extras and such)
  • Because in this particular case it is a commercial DVD, it is also dual-layer which further complicates manual determination

As such, I am trying to find a program that can let me identify a file (or part thereof), cluster, etc. and show me a picture of where on the CD/DVD it would be located. That way, I can look at the disc and fix any scratches that correspond to that distance from the hub.

For example, the image below might indicate where on a disc a couple of files or range of clusters would be located, so by looking for anomalies in those areas (rotating as necessary), the correct one can be identified.

I’m sure it can be done since at least one form of copy protection (DPM) uses it and DVD-lab Pro includes a “DVD Topology” feature to do this.

enter image description here

Synetech

Posted 2012-12-18T16:49:49.323

Reputation: 63 242

No.. but very interesting question. I would wonder the same about disk drives(even if you can't do anything to repair those) – Jeff F. – 2012-12-18T16:52:16.857

I'm not sure about DVD/CD storage, but for HDDs, the storage is in no way linear. – EBGreen – 2012-12-18T16:57:00.057

3@Synetech Also, on a related note but not directly answering the question. A lot of Video Rental stores have a DVD Repair machine which will resurface the disk safely. They normally charge a small fee but it works very well and can remove deep scratches. – Jeff F. – 2012-12-18T16:58:35.277

Agreed with Jeff F. interesting question and I don't know how to do this but if you want to watch the film while waiting for an answer :), you can try to copy the DVD to another as usually copy programs are better to read errors than DVD players and many times this "fixed" the disk. – laurent – 2012-12-18T16:59:26.790

@EBGreen Well depending on fragmentation levels, etc. But it would be cool to know the points where data for a related file are at. – Jeff F. – 2012-12-18T16:59:47.167

1Optical discs are definitely linear, from inside to outside. How dual layers factor into this I don't know, but most commercial discs do NOT use the DL functionality linearly. – Jonathan Garber – 2012-12-18T17:00:30.687

@JeffF.For HDD files http://stackoverflow.com/questions/3444844/finding-what-hard-drive-sectors-occupy-a-file

– EBGreen – 2012-12-18T17:02:30.453

@JeffF., I am familiar with resurfacing machines (I recall seeing a consumer “Disc Doctor” back in 1996), but my “DVD Wizard” kit has worked great the three times I’ve used it. I assume you are talking about fragmentation on a hard-drive right, I can’t imagine that a file on CD/DVD should ever be fragmented—at least I should hope not. – Synetech – 2012-12-18T17:44:15.613

@JonathanGarber, yes, they are linear in that they have the same data density, but that is exactly why the inner tracks have less data. I recall when DVDs first came out (and probably even when higher-speed CDs came out), they behaved differently (CAV) than people were used to (CLV), so it created a lot of confusion and complications in calculations. :-| – Synetech – 2012-12-18T17:48:45.210

@Synetech The fragmentation was referring to the hard disk statement not the CD/DVD. Also the resurfacing machines are far better then you would buy, they actually strip the surface and add material. I had scratched the heck out of an Xbox 360 game(don't rotate it while on :( ), it made it look like new when it was done. Cost me $3 if I recall correctly. – Jeff F. – 2012-12-18T17:55:23.580

@Synetech, you're right, the word I was looking for was "sequential". – Jonathan Garber – 2012-12-18T18:00:30.943

In my experience such "hiccups" are often due not to physical scratches but rather to glitches in the burning of the disk. I don't know what the mechanism might be, but in such cases I doubt that the error can be polished away. – Daniel R Hicks – 2012-12-18T19:33:15.627

@DanielRHicks, yes, I have seen Slysoft blame many issues on the disc simply “being bad” and recommending that people exchange it. Of course scratches do indeed cause problems, but not always; discs were designed with error-recovery in mind. That’s why it can be difficult to determine which one(s) to focus on. – Synetech – 2012-12-20T17:00:16.573

Answers

3

This doesn't want to be an answer to your full question, but a series of answers to minor questions from which to construct the final answer, if there is.

Supposing your "repair kit" really works and makes bad sectors readable again... (so supposing you're not wasting your time)

You said the movie stops in "the middle" but obviously you don't know where that middle is on disk surface. You could try to use dd command for Linux with option conv=noerror to create an image of the disk. If you get a read error you can have a more precise idea of what sector is affected by damage, because dd will warn you on standard output about the error.

Also, keep in mind that in this phase (creating a disc image) you might even get the full image on your hard disk because your computer's drive (supposing you watch movies on set top box) might, and I say might perform better (or often worse) than the drive you used to watch the movie with. In this case I suggest you to say goodbye to fixing the disc, crack CSS and burn it on a blank media, you can rightfully do it because you own the original and you're making a personal backup.

If you get a read error then you may want to investigate further. What I can tell you is that Linux sees device as linear block devices (from 0 to approx. 9GB) and around 4.5GB there is the dual layer transition. DVDs are always burned from inner to outer tracks, and from my experience the same applies to the second layer, so if you can find the number of the damaged sector(s) you can get a bare idea on which damaged track it could be closer to.

I would investigate the UDF addressing format to find hints about mapping sectors to tracks. Hard disks conventionally use CHS addressing (cylinder, head, sector) but I believe DVDs are different.

Sorry if I don't answer your question but it's really challenging.

usr-local-ΕΨΗΕΛΩΝ

Posted 2012-12-18T16:49:49.323

Reputation: 3 733

I don't think you need to look at UDF, it is a filesystem and dd will take the raw data block by block. So if you get a read error, you'll be able to estimate roughly where on the disc it is located. If you don't get a read error but reading from dd image still fails, the problem is not with the DVD. – Eric Darchis – 2012-12-20T09:12:44.183

@EricDarchis the UDF thing was supposed to simplify the analysis. If I knew what file is broken, and if I could then know how UDF addresses it, and if I knew mapping between UDF logical address and DVD physical address, and if I knew how to map DVD physical addresses to distance from centre I could then build a GUI that displays me where bad sectors are on the disc. It's all hypothetical, I don't know about UDF or other filesystems. – usr-local-ΕΨΗΕΛΩΝ – 2012-12-20T10:45:07.997

I would investigate the UDF addressing format to find hints about mapping sectors to tracks. Hard disks conventionally use CHS addressing (cylinder, head, sector) but I believe DVDs are different.   @djechelon, yes, it would indeed require knowledge of the formats to do the calculations. ☹ – Synetech – 2012-12-20T17:05:59.963