Skip to content

Use device node names rather than kernel names to check optical drives#272

Draft
cconverse711 wants to merge 1 commit intojlesage:masterfrom
cconverse711:master
Draft

Use device node names rather than kernel names to check optical drives#272
cconverse711 wants to merge 1 commit intojlesage:masterfrom
cconverse711:master

Conversation

@cconverse711
Copy link

@cconverse711 cconverse711 commented Jan 25, 2026

This change allows devices to be symlinked in host for improved device naming stability

When my computer power cycles, I find that the sg device's name/path tends to change between /dev/sg0, /dev/sg1 and so forth. I've created a udev rule as follows:

# Stable symlink for the block device
SUBSYSTEM=="block", KERNEL=="sr*", ATTRS{serial}=="myserialno", ATTRS{idVendor}=="08e4", ATTRS{idProduct}=="017a", SYMLINK+="bluray/sr"

# Stable symlink for the sg device
SUBSYSTEM=="scsi_generic", ATTRS{serial}=="myserialno", ATTRS{idVendor}=="08e4", ATTRS{idProduct}=="017a", SYMLINK+="bluray/sg"

Thus I can provide the symlinks as the devices in the compose definition:

    devices:
      - "/dev/bluray/sr:/dev/bluray_sr"
      - "/dev/bluray/sg:/dev/bluray_sg"

However the existing 54-check-optical-drive.sh is incompatible with these symlinks due to its use of kernel names. This fix will allow the drives to be detected even when symlinks are used.

This change allows devices to be symlinked in host for improved device naming stability
@jlesage
Copy link
Owner

jlesage commented Jan 25, 2026

What was the problem exactly with 54-check-optical-drive.sh ?

The change seems to break (at least in my case) usual scenario where /dev/sr* and /dev/sg* are exposed.

@cconverse711
Copy link
Author

The problem I was finding was that 54-check-optical-drive.sh was unable to find the optical drives when I tried mapping them into the container using their symlinks. The -k flag to lsscsi prevented the symlinks from being detected by the script. But now I see with my changes, makemkvcon reports not finding usable optical drives.

It's not clear to me how makemkvcon is searching for optical drives, but I'll have to consider some workarounds. Ultimately this is so I no longer have to keep editing my docker compose file upon reboots, but perhaps there's no better option

@cconverse711 cconverse711 marked this pull request as draft January 25, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants