how can one create a UDF image from a UHD (with dd+makemkv on Linux)?

Everything related to MakeMKV
Post Reply
jemima
Posts: 55
Joined: Fri Oct 06, 2023 1:16 am

how can one create a UDF image from a UHD (with dd+makemkv on Linux)?

Post by jemima »

Hey there.

I have a LibreFriendly drive, and backing up UHD BluRays from MakeMKV works quite nicely.

I even registered/bought it, not because of the recent free key expiration ;-) ... but simply because I think that tool should be supported and especially also because of it's nice Linux support.

No what I would like to do is:
Creating UDF images of UHD BluRays "as is". That means, the files are still AACS encrypted, but any Bus Encryption shall be gone.

For non-UHD discs, this seems to work already by just playing the disc with mpv+libaacs (I assume libaacs is able to "disable" the Bus Encryption here?). For UHD, it does not.
But I thought it would work, when I put the drive in LibreMode (which, AFAIU just disables the bus encryption altogether).

What I previously did was: start MakeMKV (just to get the drive in LibreMode) let it idle, and cp -a all files from the BluRay. That worked, I got the correct files (no bus encryption, but still AACS encryption) which mpv could play (given it had the key in KEYDB.cfg).
But, it's still files, not the UDF image.

So I figured the same should work, for an image: that is, starting MakeMKV (or run makemkvcon f --drive=/dev/sr1 --info ) to get the drive in LibreMode... and then dd if=/dev/sr1 of=image .

Well it doesn't (for UHDs)... it does work for quite a while, but close to the end of the medium it aborts with errors:

Code: Select all

dd: error reading '/dev/sr1': Input/output error
90195+1 records in
90195+1 records out
94576508928 bytes (95 GB, 88 GiB) copied, 5496,55 s, 17,2 MB/s

Code: Select all

# blockdev --getsize64 /dev/sr1 
98871476224
If that's would be in fact the true size, then exactly(!) 4 GiB would be missing (odd "coincidence").

Now... if I mount the image (on which dd however aborted)... I *can* actually play it with mkv (of course there is still aacs, and KEYDB.cfg needs the key).
I haven't checked whether anything is missing/corrupted (because of the 4GiB missing)... but at least the start of the movie looks ok.
So Bus Encryption seems to be actually gone.

I'd also say it's pretty unlikely that the medium is just physically damaged, I mean how are the odds that the error would appear exactly 4GiB towards the end.


So... any gurus here that know what's going on there or how I could make a dd image without any errors? @mike_admin? :D

Thanks,
Jemima.

PS: if it's of any use:

Code: Select all

$ makemkvcon f --drive=/dev/sr1 --verbose --verbose --info 
Found sdf.bin version 0x98 at /home/jemima/.MakeMKV/_private_data.tar
Loaded SDF.bin version 0x98
SDF.bin version: 0x0098

Drive Tool SDF present

Drive Specific SDF present

[Drive Specific SDF] Embedded Info Strings:
8000:LibreDrive Information

8013:Status
8105:Enabled

8001:Drive platform
:RS8E21

8015:Firmware name
:PIONEER BDR-BDS7

8002:Firmware type
8106:Original (unpatched)

8003:Firmware version
:1.02/ID05

8005:DVD all regions
8100:Yes

8006:BD raw data read
8100:Yes

8007:BD raw metadata read
8100:Yes

8009:Unrestricted read speed
8100:Yes


[Drive Specific SDF] Embedded Status Message:
8099:Using LibreDrive mode (v%1 id=%2)
:01.0
:EA39CAD8D416


Identification SDF present

[Identification SDF] Embedded Info Strings:
8000:LibreDrive Information

8013:Status
8102:Possible, not yet enabled

8001:Drive platform
:Pioneer RS8E21

8003:Firmware version
:ID05


[Identification SDF] Drive autodetect string:
pioneer:SAT :8E21:ID05:    :PIONEER :BD-RW  BDR-XS07U1.02: 22/10/24  :-
MrPenguin
Posts: 483
Joined: Thu Oct 19, 2023 11:31 pm

Re: how can one create a UDF image from a UHD (with dd+makemkv on Linux)?

Post by MrPenguin »

Does your Linux distro include "udftools", and specifically the "mkudffs" utility?

I would be inclined to try creating a brand new UDF filesystem on /dev/loop0 rather than trying to clone an existing filesystem. And then burning the new image file to a fresh disk.
jemima
Posts: 55
Joined: Fri Oct 06, 2023 1:16 am

Re: how can one create a UDF image from a UHD (with dd+makemkv on Linux)?

Post by jemima »

Well it has, but from an archival PoV that doesn't make much sense. If I create the a new UDF from the copied single files, then I can also just keep those copied files. Making a fresh UDF won't give me and new information.

What I did however meanwhile was:
I diffed the dd-image with the plain files created by a MakeMKV backup (with decryption disabled) and the contents were identical (except for MakeMKV's discatt.dat)

I further looked at the UDF fs:

Code: Select all

$ udfinfo imagefile
…
blocksize=2048
blocks=46179936
behindblocks=0
…
The image file has 94576508928, which is exactly what the UDF image apparently thinks (2048×46179936) it should have.

So maybe after all, the image was indeed copied completely and correctly, and the dd error is just some artefact of copy protection or so.

But, that's just guessing... so if anyone has more knowledge, would be grateful to hear.

Jemima
MrPenguin
Posts: 483
Joined: Thu Oct 19, 2023 11:31 pm

Re: how can one create a UDF image from a UHD (with dd+makemkv on Linux)?

Post by MrPenguin »

jemima wrote:
Sun Dec 10, 2023 1:20 am
Well it has, but from an archival PoV that doesn't make much sense. If I create the a new UDF from the copied single files, then I can also just keep those copied files. Making a fresh UDF won't give me and new information.
Quite frankly, if you have already managed to copy the files such that they're playable then I cannot think of any reason for also wanting to preserve a UDF filesystem other than to burn that filesystem to another disk - presumably as a back-up :roll:.

If you're trying to do something else entirely then I'm afraid I cannot help.
jemima
Posts: 55
Joined: Fri Oct 06, 2023 1:16 am

Re: how can one create a UDF image from a UHD (with dd+makemkv on Linux)?

Post by jemima »

Well, guess I'm just a perfectionist, when it comes to archiving O:-)
Post Reply