# IDE-SCSI mounting CD-ROM

## bhogg

Hi all,

I might be able to stumble upon the solution after numerous kernel compiles and configuration changes, but hopefully someone can point me in the right direction from the start.

I'm trying to get my laptop CD-Rom drive (on an ASUS M5N) to work.  It's fine with the liveCD (obviously), but can't be mounted.  Before I started trying to get it to work, I got a "wrong fs, bad ..., bad superblock..." error when trying to mount.  Now I'm getting a "mount: no medium found" when trying to mount.  The /dev/ location keeps changing depending on what's been changed in my attempts.

I can get the CD-ROM (DVD/CD-RW) recognized by cdrecord -scanbus, though.  At this point I can probably burn a CD, just not read the contents of it.  If someone could let me know what I should be checking, and symlinks I should be creating (some googling shows some people doing symlinks to /dev/sc0 and things start working magically)... it would be much appreciated.  If you'd like the output of any commands (dmesg, etc) I can do that...

Thanks,

Brian

----------

## jdgill0

For IDE-SCSI support of your CD/DVD burner, you need four things:

1) hdx=ide-scsi  kernel option in grub.conf

2) SCSI CDROM support ... under scsi

3) SCSI generic support .... under scsi

4) SCSI emulation support .... under ATA/ATAPI/MFM/RLL

I always make these modules, then add the following to your /etc/modules.autoload.d/kernel-2.X file:

ide-scsi

sg

sr_mod

----------

## bhogg

How can I find out what "x" is in hdx?  I assumed hdc, but with that and all the other options you were mentioning, I still can't mount the drive to /mnt/gentoo (though I'm not sure if the /dev reference changed with the "no medium found" error.. with both /dev/cdrom and /dev/cdroms/cdrom0).  I'm also not able to find any mention in dmesg or lspci of the drive, though I recall a IDE/ACAPI (or close) message when using the liveCD.

I'm not so much concerned with getting the drive to burn, but rather getting it mounted...

Thanks,

Brian

----------

## jdgill0

The "x" in hdx would be what you would get should your cdrom drive be a hard drive.

For example:

I have 1 hard drive and the cdrom .. where the cdrom is slave to the hard drive:

Hard drive = hda

cdrom = hdb

Suppose I have two drives and cdrom, where the drives are master/slave and cdrom is master on second ide port:

hard drive 1 = hda

hard drive 2 = hdb

cdrom = hdc

You can use the cd burner as a normal cdrom without the scsi emulation (in fact scsi emulation is not strictly required for burners now ... but as i have said elsewhere in the forums, i get best results with my burner under scsi emulation)

So for NO scsi-emulation you only need cdrom enabled in kernel, none of the scsi stuff.

As for /mnt/gentoo ... you are a bit fuzzy on what you are doing ... but i'll assume you are trying to mount the livecd under a WORKING gentoo install? ... if so, do you have the mount point /mnt/gentoo created, i.e. does the folder /mnt/gentoo exists?  ... if you are booting with the livecd and trying to mount the cdrom you booted with, this is a different story ... as you are trying to mount something that is already being used! ... /mnt/gentoo is used within the install docs to give you a place to mount your hard drives for installing gentoo on them.

----------

## bhogg

I think I had a typo in a previous post.

I'm trying to mount the CD-ROM from my laptop, so the master/slave relationship isn't evident.  I tried running eject /dev/hdx with x from b-h, and all were not found.  With SCSI options enabled, I've at least got cdrecord -scanbus to see the drive, but I'm unable to mount to /mnt/cdrom (no medium found error).

Any questions I've made unclear please let me know...

----------

## jdgill0

Sorry .... i should have told you to look at dmesg ... you can run this as root or as a user, it will dump the kernel messages to the console ... look for lines like the following:

```
hda: Maxtor 6Y060L0, ATA DISK drive

hdb: WDC WD2000JB-00FUA0, ATA DISK drive

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

hdc: FX240S, ATAPI CD/DVD-ROM drive

ide1 at 0x170-0x177,0x376 on irq 15

hda: max request size: 128KiB

hda: 120103200 sectors (61492 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(100)

 /dev/ide/host0/bus0/target0/lun0: p1 p2 p3

hdb: max request size: 1024KiB

hdb: 390721968 sectors (200049 MB) w/8192KiB Cache, CHS=24321/255/63, UDMA(100)

 /dev/ide/host0/bus0/target1/lun0: p1 p2

hdc: ATAPI 24X CD-ROM drive, 256kB Cache, DMA
```

