# SOLVED: sg0 not block device -missing /dev/sr0

## hollerith

I've compiled support for my hp external cdwriter into 2.6.7 kernel.  I've used it before with various other <2.6 kernels.

However, mount /dev/sg0 /mnt/cdrw says

 *Quote:*   

> 
> 
> mount: /dev/sg0 is not a block device
> 
> 

 

Usual sanity checks later... have cdburner switched on, right noises at init

cdrecord --scanbus says:

 *Quote:*   

> 
> 
> cdrecord --scanbus
> 
> Cdrecord-Clone 2.01a28 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
> ...

 

Similar message from cat /proc/scsi/scsi

ls -al /dev/sg reports

 *Quote:*   

> 
> 
> lr-xr-xr-x  1 root root 39 Jul  5 23:00 c0b0t0u0 -> ../scsi/host0/bus0/target0/lun0/generic
> 
> 

 

I don't really understand what could be amiss.

Any ideas?  Hmmmm?Last edited by hollerith on Tue Jul 06, 2004 11:36 pm; edited 1 time in total

----------

## cyrillic

 *hollerith wrote:*   

> However, mount /dev/sg0 /mnt/cdrw says
> 
>  *Quote:*   
> 
> mount: /dev/sg0 is not a block device
> ...

 

That is correct, /dev/sg0 is a character device.

The block device you are looking for is /dev/sr0.

----------

## hollerith

Excepting that 

 *Quote:*   

> 
> 
> special device /dev/sr0 does not exist
> 
> 

 

nor any of the other usual suspects either - 

ls /dev

 *Quote:*   

> 
> 
> adsp
> 
> audio
> ...

 

----------

## Baad3r

Are you using udev ?

----------

## hollerith

Sorry, I haven't a clue what udev is or how I'd know if I was.  I thought it was just a matter of compiling in support in the kernel (gentoo-dev-sources).  

Is there somewhere I can RTFM?

----------

## kibiras

It happened to me too when I forgot to compile SCSI CD-ROM support into kernel.  Check your kernel, and if it's compiled as a module, make sure it is loaded.

It should appear as /dev/sr0 which will be block device

----------

## hollerith

My config says:

 *Quote:*   

> 
> 
> #
> 
> # USB Device Class drivers
> ...

 

It was my understanding that I wouldn't need that ide-scsi emulation mularkey so I've done

 *Quote:*   

> 
> 
> #
> 
> # ATA/ATAPI/MFM/RLL support
> ...

 

I definitely have no /dev/sr0 but cdrecord can 'see' the writer.

I can't mount it but in theory I could write to it since (and this is where I got confused)

```

cdrecord /dev=sg0 .... or 

```

Isn't that right?

----------

## kibiras

 *hollerith wrote:*   

> 
> 
> It was my understanding that I wouldn't need that ide-scsi emulation mularkey so I've done
> 
> 

 

It's only MHO, but you don't need scsi-ide emulation if you have ide cd writer; for usb-storage you still need scsi cdrom, at least in order to mount it as block device.

 *hollerith wrote:*   

> 
> 
> I definitely have no /dev/sr0 but cdrecord can 'see' the writer.
> 
> I can't mount it but in theory I could write to it since (and this is where I got confused)
> ...

 

cdrecord, paranoia goes thru "raw" scsi - they send scsi commands directly to interface, so you might be able to read(paranoia)/write(cdrecord). I didn't try it though, so it's just a theory - YMMV.

BTW. for cdrecord don't you have to sepcify <host>,<target>,<lun> as device, i.e. /dev=0,0,0?

----------

## hollerith

 *kibiras wrote:*   

> 
> 
> BTW. for cdrecord don't you have to sepcify <host>,<target>,<lun> as device, i.e. /dev=0,0,0?

 

I've used both, I'm sure.  I don't understand this character device thing.  What? - is it a device that only accepts text streams?  Do I have to do a symlink or mknod something?   How do I get a /dev/sr0?  Do I need another module (other than 8200e?).  

Damn its like keystone kops meets cheech and chong here... I've just unwrapped a big spindle of CDRs and I can't tell which sides are up.  Shiny both sides.  I haven't emerged k3b yet either maybe it'll find the lost scsi device.

I tried cdrecord dev=0,0,0 blank=all to no avail.  (The dev=0,0,0 is right I'm sure).  But I tried dev=1,2,0 because

```

cdrecord dev=help

```

output

 *Quote:*   

> 
> 
> Cdrecord-Clone 2.01a28 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
> 
> Supported SCSI transports for this platform:
> ...

 

Let's burn something.

----------

## hollerith

Finally got brain in gear and it all works okay now although hp8200 needs resetting every now and again.  'blank' is not an option for a write-once CDR (Duh!).

 *kibiras wrote:*   

> It happened to me too when I forgot to compile SCSI CD-ROM support into kernel.  Check your kernel, and if it's compiled as a module, make sure it is loaded.
> 
> It should appear as /dev/sr0 which will be block device

 

No, kibiras - you're quite right.  Even though I enabled in .config

```
 

CONFIG_USB_STORAGE_HP8200e=y 

```

[bold]This is not enough[/bold].  

I need also a block device (/dev/sr0) which is had by enabling

```
 

CONFIG_BLK_DEV_SR=y

```

and since it is an HP8200e

```
 

CONFIG_BLK_DEV_SR_VENDOR=y

```

Which is what you meant.  Thanks dude.

----------

