MakeMKV Linux and USB optical drives: Read issues and solution

The place to discuss linux version of MakeMKV
Post Reply
evbuk
Posts: 2
Joined: Sat May 22, 2021 3:10 pm

MakeMKV Linux and USB optical drives: Read issues and solution

Post by evbuk »

I have two drives supplied by Asmcom in the UK. One is an Hitachi LG-BH16NS40 cross-flashed to a Hitachi LG-WH16NS60 on firmware version 1-00DE (LibreDrive) in an OWC Mercury Pro external USB3 enclosure. The other is an LG BH16NS55 on firmware 1.02DE (LibreDrive) in a Vantec external USB3 enclosure.

I am running Ubuntu Desktop 20.04 LTS and the Linux version of MakeMKV installed via the APT repository.

I was running into a problem (with both drives) where DVD (and only DVD) media would cause the drive to seek repeatedly and the disc would never be mounted on the system. If I inserted a DVD into either drive, it would not mount and any disc that I inserted afterwards (bluray or UHD included) would also cause an infinite seek loop and no mount behaviour. The only way to get the drives working again would be to shut the computer down, turn the power to the drive off and on and then start the machine again. I should say that both drives performed without issue under Windows 10 no matter what type of media was inserted.

Initially I thought that the problem was caused by a faulty drive, but when the behaviour happened again with the newer LG in the OWC enclosure, I started to dig deeper. With the help of someone else who was having the same problem with 20.04 LTS and a different drive in a different enclosure, we found a solution which I hope might help others who run into the same issue.

The solution is to make the following configuration changes:

Code: Select all

sudo cp /usr/lib/udev/rules.d/60-persistent-storage.rules /etc/udev/rules.d/60-persistent-storage.rules
sudo vim /etc/udev/rules.d/60-persistent-storage.rules
and make the following lines in /etc/udev/rules.d/60-persistent-storage.rules:

Code: Select all

# probe filesystem metadata of optical drives which have a media inserted
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \
  IMPORT{builtin}="blkid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}"
# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \
  IMPORT{builtin}="blkid --noraid"
look like this:

Code: Select all

# probe filesystem metadata of optical drives which have a media inserted
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \
  GOTO="persistent_storage_end"
##  IMPORT{builtin}="blkid --offset=$env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}"
# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \
  GOTO="persistent_storage_end"
##  IMPORT{builtin}="blkid --noraid"
(the IMPORT... statements are commented out and replaced with GOTO... replacements)

Reboot and then try your DVD media again - it should work now.

Ref:

I ran across this bug report on a Fedora system, which mentions a similar issue on yet more dissimilar hardware. The one thing they had in common was the use of a BluRay drive in a SATA to USB3 external enclosure.

That bug report indicated that their problem was with poor behavior of blkid when optical media was inserted into the drive. Like him, I was able to validate that the drive functioned perfectly fine on a Win10 system, but on multiple Ubuntu 20.04 machines, DVD Movie media would cause the drive to hang for a period and the media would never be recognized by the OS.

Another bug report was referenced as source material where the work-around to this is referenced.

Unfortunately, both bug reports were ultimately closed as not-resolved due to them ageing out. Would love to put this in front of one of the util-linux package maintainers and a kernel maintainer to see where the true fix for this should really be implemented.
[/code]
jmeline
Posts: 1
Joined: Sun May 30, 2021 7:01 am

Re: MakeMKV Linux and USB optical drives: Read issues and solution

Post by jmeline »

I made an account just to say thank you for that solution!

I run Archlinux at home and my old bluray drive (LG UH12NS30 1.00) housed in an OWC Mercury Pro started acting up on me. This drive would rip about five blurays/dvds before it seemed to get stuck doing nothing when I tried to switch disks. The drive would just constantly spin and makemkv would freeze while it was trying to identify the available optical drives. Rebooting my computer didn't work. I didn't quite understand what was happening and I thought that either the drive or the enclosure was bad.

Reading your post described exactly what I was experiencing. Tonight my drive began to act up and I decided to look through the forums hoping someone would have run into this. Found your post and I modified my udev rules as described. Upon reboot I was back in business. I am 99% sure this was the issue I experienced. Thank you! Thank you! Thank you! :D
Post Reply