Notice the last line is the cdrom in this case.

----------

## bhogg

I scanned dmesg earlier (dmesg | grep -i hd) and only get references to the root partition and the SWAP partition (hd6/hd2).  Every time I've made a change I've scanned dmesg to try and find a reference to the CD-ROM, with no luck... but cdrecord sees it.

----------

## jdgill0

Could you post the output from cdrecord -scanbus and cdrecord -scanbus dev=ATAPI?

----------

## bhogg

I'm typing this in (no internet connection on the laptop at the moment), so there may be minor discrepencies:

```

# cdrecord -scanbus

Cdrecord-Clone 2.01a28 (i686-pc-linux-gnu) Copyright (C) 1995-2004 ...

Linux sg driver version: 3.5.31

Using libscg version 'schily-0.8'

scsibus0:

   0,0,0   0) 'MATSHITA' 'UJDA755 DVD/CDRW' '1.00' Removable CD-ROM

   0,1,0   1) *

...

```

```

# cdrecord -scanbus dev=ATAPI

...

scsidev: 'ATAPI'

devname: 'ATAPI'

scsibus: -2 target: -2 lun: -2

Warning: Using ATA Packet interface.

Warning: The related libscg interface code is in pre alpha.

Warning: There may be fatal problems.

Using libscg version 'schily-0.8'

scsibus0:

   0,0,0   0) 'MATSHITA' 'UJDA755 DVD/CDRW' '1.00' Removable CD-ROM

   0,1,0   1) *

...

```

----------

## jdgill0

I would not think it possible for cdrecord -scanbus to see the drive without the kernel seeing the drive ... I could be wrong ... is there anyway possible for you to post your dmesg from the laptop?  Could you cdrecord -scanbus > dmesg.txt, and then copy dmesg.txt from the laptop to your other computer, so you could post it?

----------

## bhogg

When I modprobe ide-scsi, sd and sr_mod, cdrecord -scanbus then works.  Before then I get the Cannot load SCSI... error.

Piping cdrecord -scanbus > dmesg.txt would give the same thing I typed in the previous post..?  Is there a way to use cdrecord to see what /dev/... the cdrom is drawn from?

----------

## jdgill0

Crap  :Shocked:   ...... sorry ... I meant to dmesg > dmesg.txt ... I was interested in your kernel messages.

----------

## bhogg

Here's the dmesg:

