How to share an optical drive (CD ROM or DVD ROM) to the network?

  • It already works. But only once. Help Appreciated

    • Once I get this working, I want to publish this as a guide. Already written in that style.
    • Setup steps 1-5 already work correctly,
    • Only remaining problem, see the red headline below:
      Problem 1: This is a "one hit" wonder for now, no automatic mounting when inserting a new disc later
    • The newest related article is Share optical drive (CD/DVD) on the network but it does not address that.
    • Max data rate of a DVD Video: 9.8 Mbit/s (MPEG-2 Part 2) or 1.8 Mbit/s MPEG-1 Part 2, most WiFi networks achieve that effortless

    How to share an optical drive (CD ROM or DVD ROM) to the network

    0) Motivation

    • DVDs in general are passe, no doubt.
      • I ripped most of my DVD collection and added it to Plex anyways.
    • But still these two use cases exist:


      1. Playback of DVD via network. Sometimes my kids rent a DVD from the public library (they still offer this). Being able to use a contemporary laptop/tablet and access the DVD via network would be handy.
      2. Doing a new DVD rip directly on the NAS. Spare myself the procedure to hook up power and data cables, perform ripping on laptop, then transfer the video file up to the NAS.

    How it looks in action

    1) Connect Optical Drive then insert disc then see: Storage > Disks

    Menu > Storage > Disks: Now shows this additional entry:


    Device: /dev/sr0 Model: DVD RW AD-7173A Vendor Optiarc showed up with capacity 7.82 GiB


    Let's see how this is reflected in the CLI:


    $ ls -l /dev/sr0

    brw-rw---- 1 root cdrom 11, 0 Jul 21 17:34 /dev/sr0 👈 That's the optical drive.

    2) Mount Optical Drive via: Menu > Storage > File Systems

    • Go to: Menu > Storage > File Systems
    • Click "Create/Mount"
    • This opens a dialog:
      • Click dropdown "File system"
        • This is noticible slower than otherwise, which likely is because optical devices are quite laggy/slow.
        • Choose "/dev/sr0"
      • Usage warning treshhold warning
      • I leave this as is (85%) and hope this causes no false errors, as optical disks may always be full or quite full.
      • Click SAVE
    • The optical drive is now listed under the File System as:
      • Device: /dev/sr0
      • Label: DVDVolume
      • Type: UDF
      • Total: 7.82 GiB
      • Mounted: √
      • Mount Point: /srv/dev-disk-by-uuid-bf5ae4c620202020
      • Referenced: Not yet, we just created it.
      • Status: Online


    Let's check the command line shortly


    $ ls -l /srv/dev*

    dr-xr-xr-x 4 nobody nogroup 136 Feb 7 2036 dev-disk-by-uuid-bf5ae4c620202020 👈 That's the optical drive.

    drwxr-sr-x 7 root users 4096 Jul 21 17:57 dev-disk-by-uuid-f0233da3-473e-450d-9a18-b2ae254fc439


    Summary: /dev/sr0 gets mounted at dev-disk-by-uuid-bf5ae4c620202020


    OMV6 status note: Mounting a DVD drive was possible without any extras. In earlier systems (which ones?), this alone required some extra installations (which ones?). (Hints appreciated, would then update this hint).


    3) Create share "DVD" (or similarly named)

    • Go to: Menu > Storage > Shared Folders
    • Click "Create"
    • This opens a dialog:
      • Name: Name it "DVD" or similar
      • File system: /dev/sr0
      • Relative Path: "/" which means share the root of the optical disk. Not a subdirectory of it!
      • Permissions:
      • I found no permission set with "read only for everebody" which would be most adequate.
      • Hence I left the default one "Administrator: read/write, Users: read/write, Others: read-only".
      • We will overrule this in the partucilar sharing service.
      • Click SAVE

    Note on OMV6: Mounting a DVD drive was possible without any extras. In earlier systems, as far as I understood from what I read, this already required a plugin like openmediavault-sharerootfs.


    4) Offer the share "DVD" via SMB/CIFS (Samba)

    • Go to: Menu > Services > SMB/CIFS > Shares
    • Click "Create"
    • This opens a dialog:
      • Shared Folder: Choose "DVD" (which we created in step 3)
      • Leave all values on their defaults, except the following.
      • Read Only: Activate this.
        • CDROM and DVDROM are read only media, so this is adequate.
        • Burning CD-R/RW or DVDs via Samba does not work anyway.
        • Even if, not in scope of this tutorial.
      • Extra options:
        Code
        fake oplocks = yes
        locking = no
        • I choose options which should optimize access to optical media (to my understanding).
        • The samba configuration manual explains these options.

    5) Access the DVD from a SMB client (Linux, Mac, Windows)

    MacOS 11.6.7 Big Sur

    • In the Finder: Menu > Go > Network (⇧ ⌘ K)
    • Your OMV SMB Server is listed there. → Double click it.
    • "DVD" is listed among the available shares. → Double click it.
      • Success: The DVD contents get listed: AUDIO_TS/ and VIDEO_TS/
    • Now use a video app, capable if DVD playback like VLC.app or Apple's own DVD Player.app
      • Do not open an individual file.
      • But open the whole folder VIDEO_TS/ into the playback app.
      • It worked at the beginning (intro, menu) already with a hickup every 10secs or so.
      • When starting playback of the main app, the computer got quite unresponsive.
      • Finder started hanging. I force-quit Finder (which normally never happens but which deals badly with unusual timeouts from network shares or cable-attached media).

    Problem 1: This is a "one hit" wonder for now, no automatic mounting when inserting a new disc later

    • As soon as you eject the DVD, and insert the same or another DVD again:
      • Menu > Storage > Filesystems:
        • Still lists /dev/sr0
        • But "Mounted" has no checkmark and "Total" is "-".
      • Being still there I tried the following
        • Click "Mount"
        • You get to a next screen
          • File system: Nothing can be selected here.
          • I clicked cancel to get back to the listing.
      • It refreshed really looooong (again the DVD response is quite slow I assume)
      • After ca 30secs I gt the listing
      • I select "/dev/sr0" (DVDVolume) whose status still shows as "Online"
        • Problem: The "unmount" button remains inactive.
      • So ejected the DVD with the hardware button of the optical drive.
      • Its status changed to "Missing"
      • I insert a new DVD.
        • Its status remains "Missing" for the next 1min or so.
        • The UI itsels show the progress bar on top of the table here and then. No change.
        • I do some browser refreshes. Nothing.
        • When DVDVolume is selected the "Unmount" button remains inactive.
      • I eject the DVD with the hardware button.
        • Still "Offline" and the "Unmount" button inactive.
      • I detach the USB cable which connects NAS and optical drive.
        • Unchanged.


    ✅ Problem 2: If you are left with an orphan filesystem, you can clean it up this way

    You may first try what you can do in the Web UI:

    • Menu > Services > SMB/CIFS > Shares
      • The "DVD" samba share is active, which references the general "DVD" share.
      • Select it, delete it, save and apply.
    • Menu > Storage > Shared Folders
      • Select the "DVD" item, delete it, save and apply.
    • Menu > Storage > Filesystems:
      • Shows as missing.
      • Select it. Unmount button remains inactive? → You have done everything you could in the Web UI.


    You need to fix this in the CLI as root or with sudo commands.:

    • Be sure the optical drive is physically disconnected to not complicate/confuse the procedure further.
    • In file /etc/fstab within the [openmediavault] container look for a line which has "udf" as in Universal Disk Format as used in DVDs:


      • /dev/disk/by-uuid/YOUR-DVD-DRIVE-UID            /srv/dev-disk-by-uuid-YOUR-DVD-DRIVE-UID udf ro,nofail 0 2
      • Delete it, or at least put it out of that container (as it is managed by the Web UI) and then outcomment it. Save.
    • Then just to be sure try:
      • mount -a
      • Nothing should happen.
    • Now check file /etc/openmediavault/config.xml
      • First back it up.
      • Then search for "YOUR-DVD-DRIVE-UID". Remove the entire XML "mntent" entry in which you found the string.

    Odroid HC2 - Armbian 24 Bookworm - OMV7

    6 Mal editiert, zuletzt von porg ()

  • Maybe that info helps too

    $ ls -l /srv


    drwxrwxrwx 2 root root 4096 Jul 21 17:56 dev-disk-by-uuid-bf5ae4c620202020 (<-- black text on green bg in CLI output)

    drwxr-sr-x 7 root users 4096 Jul 21 17:57 dev-disk-by-uuid-f0233da3-473e-450d-9a18-b2ae254fc439

    drwxr-xr-x 2 ftp nogroup 4096 Jul 13 22:31 ftp

    drwxr-xr-x 3 root root 4096 Jul 13 21:47 pillar

    drwxr-xr-x 7 root root 4096 Jul 13 21:47 salt

    lrwxrwxrwx 1 root root 59 Jul 14 02:07 snd -> /srv/dev-disk-by-uuid-f0233da3-473e-450d-9a18-b2ae254fc439/


    $ cat /etc/fstab

    UUID=dede0252-4d2a-4b10-8320-063fc4c949a2 / ext4 noatime,nodiratime,defaults,commit=600,errors=remount-ro 0 1

    tmpfs /tmp tmpfs defaults,nosuid 0 0

    tmpfs /tmp-plex tmpfs defaults,nosuid,size=150m 0 0

    # >>> [openmediavault]

    /dev/disk/by-uuid/f0233da3-473e-450d-9a18-b2ae254fc439 /srv/dev-disk-by-uuid-f0233da3-473e-450d-9a18-b2ae254fc439 ext4 defaults,nofail,user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2

    /dev/disk/by-uuid/bf5ae4c620202020 /srv/dev-disk-by-uuid-bf5ae4c620202020 udf ro,nofail 0 2

    # <<< [openmediavault]


    If cleanup from the Web UI is not possible anymore in my situation

    Would it be safe to:


    Simply remove this from fstab:

    /dev/disk/by-uuid/bf5ae4c620202020 /srv/dev-disk-by-uuid-bf5ae4c620202020 udf ro,nofail 0 2


    And then mount -a or reboot (plus removing the correpsondingdirectory if it exists) will subsequently remove

    /srv/dev-disk-by-uuid-bf5ae4c620202020
    and also the entry n the Web GUI at Menu > Storage > File Systems ?

    Odroid HC2 - Armbian 24 Bookworm - OMV7

  • Tried to manually remove it as root via SSH without success


    Out of ideas how to get rid of that entry in the Web UI (or for real in the system if it still exists).


    Any ideas anyone?

    Odroid HC2 - Armbian 24 Bookworm - OMV7

    • Offizieller Beitrag

    Remove the mntent entry from /etc/openmediavault/config.xml (backup first).

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    And on the subject matter itself any ideas?

    I like to check in on the forum for 15secs at a time. So, I didn't read the long part.

  • Updated initial post to reflect there's only one more remaining problem, see this section:

    Problem 1: This is a "one hit" wonder for now, no automatic mounting when inserting a new disc later

    Odroid HC2 - Armbian 24 Bookworm - OMV7

    • Offizieller Beitrag

    Did you unmount the dvd before ejecting?

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Probably not.



    Independent from that: To work as a family friendly solution it would need to consist of a maximum of 5-6 human steps (numbered list items), (bulleted items are machine activities)

    1. All users be sure to disconnect any remaining "DVD" share if still connected (reasonable burden also for my non tech-savvy wife)
    2. Insert disk into optical drive
      • It mounts automatically (is a read only medium anyhow)
      • The "Share Folder" gets a signal (FS ready) automatically, if there is such a thing
      • The SMB client gets a signal (share ready) automatically, if there is such a thing
      • It can be expected to be available X seconds later
    3. X seconds later user opens share "DVD"
    4. Opens playback app (e.g. VLC) which opens path /Volumes/DVD/Video_TS/ (as the last time, the same for all DVDs, only the content differs)
    5. After playback, disconnects share "DVD" (checks that its disconnected on all clients)
      • SMB client signals to "Share Folder" no clients anymore
      • "Share folder" signals to FS, no shares access it anymore, unmount it
      • You can then press eject anytime later.
    6. or alternatively to 5: Pressing the EJECT button any time, causes the unmounting command chain in a forced manner:
      • Power down SMB share "DVD" (read only anyhow), clients get terminated (playback app has to deal with this then)
      • "Shared Folder" realizes no-more services use it, no problem if filesystem below now unmounts.
      • Filesystem "DVD" gets unmounted

    Would that be possible?

    Odroid HC2 - Armbian 24 Bookworm - OMV7

    • Offizieller Beitrag

    Why is this even a thing? What is the practical purpose?

    • Offizieller Beitrag

    Why is this even a thing? What is the practical purpose?

    You have to read point 1 of the first post :)


    AFAIK this convoluted methodology will not work, a simple understanding of how a CD presents itself to an OS, not just Linux but Windows as well, then what happens when one inserts a disc. To do what the OP requires a net search would throw up a few solutions, but the simplest would be to create an ISO rather than a rip of the DVD

  • Seems I have made myself the laughing stock with this endeavor.

    • As I have written "DVDs in general are passe, no doubt." Remaining use cases would be:
    • DVD playback via network (my kids' public library rentals ) + Doing a new DVD rip directly on the NAS

    DVD Sharing Servers

    Odroid HC2 - Armbian 24 Bookworm - OMV7

    2 Mal editiert, zuletzt von porg ()

    • Offizieller Beitrag

    Seems I have made myself the laughing stock with this endeavor

    No, but a simple question of 'can I share a dvd drive on OMV for use across the network' would have given you a response that would have been helpful rather than write a 'thesis' on what you're trying to do.


    Don't forget a lot of us have been here a long time and working on the KIS concept is a lot easier :)


    As to how to solve this, there are 2 possible options, the second being the most obvious


    1) Do a search for nbd-server, there is some information here regarding Ubuntu and the man pages from Debian


    2) Simply create an ISO from the DVD, as I don't use Linux on my desktop for Window 's, Imgburn will do the job, the ISO can still be played in it's entirety then it could be used to create an mp4 or mkv after it's been watched.

  • Ad 1) nbd-server → No NBD clients (out-of-the-box) for Windows, Mac, iOs, ChromeOS


    Ad 2) ISO solution. Sounds promising. Did I understand that correct: Whenever I insert a DVD, there's a script kicked off which images the whole DVD into path/to/DVD-share/ as <titleOfDvd-or-DatestampAsID>.ISO and that DVD-share is mounted via SAMBA.

    Neglible Con: Need to await imaging process before playback can start.

    Pro 1: VLC can playback ISO files (which contain VIDEO_TS of DVD)

    Pro 2: Gets served with the speed of my HDD. No buffering issues.

    Pro 3: If the DVD was good, I have a copy for repeated viewing. If bad I simply delete it.


    3) What about this other on-the-fly approach I found:

    Odroid HC2 - Armbian 24 Bookworm - OMV7

    • Offizieller Beitrag

    So option 2 is the most obvious,

    Did I understand that correct: Whenever I insert a DVD, there's a script kicked off which images the whole DVD into path/to/DVD-share/ as <titleOfDvd-or-DatestampAsID>.ISO and that DVD-share is mounted via SAMBA

    ?( Imgburn on windows can create an ISO of the DVD, where that ISO is saved too and the filename given to it is down to the user. I have been using Imgburn for a long time, I have never ripped DVD's just created an ISO then create/rip the mp4 or mkv from the ISO.


    As you've stated VLC can play ISO's, as to DVDfs you'd be on your own, personally that's making it way too complicated

  • If going with the ISO approach then the goal is that the DVD drive is always connected to the NAS (so that bulky ugly DVD drive + PATA-to-USB adapter + USB cable + power adapter are always there) and the ISO creation happens there automatically on disc insertion.


    The clients shall not even need to contact that legacy optical HW and all that bulky cable-salad 😉


    When a disc insertion is detected on the NAS it creates /path/to/DVD-share/disc-title.iso If that file already exists then simply add disc-title-yyyy-mm-hh_hhmm.txt which simply says "ISO of that name already existed at." (just a control mechanism). Then the clients simply sort "DVD-share" by modification date. Find the ISO of now there or else the TXT which makes clear it already exists, user needs to scroll down just until finding the corresponding same named ISO (without the timestamp).

    How to do? nbd-server creates no event when a disc is inserted as I read from its manpage. But maybe the mount point gets a newer timestamp then? So then I would only need a script monitoring changes to the mount point and when detected running the create-new-disc-image.sh with the logic as laid out in the previous paragraph. The question is whether one needs nbd-server at all. Isn't there an event each time when /dev/sr0 gets a disc insertion or ejecttion signal? Could I simply then mount, run script (which creates ISO to the DVD-share), unmount? Then I would never have ugly mntent leftovers in /etc/openmediavault/config.xml as when doing the thin in the Web UI.

    Odroid HC2 - Armbian 24 Bookworm - OMV7

    • Offizieller Beitrag

    Option 3: Present a suggestion to the library so that they update and stop using DVD's.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!