# hotplugging CDROM drive [1/2 SOLVED]

## thecooptoo

is it possible ?

I get this from dmesg when its plugged in 

```
usb-storage: *** thread sleeping.

  Vendor: ASUS      Model: SCB-2408          Rev: 1.2B

  Type:   CD-ROM                             ANSI SCSI revision: 00

Attached scsi generic sg0 at scsi1, channel 0, id 0, lun 0,  type 5

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (1:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (2:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (3:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (4:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (5:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (6:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: queuecommand called

usb-storage: *** thread awakened.

usb-storage: Bad target number (7:0)

usb-storage: scsi cmd done, result=0x40000

usb-storage: *** thread sleeping.

usb-storage: device scan complete

```

```

gravity dev #  gravity dev # ls -ls |grep sg0

0 crw-rw----  1 root root 21,  0 Aug 31 16:28 sg0

gravity dev #    

```

and it appears

but

```
gravity dev # mount -t auto /dev/sg0 /mnt/cdrom

mount: /dev/sg0 is not a block device

gravity dev # cat /etc/fstab

```

----------

## widan

Try with /dev/sr0 (or maybe /dev/scd0) instead of /dev/sg0. /dev/sg0 is a low-level interface and not the block device.

----------

## kiwi_uk

Could those errors be caused by the "Probe all LUNs" option in the kernel's SCSI config section? If so, they'd be meaningless & harmless.

Jon

----------

## thecooptoo

```
gravity paul # mount -t auto /dev/scd0 /mnt/cdrom

mount: special device /dev/scd0 does not exist

gravity paul # mount -t auto /dev/sr0 /mnt/cdrom

mount: special device /dev/sr0 does not exist

gravity paul #                               
```

----------

## widan

What happens if you create the node yourself (with "mknod /dev/scd0 b 11 0") ? Also /dev/scd0 is sometimes called /dev/scda instead.

----------

## thecooptoo

created the node 

then 

```
gravity / # ls -la /dev/sc*

brw-r--r--  1 root root 11, 0 Sep  4 21:44 /dev/scd0

gravity / # mount -t iso9660 /dev/scd0 /mnt/cdrom

mount: /dev/scd0 is not a valid block device

gravity / #                  
```

----------

## thecooptoo

created the node 

then 

```
gravity / # ls -la /dev/sc*

brw-r--r--  1 root root 11, 0 Sep  4 21:44 /dev/scd0

gravity / # mount -t iso9660 /dev/scd0 /mnt/cdrom

mount: /dev/scd0 is not a valid block device

gravity / #                  
```

ive come across this - dont know if its relevant .Currently the CDRom is the only USB storage device I have attached

```

gravity dev # cat /etc/mtab

/dev/hda3 / ext2 rw,noatime 0 0

proc /proc proc rw 0 0

sysfs /sys sysfs rw 0 0

udev /dev tmpfs rw,nosuid 0 0

devpts /dev/pts devpts rw 0 0

/dev/hda1 /boot ext2 rw,noatime 0 0

none /dev/shm tmpfs rw,noexec,nosuid,nodev 0 0

usbfs /proc/bus/usb usbfs rw,devmode=0664,devgid=85 0 0

gravity dev # 
```

googling ,ive come upon lsscsi

without it plugged in

```

gravity dev # lsscsi

gravity dev # lsusb

Bus 004 Device 001: ID 0000:0000

Bus 003 Device 002: ID 062a:0001 Creative Labs Notebook Optical Mouse

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 001: ID 0000:0000

 

```

with it plugged in 

```

gravity dev # lsscsi

[1:0:0:0]    cd/dvd  ASUS     SCB-2408         1.2B  -

gravity dev # lsscsi -lvH

[1]    usb-storage

  cmd_per_lun=1    host_busy=0    sg_tablesize=255  unchecked_isa_dma=0

  device dir: /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-2/1-2:2.0/host1

gravity dev # lsusb

Bus 004 Device 001: ID 0000:0000

Bus 003 Device 002: ID 062a:0001 Creative Labs Notebook Optical Mouse

Bus 003 Device 001: ID 0000:0000

Bus 002 Device 001: ID 0000:0000

Bus 001 Device 004: ID 2821:5001

Bus 001 Device 001: ID 0000:0000

gravity dev #  
```

so its appearing in both SCSI and USB

but how do I mount it ?

----------

## thecooptoo

