Skip to content

Instantly share code, notes, and snippets.

@yookoala
Last active October 21, 2025 03:39
Show Gist options
  • Select an option

  • Save yookoala/818c1ff057e3d965980b7fd3bf8f77a6 to your computer and use it in GitHub Desktop.

Select an option

Save yookoala/818c1ff057e3d965980b7fd3bf8f77a6 to your computer and use it in GitHub Desktop.

Revisions

  1. yookoala revised this gist Jan 16, 2025. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -60,3 +60,16 @@ ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb"
    EOF
    ```

    ## After Installation

    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:

    1. Reload udev rules
    ```
    udevadm control --reload-rules && udevadm trigger
    ```
    2. Unplug and replug the SuperDrive

    Thing should now work.
  2. yookoala revised this gist Jan 16, 2025. No changes.
  3. yookoala revised this gist Jan 16, 2025. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion 90-mac-superdrive.rules
    Original file line number Diff line number Diff line change
    @@ -3,4 +3,4 @@
    #
    # See: https://gist.github.com/yookoala/818c1ff057e3d965980b7fd3bf8f77a6

    ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw %r/sr%n EA 00 00 00 00 00 01"
    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"
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -56,7 +56,7 @@ cat <<- EOF | sudo tee /etc/udev/rules.d/90-mac-superdrive.rules > /dev/null
    #
    # See: https://gist.github.com/yookoala/818c1ff057e3d965980b7fd3bf8f77a6
    ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw %r/sr%n EA 00 00 00 00 00 01"
    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
    ```

  4. yookoala revised this gist Jan 16, 2025. No changes.
  5. yookoala revised this gist May 9, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@ sudo apt install sg3-utils

    For Fedora / RHEL:
    ```
    sudo dnf install sg3-utils
    sudo dnf install sg3_utils
    ```

    ## Installation
  6. yookoala revised this gist Apr 7, 2022. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -33,16 +33,16 @@ Reference:

    ## Prerequsities

    Need to have [sg3_utils](https://sg.danny.cz/sg/sg3_utils.html) installed on your system.
    Need to have [sg3-utils](https://sg.danny.cz/sg/sg3_utils.html) installed on your system.

    For Ubuntu:
    ```
    sudo apt install sg3_utils
    sudo apt install sg3-utils
    ```

    For Fedora / RHEL:
    ```
    sudo dnf install sg3_utils
    sudo dnf install sg3-utils
    ```

    ## Installation
  7. yookoala revised this gist Nov 10, 2021. 2 changed files with 10 additions and 2 deletions.
    6 changes: 5 additions & 1 deletion 90-mac-superdrive.rules
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,6 @@
    # Initialise Apple SuperDrive
    #
    # 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 %r/sr%n EA 00 00 00 00 00 01"
    6 changes: 5 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -51,7 +51,11 @@ To create the file, you may use this command:

    ```bash
    cat <<- EOF | sudo tee /etc/udev/rules.d/90-mac-superdrive.rules > /dev/null
    # Initialise Apple SuperDrive
    #
    # 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 %r/sr%n EA 00 00 00 00 00 01"
    EOF
    ```
  8. yookoala revised this gist Nov 10, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Device Rule for Apple SuperDrive

    This is a udev rule file for bootstraping an [Apple SuperDrive](https://en.wikipedia.org/wiki/SuperDrive).
    This is for properly using an [Apple SuperDrive](https://en.wikipedia.org/wiki/SuperDrive) on Linux.


    ## Why?
  9. yookoala revised this gist Nov 10, 2021. 1 changed file with 19 additions and 4 deletions.
    23 changes: 19 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,21 +1,36 @@
    # Device Rule for Apple SuperDrive

    This is a udev rule file for bootstraping an [Apple SuperDrive](https://en.wikipedia.org/wiki/SuperDrive).
    Apple SuperDrive, besides proper USB connection, would needs a specific set of bytestream to bootstrap
    in order to work normally as a USB CD/DVD drive.

    When installed properly into `/etc/udev/rules.d`, the udev rule file above (90-mac-superdrive.rules) will
    be triggered to run this everytime the drive is plugged (assume the device is /dev/sr0):

    ## Why?

    Although Linux can detect a SuperDrive being plugged in, the hardware won't do anything until receiving
    a specific set of [Command Descriptor Block](https://en.wikipedia.org/wiki/SCSI_CDB) (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](https://sg.danny.cz/sg/sg3_utils.html)
    (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.


    ## What the udev rule file does?

    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](https://www.thegeekdiary.com/beginners-guide-to-udev-in-linux/), the Geek Dairy
    * [Dynamic Kernel Device Management with udev](https://documentation.suse.com/sles/12-SP4/html/SLES-all/cha-udev.html), SUSE Documentation
    * [Use Apple’s USB SuperDrive with Linux](https://cmos.blog/use-apples-usb-superdrive-with-linux/comment-page-1/), techtalk – Christian Moser


    ## Prerequsities

    Need to have [sg3_utils](https://sg.danny.cz/sg/sg3_utils.html) installed on your system.
  10. yookoala revised this gist Nov 9, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # About the Rule
    # Device Rule for Apple SuperDrive

    This is a udev rule file for bootstraping an [Apple SuperDrive](https://en.wikipedia.org/wiki/SuperDrive).
    Apple SuperDrive, besides proper USB connection, would needs a specific set of bytestream to bootstrap
  11. yookoala revised this gist Nov 9, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@ This is a udev rule file for bootstraping an [Apple SuperDrive](https://en.wikip
    Apple SuperDrive, besides proper USB connection, would needs a specific set of bytestream to bootstrap
    in order to work normally as a USB CD/DVD drive.

    When installed properly into `/etc/udev/rules.d`, [the udev rule](90-mac-superdrive.rules) will be
    triggered to run this everytime the drive is plugged (assume the device is /dev/sr0):
    When installed properly into `/etc/udev/rules.d`, the udev rule file above (90-mac-superdrive.rules) will
    be triggered to run this everytime the drive is plugged (assume the device is /dev/sr0):

    ```
    /usr/bin/sg_raw /dev/sr0 EA 00 00 00 00 00 01
  12. yookoala revised this gist Nov 9, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@ This is a udev rule file for bootstraping an [Apple SuperDrive](https://en.wikip
    Apple SuperDrive, besides proper USB connection, would needs a specific set of bytestream to bootstrap
    in order to work normally as a USB CD/DVD drive.

    When installed properly into `/etc/udev/rules.d`, the udev rule will be triggered to run this everytime
    the drive is plugged (assume the device is /dev/sr0):
    When installed properly into `/etc/udev/rules.d`, [the udev rule](90-mac-superdrive.rules) will be
    triggered to run this everytime the drive is plugged (assume the device is /dev/sr0):

    ```
    /usr/bin/sg_raw /dev/sr0 EA 00 00 00 00 00 01
  13. yookoala created this gist Nov 9, 2021.
    2 changes: 2 additions & 0 deletions 90-mac-superdrive.rules
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    # Initialise Apple SuperDrive
    ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw %r/sr%n EA 00 00 00 00 00 01"
    43 changes: 43 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    # About the Rule

    This is a udev rule file for bootstraping an [Apple SuperDrive](https://en.wikipedia.org/wiki/SuperDrive).
    Apple SuperDrive, besides proper USB connection, would needs a specific set of bytestream to bootstrap
    in order to work normally as a USB CD/DVD drive.

    When installed properly into `/etc/udev/rules.d`, the udev rule will be triggered to run this everytime
    the drive is plugged (assume the device is /dev/sr0):

    ```
    /usr/bin/sg_raw /dev/sr0 EA 00 00 00 00 00 01
    ```

    Reference:
    * [Beginners Guide to Udev in Linux](https://www.thegeekdiary.com/beginners-guide-to-udev-in-linux/), the Geek Dairy
    * [Dynamic Kernel Device Management with udev](https://documentation.suse.com/sles/12-SP4/html/SLES-all/cha-udev.html), SUSE Documentation
    * [Use Apple’s USB SuperDrive with Linux](https://cmos.blog/use-apples-usb-superdrive-with-linux/comment-page-1/), techtalk – Christian Moser

    ## Prerequsities

    Need to have [sg3_utils](https://sg.danny.cz/sg/sg3_utils.html) installed on your system.

    For Ubuntu:
    ```
    sudo apt install sg3_utils
    ```

    For Fedora / RHEL:
    ```
    sudo dnf install sg3_utils
    ```

    ## Installation

    To create the file, you may use this command:

    ```bash
    cat <<- EOF | sudo tee /etc/udev/rules.d/90-mac-superdrive.rules > /dev/null
    # Initialise Apple SuperDrive
    ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw %r/sr%n EA 00 00 00 00 00 01"
    EOF
    ```