This is for properly using an Apple SuperDrive on Linux.
Although Linux can detect a SuperDrive being plugged in, the hardware won't do anything until receiving a specific set of Command Descriptor Block (CDB) through USB. If not, you cannot put disc in or take disc out even when the drive was connected correctly.
To use SuperDrive on Linux you can use Linux's SCSI Utilities (sg3_utils) to manually send the CDBs like this:
/usr/bin/sg_raw /dev/sr0 EA 00 00 00 00 00 01
But to do this manually everytime is simply a stupid task not to automate.
When installed properly into /etc/udev/rules.d
, the udev rule file above (90-mac-superdrive.rules) will
be triggered the sending of CDBs everytime the drive is plugged. It will even detect the correct device
number if multiples are plugged.
Reference:
- Beginners Guide to Udev in Linux, the Geek Dairy
- Dynamic Kernel Device Management with udev, SUSE Documentation
- Use Apple’s USB SuperDrive with Linux, techtalk – Christian Moser
Need to have sg3-utils installed on your system.
For Ubuntu:
sudo apt install sg3-utils
For Fedora / RHEL:
sudo dnf install sg3_utils
To create the file, you may use this command:
cat <<- EOF | sudo tee /etc/udev/rules.d/90-mac-superdrive.rules > /dev/null
#
# Apple SuperDrive initialization rule
#
# See: https://gist.github.com/yookoala/818c1ff057e3d965980b7fd3bf8f77a6
ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw --cmdset=1 %r/sr%n EA 00 00 00 00 00 01"
EOF
Things won't immediately work after the above setup. You'll need to reload the udev rules and replug the SuperDrive. And the simplest way to do both is to, well, reboot.
But if you want to be a cool user, then you may follow these steps without reboot:
- Reload udev rules
udevadm control --reload-rules && udevadm trigger
- Unplug and replug the SuperDrive
Thing should now work.
Thanks you, helped a lot 👍