still not working .Having googled a lot Ive added in 

SCSI CDROM support in the kernel

```
 │ │                 --- SCSI device support                            

  │ │                  [*]   legacy /proc/scsi/ support                       

  │ │                  ---   SCSI support type (disk, tape, CD-ROM)     

  │ │                  <*>   SCSI disk support            

  │ │                  < >   SCSI tape support     

  │ │                  < >   SCSI OnStream SC-x0 tape support     

  │ │                  <*>   SCSI CDROM support         

  │ │                  [*]     Enable vendor-specific extensions (for SCSI CDROM)  

  │ │                  <*>   SCSI generic support   

  │ │                  ---   Some SCSI devices (e.g. CD jukebox) support multiple LUNs 

  │ │                  [ ]   Probe all LUNs on each SCSI device  

  │ │                  [ ]   Verbose SCSI error reporting (kernel size +=12K) 

  │ │                  [ ]   SCSI logging facility    

  │ │                        SCSI Transport Attributes  ---> 

 
```

ive now got 

```
gravity linux # grep ^[A-Za-z0-9] .config |grep USB

CONFIG_USB_ARCH_HAS_HCD=y

CONFIG_USB_ARCH_HAS_OHCI=y

CONFIG_USB=y

CONFIG_USB_DEBUG=y

CONFIG_USB_DEVICEFS=y

CONFIG_USB_EHCI_HCD=y

CONFIG_USB_OHCI_HCD=y

CONFIG_USB_OHCI_LITTLE_ENDIAN=y

CONFIG_USB_UHCI_HCD=y

CONFIG_USB_PRINTER=y

CONFIG_USB_STORAGE=y

CONFIG_USB_STORAGE_DEBUG=y

CONFIG_USB_HID=y

CONFIG_USB_HIDINPUT=y

CONFIG_USB_EGALAX=m

CONFIG_USB_MON=y

CONFIG_USB_CYTHERM=m

CONFIG_USB_PHIDGETSERVO=m

gravity linux # grep ^[A-Za-z0-9] .config |grep SCSI

CONFIG_SCSI=y

CONFIG_SCSI_PROC_FS=y

CONFIG_SCSI_DPT_I2O=m

CONFIG_SCSI_SATA=y

CONFIG_SCSI_ATA_PIIX=y

CONFIG_SCSI_SATA_SX4=m

CONFIG_SCSI_SATA_SIS=m

CONFIG_SCSI_IPR=m

CONFIG_SCSI_QLA2XXX=y

gravity linux #            
```

but

```

gravity usb # mount -t iso9660 /dev/sg0 /mnt/cdrom

mount: /dev/sg0 is not a block device

gravity usb #                         
```

but sr0 has appeared 

```

gravity dev # mount -t iso9660 /dev/sr0 /mnt/cdrom

mount: block device /dev/sr0 is write-protected, mounting read-only

mount: wrong fs type, bad option, bad superblock on /dev/sr0,

       or too many mounted file systems

gravity dev # mount -t auto  /dev/sr0 /mnt/cdrom

mount: block device /dev/sr0 is write-protected, mounting read-only

mount: /dev/sr0: can't read superblock

gravity dev #                     
```

a bit nearer but not there yet

----------

## thecooptoo

still struggling to get this working 

Ive emerged kaffeine.

When I plug in my drive a dekstop icon for CDRecorder appears and it tries to mount media:/sr1

and then I get 

 *Quote:*   

> mount block device /dev/sr1 is write-protected, mounting read-only
> 
> mount :/dev/sr1:cant read superblock

 

with an audio CD in the drive

and a with a dvd and mplayer

 *Quote:*   

> Couldnt open DVD device :/dev/dvd

 

[code]gravity dev # ls -la |grep dvd

lrwxrwxrwx   1 root root      3 Oct  1 10:21 dvd1 -> sr1

gravity dev #

----------

## dsd

you cant mount audio cd's

----------

## thecooptoo

updating udev  has solved the DVD/CDROM problem. DVDs are now recognised and play and CDROMS are recognised from kaffeine.

The only problem is that sound doesnt work anymore 

follow a thread with this in if i cant easilyfind an answer *Quote:*   

> gravity .ssh # /etc/init.d/alsasound restart
> 
>  * Loading ALSA modules ...
> 
>  * Restoring Mixer Levels ...
> ...

 [/post]

----------

## dsd

use alsamixer to set the sound levels again

----------

