LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Changed CDROM to CDRW, Debian can't mount it (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/changed-cdrom-to-cdrw-debian-cant-mount-it-228713/)

bcalder01 09-09-2004 05:04 PM

Changed CDROM to CDRW, Debian can't mount it
 
Hi all,
I have a Gateway Solo Pro 9300 happily running a dual boot XP-Debian Sarge/kernel 2.4.24 install. I recently replaced the stock CD-ROM with an older Matsushita UJD-A310 CDRW, which works fine in XP. I recompiled the kernel for SCSI emulation, but I'm not doing something right, cause I can't mount the dang thing. Running sg3-util gives me the following:

*****************************************************
root# sg_scan
/dev/sg0: scsi0 channel=0 id=0 lun=0 [em] type=5

root# sg_inq /dev/sg0
standard INQUIRY:
PQual=0, Device_type=5, RMB=1, ANSI version=0, [full version=0x00]
AERC=0, TrmTsk=0, NormACA=1, HiSUP=0, Resp data format=1, SCCS=0
BQue=0, EncServ=0, MultiP=0, MChngr=0, ACKREQQ=0, Addr16=0
RelAdr=0, WBus16=0, Sync=0, Linked=0, TranDis=0, CmdQue=0
Clocking=0x0, QAS=0, IUS=0
length=96 (0x60) Peripheral device type: cd/dvd
Vendor identification: MATSHITA
Product identification: UJDA310
Product revision level: 1.37

*****************************************************

... so I know it's seen by the OS. When I try to mount /dev/sg0, I get the error that it's not a block device (not even "not a VALID block device"). I've tried symlinking to it, tried /dev/scdx, /dev/srx, everything I can think of. When I run the Knoppix CD to see where it mounts the drive (a GREAT troubleshooter, BTW!), it's mounting it at /dev/scd0.

I'm tapped ... anybody got any other ideas?? TIA!!

hw-tph 09-10-2004 07:15 AM

