# /dev/scd0 vs /dev/sg0

## incripshin

I was wondering what the difference between /dev/scd0 and /dev/sg0 was.  Here's the background that led me to this question (and hopefully help people with the same problem):

edit I found in linux/Documentation/devices.txt that srX is deprecated in favor of scdX (SCSI CD-ROM), and sgX means (Generic SCSI).  Still, I don't know why cdrecord isn't working with sgX.

cdrecord at the command line was failing me, though k3b worked.  It turned out that cdrecord was using /dev/sg0.  My -scanbus output:

```
Cdrecord-ProDVD-ProBD-Clone 2.01.01a57 (x86_64-unknown-linux-gnu) Copyright (C) 1995-2009 Jörg Schilling

Linux sg driver version: 3.5.34

Using libscg version 'schily-0.9'.

scsibus1:

   1,0,0   100) 'HL-DT-ST' 'BDDVDRW GGC-H20L' '1.03' Removable CD-ROM

   1,1,0   101) *

   1,2,0   102) *

   1,3,0   103) *

   1,4,0   104) *

   1,5,0   105) *

   1,6,0   106) *

   1,7,0   107) *

scsibus3:

   3,0,0   300) 'ATA     ' 'Hitachi HDP72505' 'GM4O' Disk

   3,1,0   301) *

   3,2,0   302) *

   3,3,0   303) *

   3,4,0   304) *

   3,5,0   305) *

   3,6,0   306) *

   3,7,0   307) *

scsibus6:

   6,0,0   600) 'Generic ' 'STORAGE DEVICE-A' '9727' Removable Disk

   6,1,0   601) *

   6,2,0   602) *

   6,3,0   603) *

   6,4,0   604) *

   6,5,0   605) *

   6,6,0   606) *

   6,7,0   607) *
```

So I would write cdrecord dev=1,0,0 -dummy -v blah.iso, which an strace shows is using /dev/sg0.  Here are the errors cdrecord spits out:

```
Track 01:    0 of  591 MB written.cdrecord: Input/output error. write_g1: scsi sendcmd: no error

CDB:  2A 00 00 00 00 00 00 00 1F 00

status: 0x2 (CHECK CONDITION)

Sense Bytes: 70 00 05 00 00 00 00 0A 2A 00 00 80 30 05 00 00

Sense Key: 0x5 Illegal Request, Segment 0

Sense Code: 0x30 Qual 0x05 (cannot write medium - incompatible format) Fru 0x0

Sense flags: Blk 0 (not valid) 

cmd finished after 0.002s timeout 200s

write track data: error after 0 bytes

cdrecord: A write error occured.

cdrecord: Please properly read the error message above.

Writing  time:   23.799s

Average write speed 170.0x.

Fixating...

WARNING: Some drives don't like fixation in dummy mode.

Fixating time:    0.005s

cdrecord: fifo had 64 puts and 1 gets.

cdrecord: fifo was 0 times empty and 0 times full, min fill was 100%.
```

Ultimately, using cdrecord dev=/dev/scd0 -dummy -v blah.iso works.

edit switched to scdX and added note aboveLast edited by incripshin on Fri Nov 27, 2009 8:20 pm; edited 1 time in total

----------

## d2_racing

You can try that :

```

# udevadm info --query=all --path=/sys/block/sr0

```

----------

## d2_racing

Udevadm is a great tool to learn a lot of stuff about Udev. I use the output of Udevadm to create some custom rules for my DVD player or my USB key.

----------

## incripshin

When I first edited my post, I tried to replace all occurrences of sr0 with scd0, but I accidentally replaced sg0 with scd0 instead.  As such, my post made no sense at all.  Sigh.  I'll try checking out udevadm when I get home, though.  I suppose this is a better question for a cdrtools mailing list anyway.

----------

