1

I'm wondering if we can connect an external USB DVD drive to Raspberry Pi and share it across the network which can be accessed from a Mac and Win machines. Please share you thoughts on this.

Karthik
  • 11
  • 1
  • 2

3 Answers3

1

It can indeed be done you just need to pick a Protocol.

a. Windows normally uses SMB (Samba on Linux). In my experience there are many issues with establishing and maintaining connection. This is supported by Windows, Linux and OS X.

b. OS X natively uses afp (Apple Filing Protocol) which provides excellent support on the Mac, enabling you to mount RPi files in Finder. You need to install netatalk on the Pi to enable this (which also provides zeroconf discovery). There is limited support on Windows.

If you need both Windows and Mac access you can run both Samba and netatalk.

Milliways
  • 62,573
  • 32
  • 113
  • 225
0

Not what OP is about, but a somewhat similar scenario: if your client is a GNU/Linux distro you can use Network Block Device protocol to export block device of your DVD drive via network.

Here's how I made it work on my Raspberry Pi 3B+ and Fedora 31 laptop.

Server side

(In my case, Raspberry Pi 3B+ with Raspbian 10.3)

Install & enable nbd-server:

apt install nbd-server
systemctl enable nbd-server

In main config file I had to change group to cdrom so that nbd-server can access the drive device. This is almost certainly not correct way but it worked.

[generic]
    user = nbd
    group = cdrom
    includedir = /etc/nbd-server/conf.d

In /etc/nbd-server/conf.d/zasus.config:

[zasus]
    exportname = /dev/sr0
    readonly = true

zasus is a made-up name, and will serve as export name that client will ask for.

Client side

(In my case, Fedora 31)

Install and enable client & kernel module:

sudo dnf -y install nbd-client
sudo modprobe nbd

This should create bunch of new files in /dev, named nbd0-... The group is disk.

I decided to use nbd11 for this setup, so in my /etc/nbdtab:

nbd11 my.raspberry.hostname zasus

To connect the device:

sudo nbd-client nbd11

To set up access permissions, I've changed group of the device to one that my main user was in:

sudo chgrp netvorovo /dev/nbd11

Notes

Permission setup is kinda silly and inflexible on both sides; it worked for me though. If someone knows better, feel free to update this answer.

Make sure your Pi has enough power to run the DVD drive and whatever other devices you have connected. (Or just disconnect all other devices if you can.)

Alois Mahdal
  • 101
  • 2
0

Just use python -m SimpleHTTPServer [port] in the mountpoint. It will be faster than SMB/CIFS or AFP, and you don't need RW access.

user2497
  • 681
  • 5
  • 8