```

upport registered.

usbcore: registered new driver usbhid

drivers/usb/input/hid-core.c: v2.0:USB HID core driver

i8042.c: Detected active multiplexing controller, rev 1.1.

serio: i8042 AUX0 port at 0x60,0x64 irq 12

serio: i8042 AUX1 port at 0x60,0x64 irq 12

serio: i8042 AUX2 port at 0x60,0x64 irq 12

serio: i8042 AUX3 port at 0x60,0x64 irq 12

serio: i8042 KBD port at 0x60,0x64 irq 1

mice: PS/2 mouse device common for all mice

input: AT Translated Set 2 keyboard on isa0060/serio0

Synaptics Touchpad, model: 1

 Firmware: 5.9

 Sensor: 17

 new absolute packet format

 Touchpad has extended capability bits

 -> multifinger detection

 -> palm detection

input: SynPS/2 Synaptics TouchPad on isa0060/serio4

Advanced Linux Sound Architecture Driver Version 1.0.5 (Sun May 30 10:49:40 2004 UTC).

PCI: Enabling device 0000:00:1f.5 (0005 -> 0007)

ACPI: PCI interrupt 0000:00:1f.5[B] -> GSI 6 (level, low) -> IRQ 6

PCI: Setting latency timer of device 0000:00:1f.5 to 64

ieee1394: Host added: ID:BUS[0-00:1023]  GUID[00e01800031b3044]

codec_semaphore: semaphore is not ready [0x1][0x700300]

codec_semaphore: semaphore is not ready [0x1][0x700300]

codec_semaphore: semaphore is not ready [0x1][0x700300]

codec_semaphore: semaphore is not ready [0x1][0x700300]

codec_semaphore: semaphore is not ready [0x1][0x700300]

codec_semaphore: semaphore is not ready [0x1][0x700300]

codec_semaphore: semaphore is not ready [0x1][0x700300]

codec_semaphore: semaphore is not ready [0x1][0x700300]

codec_semaphore: semaphore is not ready [0x1][0x700300]

intel8x0_measure_ac97_clock: measured 49419 usecs

intel8x0: clocking to 48000

ALSA device list:

  #0: Intel 82801DB-ICH4 at 0x1f800400, irq 6

oprofile: using NMI interrupt.

NET: Registered protocol family 2

IP: routing cache hash table of 4096 buckets, 32Kbytes

TCP: Hash tables configured (established 32768 bind 65536)

ip_conntrack version 2.1 (4026 buckets, 32208 max) - 296 bytes per conntrack

ip_tables: (C) 2000-2002 Netfilter core team

ipt_recent v0.3.1: Stephen Frost <sfrost@snowman.net>.  http://snowman.net/projects/ipt_recent/

arp_tables: (C) 2002 David S. Miller

NET: Registered protocol family 1

NET: Registered protocol family 17

speedstep-centrino: found "Intel(R) Pentium(R) M processor 1500MHz": max frequency: 1500000kHz

ACPI: (supports S0 S1 S3 S4 S5)

ReiserFS: hda6: found reiserfs format "3.6" with standard journal

ReiserFS: hda6: using ordered data mode

ReiserFS: hda6: journal params: device hda6, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30

ReiserFS: hda6: checking transaction log (hda6)

ReiserFS: hda6: Using r5 hash to sort names

VFS: Mounted root (reiserfs filesystem) readonly.

Mounted devfs on /dev

Freeing unused kernel memory: 188k freed

Adding 506036k swap on /dev/hda3.  Priority:-1 extents:1

ReiserFS: hda6: Removing [151 252141 0x0 SD]..done

ReiserFS: hda6: There were 1 uncompleted unlinks/truncates. Completed

eth0: link up, 10Mbps, half-duplex, lpa 0x0000

```

In case you're interested, lspci:

Probably nothing without the modules loaded...

```

0000:00:00.0 Host bridge: Intel Corp. 82852/855GM Host Bridge (rev 02)

0000:00:00.1 System peripheral: Intel Corp. 855GM/GME GMCH Memory I/O Control Registers (rev 02)

0000:00:00.3 System peripheral: Intel Corp. 855GM/GME GMCH Configuration Process Registers (rev 02)

0000:00:02.0 VGA compatible controller: Intel Corp. 82852/855GM Integrated Graphics Device (rev 02)

0000:00:02.1 Display controller: Intel Corp. 82852/855GM Integrated Graphics Device (rev 02)

0000:00:1d.0 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 03)

0000:00:1d.1 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 03)

0000:00:1d.2 USB Controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 03)

0000:00:1d.7 USB Controller: Intel Corp. 82801DB/DBM (ICH4/ICH4-M) USB 2.0 EHCI Controller (rev 03)

0000:00:1e.0 PCI bridge: Intel Corp. 82801 PCI Bridge (rev 83)

0000:00:1f.0 ISA bridge: Intel Corp. 82801DBM LPC Interface Controller (rev 03)

0000:00:1f.1 IDE interface: Intel Corp. 82801DBM (ICH4) Ultra ATA Storage Controller (rev 03)

0000:00:1f.5 Multimedia audio controller: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)

0000:00:1f.6 Modem: Intel Corp. 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 03)

0000:01:03.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ac)

0000:01:03.1 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ac)

0000:01:03.2 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 04)

0000:01:04.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

0000:01:05.0 Network controller: Intel Corp. PRO/Wireless 2200BG (rev 05)

```

----------

## jdgill0

I was expecting more from dmesg ... there should have been information like the example I posted above.

See what the following gives you:

```
ls -ld /dev/hd*

```