It's most likely known as /dev/scd0 if you're using SCSI emulation. cdparanoia is often helpful when determining what an optic drive is called - pop in an audio CD (you don't really need to but it can help) and type cdparanoia -vsQ. You're likely to get output like this:
Code:

Checking /dev/sg0 for cdrom...
        Testing /dev/sg0 for cooked ioctl() interface
                /dev/sg0 is not a cooked ioctl CDROM.
        Testing /dev/sg0 for SCSI interface
                generic device: /dev/sg0
                ioctl device: /dev/scd0

/dev/sg0 is the generic SCSI device, but the drive itself can be accessed as /dev/scd0. This is what the first SCSI-emulated drive almost always is called.


Håkan

bcalder01 09-11-2004 03:28 AM

Hi Håkan, many thanks for the fast reply. Here's the output of my cdparanoia query:
**************************************************************
bcalder$ cdparanoia -vsQ
cdparanoia III release 9.8 (March 23, 2001)
(C) 2001 Monty <monty@xiph.org> and Xiphophorus

Report bugs to paranoia@xiph.org
http://www.xiph.org/paranoia/

Checking /dev/cdrom for cdrom...
Testing /dev/cdrom for cooked ioctl() interface
/dev/sg0 is not a cooked ioctl CDROM.
Testing /dev/cdrom for SCSI interface
No cdrom device found to match generic device /dev/sg0
generic device: /dev/sg0
ioctl device: not found

Found an accessible SCSI CDROM drive.
Looking at revision of the SG interface in use...
SG interface version 3.1.25; OK.

CDROM model sensed sensed: MATSHITA UJDA310 1.37

Checking for SCSI emulation...
Drive is ATAPI (using SCSI host adaptor emulation)

Checking for MMC style command set...
Drive is MMC style
DMA scatter/gather table entries: 256
table entry size: 32768 bytes
maximum theoretical transfer: 3566 sectors
Setting default read size to 13 sectors (30576 bytes).
**************************************************************

... the generic device is sg0. In /dev, I symlinked cdrom to sg0. Perms on /dev/cdrom and /dev/sg0 are:

==============================================
lrwxrwxrwx 1 root root 8 Sep 11 10:20 /dev/cdrom -> /dev/sg0

crw-rw-rw- 1 root root 21, 0 Aug 24 2001 /dev/sg0
==============================================

What am I missing?

bcalder01 09-11-2004 03:29 AM

Hi Håkan, many thanks for the fast reply. Here's the output of my cdparanoia query:
**************************************************************
bcalder$ cdparanoia -vsQ
cdparanoia III release 9.8 (March 23, 2001)
(C) 2001 Monty <monty@xiph.org> and Xiphophorus

Report bugs to paranoia@xiph.org
http://www.xiph.org/paranoia/

Checking /dev/cdrom for cdrom...
Testing /dev/cdrom for cooked ioctl() interface
/dev/sg0 is not a cooked ioctl CDROM.
Testing /dev/cdrom for SCSI interface
No cdrom device found to match generic device /dev/sg0
generic device: /dev/sg0
ioctl device: not found

Found an accessible SCSI CDROM drive.
Looking at revision of the SG interface in use...
SG interface version 3.1.25; OK.

CDROM model sensed sensed: MATSHITA UJDA310 1.37

Checking for SCSI emulation...
Drive is ATAPI (using SCSI host adaptor emulation)

Checking for MMC style command set...
Drive is MMC style
DMA scatter/gather table entries: 256
table entry size: 32768 bytes
maximum theoretical transfer: 3566 sectors
Setting default read size to 13 sectors (30576 bytes).
**************************************************************

... the generic device is sg0. In /dev, I symlinked cdrom to sg0. Perms on /dev/cdrom and /dev/sg0 are:

==============================================
lrwxrwxrwx 1 root root 8 Sep 11 10:20 /dev/cdrom -> /dev/sg0

crw-rw-rw- 1 root root 21, 0 Aug 24 2001 /dev/sg0
==============================================

What am I missing? It SEEMS like it's rejecting /dev/sg0, then finding the CDROM after all.

hw-tph 09-11-2004 10:26 AM

Where it says:
Code:

generic device: /dev/sg0
ioctl device: not found

...you should instead find something like this:
Code:

generic device: /dev/sg0
ioctl device: /dev/scd0

...if everything was working as expected. Do you have the ide-scsi module loaded? Use modprobe ide-scsi to load it if you don't.


Håkan

bcalder01 09-11-2004 02:49 PM

Yes I do, sorry for not mentioning it previously. I initially had it compiled in the kernel, it was the first thing I changed when I realized it wasn't working. I have to insmod ide-scsi manually, but when I do, it recognizes the drive:

root:# insmod ide-scsi
Sep 11 09:32:21 gwlap kernel: hdd: attached ide-scsi driver.
Sep 11 09:32:21 gwlap kernel: scsi0 : SCSI host adapter emulation for IDE ATAPI devices
Sep 11 09:32:21 gwlap kernel: Vendor: MATSHITA Model: UJDA310 Rev: 1.37
Sep 11 09:32:21 gwlap kernel: Type: CD-ROM ANSI SCSI revision: 02

... but then when I run "cdparanoia -vsQ", I get the same error, that the ioctl device is not found.

hw-tph 09-11-2004 04:24 PM

Hmmm. Do you have SCSI CD-ROM support in your kernel? If it is compiled as a module it is called sr_mod. IIRC it would be autoloaded by ide-scsi though, at least if you pass hdc=ide-scsi (or whatever the IDE device name is) to the kernel at boot-time.


Håkan

bcalder01 09-11-2004 05:40 PM

No, I thought all I needed was SCSI generic support. I'll compile it in ... or should I do it as a module??

bcalder01 09-12-2004 02:44 PM

I recompiled with SCSI-CDROM support and that did it - who knew?? I still have to manually insmod ide-scsi, but now the output of cdparanoia is:

Checking /dev/cdrom for cdrom...
Testing /dev/cdrom for cooked ioctl() interface
/dev/scd0 is not a cooked ioctl CDROM.
Testing /dev/cdrom for SCSI interface
generic device: /dev/sg0
ioctl device: /dev/scd0

Well, everything else is telling me it's /dev/sr0, I had an existing symlink from sr0 to scd0 that I'll leave be for now. Other fires need putting out (not all of them Linux related!!).

Thanks a million for the help!!!!

Bruce

hw-tph 09-12-2004 03:33 PM

Add "ide-scsi" (without the quotes) on a line on its own to /etc/modules and it will be autoloaded on startup and that should be it really. You could also symlink create a symlink called /dev/cdrom pointing to /dev/scd0 and most programs should pick it up without effort.


Håkan


All times are GMT -5. The time now is 12:35 PM.