80

I have a DVD ROM with some teaching resources on it (Headway Beginner's English teaching teacher's DVD). When I look at the DVD from a Ubuntu machine, I see one set of files (which includes a setup-linux file among other things, although that doesn't work).

When I view the same DVD from a Windows machine, I see a different set of files, including a setup-windows.exe file.

Neither machine sees all the files, but there are some common to both.

My questions are:

  1. How does this work?
  2. How can I see the all the files when using Ubuntu?

Edit: this is not due to files being "hidden" when viewed in a file manager, lower level things like "ls -a" do not reveal the missing files.

Edit 2: I'm using Ubuntu 18.04 LTS

spookylukey
  • 763
  • 5
  • 8
  • You haven't said which Ubuntu release you are using, but in `nautilus` (or 'Files' the file manager for gnome) if you go to icon-view mode and click on the menu you can click "Show Hidden Files" and you should see all files. If in details (or list) mode the option is somewhat hidden (on my 19.04 box; sorry I don't use nautilus normally). Windows by default uses a fs (file-system) flag to hide files, where as \*nix (Ubuntu, any GNU/Linux, apple or unix) use a '.' as the first character of filename to make a file 'hidden'. – guiverc Jan 18 '19 at 09:03
  • 2
    This is not a hidden files thing - using `ls -a` in Linux does not show the missing files. And neither does "Show hidden files" in Windows explorer. – spookylukey Jan 18 '19 at 09:18

2 Answers2

111

I'm not sure this is the correct answer, but maybe it'll provide you with details that will help you.

It could be because MS-Windows and Unix use different file systems on DVD - even on the same DVD. Files on an optical medium are usually arranged using a file system protocol specified in the ISO 9660 standard (also see notes at the end).

But the standard allows for extensions, and Microsoft has designed their own extension to the standard called "Joliet" that allows Microsoft Windows compatible operating systems to read different file names with more features (longer names and support Unicode) than the standard ISO 9660 file system allows.

For Unix-style operating systems (such as Linux), another extension called "Rock Ridge" was developed, to allow even longer file names, Unix-style permissions, and a few other things.

It is very common to have both Rock Ridge and Joliet extensions on the same optical medium, but it could be that the creator of that DVD used these extensions in a clever way to only have the MS-Windows related files show in the Joliet part of the system and only have the Linux specific files show in the Rock Ridge part of the system. The isoinfo program discussed in this stackexchange answer might provide more information.

Notes:

As mentioned in the discussion in the comments, while a lot of media are still authored in ISO 9660 and its extensions where the kinds of tricks discussed in the OP can happen, ISO 9660 is obsolete and modern media should be authored using UDF (ISO 13346) which is a Universal Disk Format and only allows a single view of the entire file system - so such tricks will probably not be possible on a UDF authored disk.

Charles Green
  • 20,952
  • 21
  • 60
  • 92
Guss
  • 3,435
  • 3
  • 33
  • 42
  • 27
    Thanks, that was enough - `isoinfo dev=/dev/dvd -J -ls` shows the missing files in Linux. – spookylukey Jan 18 '19 at 10:01
  • 25
    Pretty good answer, but one important detail I see missing is the `--norock` and `--nojoliet` mount options you can use on Linux to decide which of the three tree layouts you want to see. – kasperd Jan 18 '19 at 14:21
  • 8
    Wow that's ... actually surprisingly elegant. – Lightness Races in Orbit Jan 18 '19 at 17:17
  • @kasperd - thanks, I wasn't aware of these mount flags. – Guss Jan 18 '19 at 17:23
  • 4
    Some tools such as [`mkisofs`](https://linux.die.net/man/8/mkisofs) actually allow you to specify how to generate those. The "Examples" section at the linked man page shows how you can create an ISO that has a file named `README`, but will appear with different contents depending on what system you're using to view the CD. To quote the man page: *"There are probably all sorts of strange results possible with combinations of the hide options..."* – Herohtar Jan 18 '19 at 19:08
  • How did you manage to mention ISO-9660 but not UDF in this answer in 2019... – user541686 Jan 19 '19 at 00:40
  • 1
    @Mehrdad: If it's inconsistent with the evidence stated in the question, it would be irrelevant. – Ben Voigt Jan 19 '19 at 05:29
  • @BenVoigt: I was referring to the sentence *"Files on an optical media are usually arranged using a file system protocol specified in the ISO 9660 standard."* If it's going to be included, I think in 2019 should say UDF instead of ISO-9660, because I don't think the latter is what optical media normally use nowadays. (Whether it should be included or not is beside my point.) – user541686 Jan 19 '19 at 11:08
  • 3
    I'm happy that there is mention of UDF in the comments, but I'm not sure its relevant to the discussion - if the file system on the OP's DVD was a universal format then you won't be able to get different views in Windows and Linux, as far as I understand. – Guss Jan 19 '19 at 12:45
  • @Mehrdad: The answer would be wrong if you replaced ISO-9660 by UDF. It could be possible to mention UDF in some way, and it probably would be an improvement to say "sometimes arranged ... ISO 9660 rather than the newer UDF" because it is questionable whether ISO 9660 remains "usual". But the answer is definitely about tricky things you can do with ISO 9660, not with UDF. – Ben Voigt Jan 19 '19 at 15:57
  • @Guss: I'd just remove the sentence that I quoted above then. ISO-9660 was already getting obsolete like 10 years ago, and just like with UDF, it doesn't explain any difference between Windows and Linux. [Let's just cut this discussion here, I don't see the point of continuing.] – user541686 Jan 19 '19 at 16:15
  • @Mehrdad: The closest disc at hand, H&B Block disc for filing 2018 taxes, is ISO 9660+Joliet. I seem to recall that UDF is for rewritable discs, where files can be incrementally added to the filesystem, and ISO9660 is for authored discs, where all files are prepared before recording. But what you are missing is that the answer is about OSes handling ISO9660 extensions differently. You cannot take ISO9660 out of it; you cannot put UDF in. Your statement "[ISO 9660] doesn't explain any difference between Windows and Linux" is just wrong. – Ben Voigt Jan 19 '19 at 16:18
  • 1
    @Mehrdad - I've added a note in my answer on the existence and importance of UDF, though as Ben Voigt mentions - I believe that the question itself informs us that UDF is not being used. – Guss Jan 19 '19 at 17:22
0

Very probably the "rockridge" (unix) and "joliet" (microsoft) tables map the bare iso9660 file names differently. They both involve a "mapping" in each directory that basically says which actual iso files (8+dot+3 characters) should be seen as which longer name. So each file actually has 2 names, one limited to 8+3 characters, and one that's not.

On rockridge, this mapping is an actual file that gets added to each directory, iirc named "TRANS.TBL" or something. On joliet, it's an extremely ugly and stupid hack where a "directory entry" isn't an actual file, but is reserved for this purpose.

delt
  • 31
  • 1
  • Oh i forgot to add: windows only supports joliet (no surprise there) while linux supports both (also no surprise there) although in linux, and most other unix systems, rockridge takes precedence by default. There is however mount options to disable one or the other, or both. If you disable both, then you'll just see the short 8.3 filenames, like you would for ex. in DOS or in windows 3.x and prior. Depending which file manager and desktop environment you use, there might be a "user friendly" way to do that without typing commands :) – delt Jan 22 '19 at 23:13