Hopefully you are using 2.4 kernel, for which only the devices that are present will have an entry in /dev.

For example on a machine with 2.4 that I administer I get

```
/dev/hda -> ide/host0/bus0/target0/lun0/disc

/dev/hda1 -> ide/host0/bus0/target0/lun0/part1

/dev/hda2 -> ide/host0/bus0/target0/lun0/part2

/dev/hda3 -> ide/host0/bus0/target0/lun0/part3

/dev/hdb -> ide/host0/bus0/target1/lun0/disc

/dev/hdb1 -> ide/host0/bus0/target1/lun0/part1

/dev/hdb2 -> ide/host0/bus0/target1/lun0/part2

/dev/hdc -> ide/host0/bus1/target0/lun0/cd
```

Here you can see the last entry is for a cdrom.

----------

## bhogg

I've messed with some block device settings, and dmesg is actually recognizing the cd-rom:

dmesg | grep -i scsi

```

...

scsi0 : SCSI host adapter emulation for IDE ATAPI devices

   Type:   CD-ROM                     ANSI SCSI revision: 02

sr0: scsi3-mmc drive: 24x/24x writer cd/rw xa/form2 cdda tray

Attached scsi CD-ROM sr0 at scsi0, channel 0, id 0, lun 0

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

```

So great, it's finding it.. I'm just getting the error:

```

# 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

```

I can still mount /boot no problem, so probably not the last part of the error.  It works fine with the liveCD and with WinXP, so the drive is physically fine.  Just need to figure out what kernel features to enable (or disable) or anything else people can suggest....

Edit: eject /dev/sr0 also works on the drive, so it is recognizing it...

Edit: I'm using mm-sources, 2.6.7 kernel.. it's consistantly worked the best out of all the sources I've tried for finding the hardware.

Thanks,

Brian

----------

## jdgill0

Thing is, if you use the drive with scsi emulation, you need the hdx=ide-scsi setting in your boot loader.  Which I would guess is likely the reason for the error since you are trying to mount the device as scsi, ie. the /dev/sr0.

The following 2.6 kernel options would give you normal IDE cdrom support:

```
File systems  ---> 

     CD-ROM/DVD Filesystems  --->

          <*> ISO 9660 CDROM file system support

          [*]   Microsoft Joliet CDROM extensions ... optional but recommended

          <*> UDF file system support ... optional but recommended

```

The following 2.6 kernel options would give you scsi emulation:

```
Device Drivers  --->

     ATA/ATAPI/MFM/RLL support  --->

          <M>     SCSI emulation support

     SCSI device support  --->

          <M>   SCSI CDROM support

          <M>   SCSI generic support

```

Where in my case I chose to use modules, and added ide-scsi, sg, sr_mod to /etc/modules.autoload.d/kernel-2.6. You would then need to add the hdx=ide-scsi as I already mentioned.

I run two computers ... one with gentoo-dev 2.6 and one with vanilla 2.4 .... in both cases I see something about hdx for the cdroms/burners I have.

Now suppose hdc is the cdrom.  If you don't use scsi-emulation then fstab would have something like

```
/dev/hdc  /cdrom  auto  noauto,ro,users  0 0
```

If you used scsi-emulation, then it would be something like

```
/dev/sr0  /cdrom  auto  noauto,ro,users 0 0

     or

/dev/scd0  /cdrom  auto  noauto,ro,users  0 0

```

----------

## bhogg

I'll try the kernel configurations again and see how it goes.  Unfortunately I'm unable to find a /dev/hdb, hbc, etc.  Since it's a laptop I can't set the master/slave jumpers like I would on this home PC.  I've got ide-scsi enabled with hdb=ide-scsi, but even here it doesn't show up in /dev/hd* listing.

I'll try some random hd* values and see if anything works...

----------

## jdgill0

A friend suggested to looking at /proc/ide ...

```
ls /proc/ide
```

 .... otherwise it could be you don't have the right chipset compiled into your kernel for your laptop.

Can you post what you get for the ls

For example I get:

drivers  hda  hdb  hdc  hdd  hde  hdf  ide0  ide1  ide2  pdcnew  via

Now if i do

```
cat /proc/ide/ide2/hdf/model
```

