LinuxQuestions.org
Review your favorite Linux distribution.
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 02-23-2015, 11:39 PM   #1
Wocky
Member
 
Registered: Oct 2004
Location: Australia
Posts: 37

Rep: Reputation: 3
df and du give different results on DVD filesystem


On debian 7.5,

Code:
$ mount /dev/sr0 /DVD
$ df -h /DVD
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/sr0       6.8G    6.8G    0      100%    /DVD
$ du -h /DVD
25G   /DVD/VIDEO_TS
25G   /DVD
$ grep DVD /etc/fstab
/dev/sr0     /DVD     iso9660    ro,noexec,user,nodev 1 2
$
The disc is a recent commercial dual layer video DVD (Jack Ryan: Shadow Recruit), not a Blu-Ray. It plays properly; I just don't see why du gives such a different size to df - in fact, it seems to be almost 4 times what the DVD can hold.

Can anyone explain the difference?
 
Old 02-24-2015, 02:45 AM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by Wocky View Post
Code:
$ mount /dev/sr0 /DVD
$ df -h /DVD
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/sr0       6.8G    6.8G    0      100%    /DVD
$ du -h /DVD
25G   /DVD/VIDEO_TS
25G   /DVD
$ grep DVD /etc/fstab
/dev/sr0     /DVD     iso9660    ro,noexec,user,nodev 1 2
$
The disc is a recent commercial dual layer video DVD (Jack Ryan: Shadow Recruit), not a Blu-Ray. It plays properly; I just don't see why du gives such a different size to df - in fact, it seems to be almost 4 times what the DVD can hold.

Can anyone explain the difference?
it's important to know that du works on a file level, while df works on a file system level. In other words, du examines the directory entries and considers the size of all the files listed in it, while df just looks at the control structures of the file system, which only partially makes sense for ISO9660 - at least this file system has no free blocks by definition.

And what you see is obviously a bad trick used by some DVD producers: They deliberately produce weird directory structures, for instance by referencing the same file multiple times (very much like hard-linking) or by creating bogus directory entries that do not reference a valid file at all but pretend gigabytes of data. Try a 'ls -la /DVD/VIDEO_TS' to see what I mean.
The only purpose I can think of is probably to discourage people from ripping the DVD contents, or to make it harder for them anyway.

The first DVD where I encountered this trickery was Wall-E, which seemed to have over 60GB of data ...

[X] Doc CPU

Last edited by Doc CPU; 02-24-2015 at 03:42 AM.
 
Old 02-24-2015, 08:09 AM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,327

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
This directory scrambling of DVDs has been around for years. It is a copy protection scheme.
 
Old 02-24-2015, 09:14 AM   #4
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by haertig View Post
This directory scrambling of DVDs has been around for years. It is a copy protection scheme.
that's what I said.
However, as a copy protection method it is pointless, because assuming you beat CSS and these other little tricks, you can always rip the DVD into an ISO file - and suddenly you don't have to bother about this file system shit.

[X] Doc CPU
 
Old 02-25-2015, 03:25 PM   #5
Wocky
Member
 
Registered: Oct 2004
Location: Australia
Posts: 37

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by Doc CPU View Post
Hi there,



it's important to know that du works on a file level, while df works on a file system level. In other words, du examines the directory entries and considers the size of all the files listed in it, while df just looks at the control structures of the file system, which only partially makes sense for ISO9660 - at least this file system has no free blocks by definition.

And what you see is obviously a bad trick used by some DVD producers: They deliberately produce weird directory structures, for instance by referencing the same file multiple times (very much like hard-linking) or by creating bogus directory entries that do not reference a valid file at all but pretend gigabytes of data. Try a 'ls -la /DVD/VIDEO_TS' to see what I mean.
The only purpose I can think of is probably to discourage people from ripping the DVD contents, or to make it harder for them anyway.

The first DVD where I encountered this trickery was Wall-E, which seemed to have over 60GB of data ...

[X] Doc CPU
This turned out to be the answer. I compared some of the files in the VIDEO_TS subdir, and, of 86 files, 38 were identical to at least five others. I ripped the DVD (I find it amusing that the very things done to discourage ripping actually encourage it) and replaced the copies with symbolic links. Playing the copy works as it should.
 
  


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
How can I give 1 user access to mount 1 particular filesystem? wjtaylor Linux - Server 4 06-13-2011 10:34 PM
[SOLVED] fdisk -l doesn't give any results fkasmani Linux - General 1 03-06-2010 07:23 AM
Need to give rw access to a filesystem for a user antonyphilip Linux - Newbie 2 11-17-2009 06:44 AM
Running find on / results in filesystem error Maeltor Linux - General 5 06-07-2006 11:20 AM
Script Problem - Does not give expected results Jose Muņiz Linux - General 3 07-12-2003 10:10 PM

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

All times are GMT -5. The time now is 05:18 AM.

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