LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   /dev/cdrom invalid block device. (https://www.linuxquestions.org/questions/debian-26/dev-cdrom-invalid-block-device-133632/)

legin 01-11-2004 06:15 AM

/dev/cdrom invalid block device.
 
Last night I tried several times to install Debian (Woody) on a couple of spare partitions.
All went well until just after the reboot. When it came to the time to install packages from the cd it wouldn't find the cd. I kept getting the message "/dev/cdrom is not a valid block device. I tried again with the 2.2 kernel and with the 2.4 kernel with the same result.
Has anyone any ideas?

Thanks in advance legin

scott_R 01-11-2004 06:19 AM

I had this, still don't know why, but when I'd type /dev/cdrom, I got nothing. /dev/cdrom0, however, worked just fine... :(

Hope it helps.

whansard 01-11-2004 06:53 AM

if the cdrom is loaded with ide-scsi, it would be /dev/scd0 instead of
/dev/cdrom.

if you run cdrecord --scanbus
at the terminal and your cdrom drive shows up there, that's what it is.

320mb 01-11-2004 10:16 AM

should'nt /dev/cdrom be a symlink to a block device??
mine goes to /dev/hdc

whansard 01-11-2004 10:22 AM

Quote:

Originally posted by 320mb
should'nt /dev/cdrom be a symlink to a block device??
mine goes to /dev/hdc


for instance if /dev/cdrom was symlinked to /dev/hdc, a cdrom or cdrw
drive, and was setup that way, then ide-scsi was used during boot,
so the drive could be used as a cdwriter, /dev/hdc and thus /dev/cdrom
would no longer be a valid block device.

that's my guess anyway.

bcalder01 03-12-2004 05:32 AM

I have to reopen this thread, since I'm having the same trouble on my unstable (knoppix 3.2 installed to HD) system. I've tried kernel 2.4.22, 2.4.24 & 2.6 (as well as the suggestions in this thread), to no avail. Here's the relevant output from dmesg, it looks like /dev/sd0 should be valid, right?

=========================================
hdd: CD-224E, ATAPI CD/DVD-ROM drive
ide-cd: passing drive hdd to ide-scsi emulation.
hdd: attached ide-scsi driver.
SCSI subsystem driver Revision: 1.00
scsi0 : SCSI host adapter emulation for IDE ATAPI devices
Vendor: TEAC Model: CD-224E Rev: K.0B
Type: CD-ROM ANSI SCSI revision: 02
=========================================

Any & all suggestions would be appreciated!!

bcalder01 03-12-2004 07:11 AM

OK, I booted my trusty, crusty old kernel via floppy & the cdrom attached fine. Here's dmesg from that boot:

========================================
Mar 12 12:54:06 gwlap kernel: SCSI subsystem driver Revision: 1.00
Mar 12 12:54:06 gwlap kernel: scsi0 : SCSI host adapter emulation for IDE ATAPI devices
Mar 12 12:54:06 gwlap kernel: Vendor: TEAC Model: CD-224E Rev: K.0B
Mar 12 12:54:06 gwlap kernel: Type: CD-ROM ANSI SCSI revision: 02
Mar 12 12:54:06 gwlap kernel: Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0
Mar 12 12:54:06 gwlap kernel: sr0: scsi3-mmc drive: 24x/24x xa/form2 cdda tray
Mar 12 12:54:06 gwlap kernel: Uniform CD-ROM driver Revision: 3.12
========================================

Looks like what's missing in the first instance is the last three lines. sr0 is symlinked to sda1 in /dev.

??????

whansard 03-12-2004 07:56 AM

sda1 is a scsi hard drive

on my machine /dev/scd0 is the first scsi emulated hard drive.

see if any drives show up under
cdrecord --scanbus
as root

the 2 modules that need to be loaded are ide-scsi and sg

if cdrecord sees the drives, the modules are loaded.

bcalder01 03-12-2004 09:56 AM

I'll apt-get cdrecord, but I know ide-scsi is loading, from reading dmesg, so I guess sg is not. Is there a way to make sg load, or to build/install it??

johnMG 03-12-2004 01:55 PM

Run modconf as root to get those modules to load.

bcalder01 03-12-2004 05:23 PM

OK, I apt-getted cdrecord & here's the output of --scanbus:

========================================================
Linux sg driver version: 3.1.25
Using libscg version 'schily-0.8'.
scsibus0:
0,0,0 0) 'TEAC ' 'CD-224E ' 'K.0B' Removable CD-ROM
========================================================

So both of the necessary modules are loaded. What is this telling me that my cdrom drive is? in /dev, cdrom is a symlink to /dev/scd0. sr0 is a symlink to scd0 (not /dev/scd0).

Thanks for all the prompt responses.

whansard 03-12-2004 08:59 PM

what are you trying to do that's not working.
i thought you were trying to burn a cd.

having the symlink correct is for cd players and rippers mostly.

having the ide-scsi and sg are for cdrecord.

if you have your boot loader ignore the cdrom drive, so you can set it
up as ide-scsi for cdrecord, and it doesn't get set up right, you can't
do anything with the drive.

it looks like you are set up properly for both.

bcalder01 03-13-2004 04:32 AM

I'm just trying to get my cd player to show up properly. It's not a burner, but cdreord was useful to know if the system would see it.

I'm stumped ... it is set up in fstab, on boot it's getting passed to the ide-scsi driver, sg is being utilized, but I keep getting the "not a valid block device" error. I've compiled my kernel with SCSI & SCSI generic support, I've tried using /dev/sda1, /dev/scd0, /dev/sr0. The only way I can get it to show up is to boot my original kernel, Knoppix installed to the hard disc.

whansard 03-13-2004 05:44 AM

you can try mounting a data disk as various devices to see what is up with the disk.

mkdir /mnt/cdrom
mount /dev/scd0 /mnt/cdrom
mount /dev/hdc /mnt/cdrom
mount /dev/hdd /mnt/cdrom

bcalder01 03-15-2004 08:18 AM

* Tried those, still no joy.

root@gwlap:/# mount -t iso9660 /dev/hdd /cdrom
mount: wrong fs type, bad option, bad superblock on /dev/hdd,
or too many mounted file systems
(could this be the IDE device where you in fact use
ide-scsi so that sr0 or sda or so is needed?)

root@gwlap:/# mount -t iso9660 /dev/sr0 /cdrom
mount: /dev/sr0 is not a valid block device

root@gwlap:/# mount -t iso9660 /dev/sda /cdrom
mount: /dev/sda is not a valid block device

root@gwlap:/# mount -t iso9660 /dev/so /cdrom
mount: special device /dev/so does not exist

* I recompiled my 2.4.22 kernel without SCSI emulation, now HDD is being picked up by ide-cdrom.

Mar 14 10:17:23 gwlap kernel: Kernel command line: BOOT_IMAGE=2.4.22 ro root=306 hda=scsi hdb=scsi hdc=scsi hde=scsi apm=power-off nomce
Mar 14 10:17:23 gwlap kernel: ide_setup: hda=scsi
Mar 14 10:17:23 gwlap kernel: ide_setup: hdb=scsi
Mar 14 10:17:23 gwlap kernel: ide_setup: hdc=scsi
Mar 14 10:17:23 gwlap kernel: ide_setup: hde=scsi
Mar 14 10:17:23 gwlap kernel: hdd: attached ide-cdrom driver.
Mar 14 10:17:23 gwlap kernel: hdd: ATAPI 24X CD-ROM drive, 128kB Cache, DMA
Mar 14 10:17:23 gwlap kernel: Uniform CD-ROM driver Revision: 3.12

* But I don't know how or where to mount it!!

mount -t iso9660 /dev/hdd /cdrom
hdd:communication error: status=0x51 <<<<<<PANIC!!>>>>>>>

This may have been an audio CD, but I assume I need to change fstab to /dev/hdd /cdrom, correct??


All times are GMT -5. The time now is 07:19 AM.