I get: SONY CD-RW CRX215E1 ... which is my cdrw drive.

----------

## bhogg

I'm getting:

```

drivers hda hdc ide0 ide1 piix

```

and it's /proc/ide/ide1/hdc/model that's giving me the CD-RW.  For the kernel config, should I have one or the other?  I tried disabling iso9660, etc and just having the SCSI loaded... cdrecord still sees it but now I'm getting a "Can't read superblock" when trying to mount /dev/sr0 (with hdc=ide-scsi in grub.conf).

Thanks again for all your help... eventually we/I'll stumble on the right kernel config and .conf settings to get this mounted.[/code]

----------

## jdgill0

Sorry, I did not make it clear ... you still enable cdrom support and iso9660 and Juliet support, even if you go scsi-emulaton route ... you need the iso9660 support to read the disc because that is the typical filesystem of the disc ... it would not hurt to go ahead and include UDF support too.

Let me make sure I understood:  this drive is a dvd/cd burner combo? ... if it is not a burner at all, forget the scsi stuff.

Now, if you do go with scsi emulation, then hdc=ide-scsi should be correct based on what you last posted, along with sr0.

As for the help, you are welcome ... sorry for the errors or shortsitedness along the way though  :Shocked:  .

----------

## bhogg

I had all those enabled previously and still had the same problems... various errors when mounting but working fine with cdrecord -scanbus.  It is a dvd/burner combo, but an internal laptop drive.  

I'm still just getting this error now:

```

/dev/sr0: Input/output error

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

```

I've made quite a few changes to the kernel so something must have changed along the way.  Regardless, it's always a different error and no configuration seems to work.  Of all the things to be such a hassle, I didn't think the cd-rw would be one of them... just need this and wireless working and I'm good to go.

Thanks,

Brian

----------

## jdgill0

Try mounting to /dev/hdc directly in your fstab file

```
/dev/hdc  /mnt/cdrom  iso9660  ro,users  0 0
```

----------

## bhogg

I've tried inserting that in /etc/fstab, but it's still not being mounted, and mount -t iso9660 /dev/hdc /mnt/cdrom gives the "wrong fs type, bad option, ..." error.

Wish there was a way to see what kernel option is causing the conflict, or what needs to be enabled.  I'm going to try using the LiveCD to see how they set it up, any suggestions?  If I remember right it was just IDE/ATAPI finding it and loading it properly.

----------

## bhogg

Just in case anyone's interested, I finally figured it out.  I enabled IDE/ATAPI CD-ROM support, disabled SCSI Emulation, enabled SCSI Generic support and SCSI CD-ROM support.  Then mounted the CD-ROM in the fstab as:

```

/dev/hdc   /mnt/cdrom  auto  user,noauto,ro   0 0

```

or from the command line:

```

mount -t iso9660 /dev/hdc /mnt/cdrom

```

If you include hdc=ide-scsi with these options, it stops it from working.

Thanks again for all your help...

----------

## jdgill0

 *bhogg wrote:*   

> Just in case anyone's interested, I finally figured it out.  I enabled IDE/ATAPI CD-ROM support, disabled SCSI Emulation, enabled SCSI Generic support and SCSI CD-ROM support.  Then mounted the CD-ROM in the fstab as:
> 
> ```
> 
> /dev/hdc   /mnt/cdrom  auto  user,noauto,ro   0 0
> ...

 

You should not need the enabled SCSI Generic support and SCSI CD-ROM support without SCSI Emulation.

The hdc=ide-scsi needs the SCSI Emulation to work, that is why it quits working. This option tells the kernel to treat the device as a scsi device, else it would treat the device as a normal ATAPI device.

However, glad to see you got it working.

----------

## bhogg

It may have been something else along the way, and I'll try disabling that and see if there's any change in functionality.  It's still having a "can't read superblock" error when mounting with an audio CD in the drive... or is that mountible with a different type?

Thanks again.

----------

## jdgill0

Actually you don't mount audio cd's ... cd players read from the dev directly, such as /dev/hdc or /dev/cdroms/cdrom0, etc ... depending on your setup, you may have to tell your cd playing software which dev to look at.

----------

