How can I find what /dev my DVD-drive is?

31

10

I'm on Mac OS X, have a DVD in the DVD-drive and can look at it in the Finder. I'd like to try to create an iso of it by using the dd command. But to do that I need to know what device to use as an input. How can I find what device my DVD-drive is?

Svish

Posted 2010-02-28T11:19:27.727

Reputation: 27 731

Answers

35

Put a disk into the drive, wait until OS X mounts it, and then type the following command in the Terminal:

$ mount
[⋮]
/dev/disk2 on /Volumes/MyDisk (cd9660, local, nodev, nosuid, read-only, noowners)

In my case, the drive is located at /dev/disk2.

You can use drutil as well.

# drutil status
 Vendor   Product           Rev 
 MATSHITA DVD-R   UJ-857D   KBVB

           Type: DVD+RW               Name: /dev/disk2
[⋮]

viam0Zah

Posted 2010-02-28T11:19:27.727

Reputation: 1 909

what are the chances for me to find you here! :D – Zhe Li – 2015-06-21T19:41:48.383

9

Finally found a way. Not sure if it is the best, but it works anyways:

df -h

c",)

Svish

Posted 2010-02-28T11:19:27.727

Reputation: 27 731

It's also a working solution, since df displaying the free disk space on mounted file systems showing their device name as well. – viam0Zah – 2010-02-28T14:03:31.117

Yeah, that's what I suddenly discovered. My first thinking was that I could try to match it up with the size, but then discovered that it stood right there which was which :p – Svish – 2010-02-28T15:10:14.487

3

Start Utilites, Disk Util. Click the drive or partition on the left, then the blue i/info icon in the toolbar. The disk identifier is the name to be used after /dev/

Nicholaz

Posted 2010-02-28T11:19:27.727

Reputation: 1 479

For me, the disk identifier is the volume label (MyDisk), which is the same as the mount point under /mnt, and not the device name under /dev, which is /dev/disk2. – viam0Zah – 2010-02-28T14:01:25.847

+1 because it solved my problem, which was trying to eject a DVD I'd unmounted. – David Moles – 2012-07-03T14:15:50.150

this is the best answer because in my case I can't mount my device. – Felipe – 2013-02-18T21:50:20.340

2

Just embodied the diskutil incantation and awk in a script to recite CD device names:

May be handy for future reuse; I'm about to use it in my CD ripping kit.

Code:

#!/bin/sh
#
# Scan the output of diskutil and report the CD devices.
#   - Cameron Simpson <cs@zip.com.au> 31mar2016
#

set -ue

diskutil list \
| awk '/^\// { device=$1 }
       $1 == "0:" && $2 == "CD_partition_scheme" { print device }
      '

Source code: https://bitbucket.org/cameron_simpson/css/src/tip/bin/osx-cd-device

Cameron Simpson

Posted 2010-02-28T11:19:27.727

Reputation: 21

1

You can find the path of a disk using a built-in tool on macOS.

  1. Go into Disk Utility.
  2. Select your drive by its name, such as DUAL BOOT in my case.
  3. Open the info panel by its shortcut, right-clicking the disk in the list, or as the picture shows.

Info button

  1. Locate the row named 'BSD device node'.

'Get Info' with /dev/ info

The path will be /dev/disk2s1, based on the value of that row.

haykam

Posted 2010-02-28T11:19:27.727

Reputation: 115

Device is listed on the first window, no need to press Info – Matt Sephton – 2018-10-11T13:51:10.037

1

thankfully, OS X has several options. in System Profiler, choose Serial-ATA, then in the device tree frame choose your device. it shows up as BSD Name.

df is fine but it displays with the partition (volume mounted as) info, rather than the device itself. e.g. a drive shows up as /dev/disk0s2 where the device itself is disk0; s2 is the volume mounted on / ..for most applications this is usable

diskutil list displays all devices and partitions

Moda

Posted 2010-02-28T11:19:27.727

Reputation: 126

0

You can check for devices which have no free space on them (will be the case with burned CDs / DVDs):

df -h | grep Volumes | grep "100%" | rev | cut -d '/' -f1 | rev

adam

Posted 2010-02-28T11:19:27.727

Reputation: 1