Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SCSI CDRW Woes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
bdemore
n00b
n00b


Joined: 22 Oct 2002
Posts: 67

PostPosted: Sat Nov 16, 2002 5:36 am    Post subject: SCSI CDRW Woes Reply with quote

I think I've exhausted all the threads regarding this and am not sure where to turn. I'm trying to get a Yamaha SCSI CDRW to be recognized by Gnome Toaster which I emerged last night. My fstab looks like this:

/dev/cdroms/cdrom0 /mnt/cdrw auto noauto,ro,user 0 0

I can mount and read from it with no problem. When I issue the command cdrecord -scanbus I get the following:

Cdrecord 1.11a39 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling
cdrecord: Device or resource busy. Cannot open '/dev/sg0'. Cannot open SCSI driver.
cdrecord: For possible targets try 'cdrecord -scanbus'. Make sure you are root.
cdrecord: For possible transport specifiers try 'cdrecord dev=help'.

The command dmesg gives me:

Vendor: YAMAHA Model: CRW8424S Rev: 1.0j
Type: CD-ROM ANSI SCSI revision: 02
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 5, lun 0
(scsi0:A:5): 20.000MB/s transfers (20.000MHz, offset 15)
sr0: scsi3-mmc drive: 24x/16x writer cd/rw xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.12

I have sg compiled into the kernel. I've read quite a bit about permissions but I don't think that's my problem. Any help would be appreciated.
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Sat Nov 16, 2002 5:48 am    Post subject: Reply with quote

have you tried it logged in as root?
Back to top
View user's profile Send private message
bdemore
n00b
n00b


Joined: 22 Oct 2002
Posts: 67

PostPosted: Sat Nov 16, 2002 5:58 am    Post subject: Reply with quote

Yeah, same results
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Sat Nov 16, 2002 7:54 am    Post subject: Reply with quote

Hmm, I can't think of anything else offhand... I've only set up IDE CD burners through SCSI emulation. I don't know if there's anything else that must be done for real SCSI burners.
Back to top
View user's profile Send private message
ronmon
Veteran
Veteran


Joined: 15 Apr 2002
Posts: 1043
Location: Key West, FL

PostPosted: Sat Nov 16, 2002 1:19 pm    Post subject: Reply with quote

Maybe this will help. It's the relevant parts of my /etc/devfsd.conf:

This gives non-root users write permission
Code:
REGISTER        ^scsi/host0/bus0/target6/lun0/generic$  PERMISSIONS root.cdrw   660
REGISTER        ^cdr$                                   PERMISSIONS root.cdrw   660


And this creates a /dev/cdr link
Code:
LOOKUP          ^cdr$           CFUNCTION GLOBAL mksymlink cdroms/cdrom1 cdr
REGISTER        ^cdroms/cdrom1$ CFUNCTION GLOBAL mksymlink $devname cdr
UNREGISTER      ^cdroms/cdrom1$ CFUNCTION GLOBAL unlink cdr


It is slightly different than the examples that are in the stock devfsd.conf file. Take a look at those, compare the differences and experiment. I would leave the original examples commented out and copy new lines to test so that you will have them to refer to later. Your normal user has to be in the cdrw group for this to work. My scanner is set up the same way.
Back to top
View user's profile Send private message
MBCook
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jul 2002
Posts: 136
Location: Insanity, USA

PostPosted: Sat Nov 16, 2002 10:41 pm    Post subject: Reply with quote

Do you have the CD mounted when you try to write to it? Also, are you sure it's sg0? Does sg0 even exist?
_________________
-- Michael

Read an intelligent book like "The New Thought Police" or "The War Against Boys", and learn the TRUTH.
Back to top
View user's profile Send private message
bdemore
n00b
n00b


Joined: 22 Oct 2002
Posts: 67

PostPosted: Sat Nov 16, 2002 11:38 pm    Post subject: Reply with quote

I don't even know what sg0 is. I thought maybe it refered to the SCSI generic module which i've got loaded.
Back to top
View user's profile Send private message
MBCook
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jul 2002
Posts: 136
Location: Insanity, USA

PostPosted: Sat Nov 16, 2002 11:58 pm    Post subject: Reply with quote

Yes it does. Do you have one in /dev?

What the sgXs do is allow bypass any driver thats there (like the scsi-cdrom driver) and give a program total controll over the drive. This is needed for CD-R(W), tape drives?, scanners?, etc.
_________________
-- Michael

Read an intelligent book like "The New Thought Police" or "The War Against Boys", and learn the TRUTH.
Back to top
View user's profile Send private message
bdemore
n00b
n00b


Joined: 22 Oct 2002
Posts: 67

PostPosted: Sun Nov 17, 2002 12:07 am    Post subject: Reply with quote

It's there but it's a 0 byte file. Maybe I need to change the permissions? Should my fstab reflect a /dev/sg0? I tried that but couldn't mount anything.
Back to top
View user's profile Send private message
MBCook
Tux's lil' helper
Tux's lil' helper


Joined: 27 Jul 2002
Posts: 136
Location: Insanity, USA

PostPosted: Sun Nov 17, 2002 12:46 am    Post subject: Reply with quote

It's fine that it's 0 bytes, there is nothing there. Is the drive mounted when you run cdrecord (or whatever)? Are you trying this with a CD in the drive? Sorry, but this is about as helpful as I can be. I've never used a CD writer under linux.
_________________
-- Michael

Read an intelligent book like "The New Thought Police" or "The War Against Boys", and learn the TRUTH.
Back to top
View user's profile Send private message
bdemore
n00b
n00b


Joined: 22 Oct 2002
Posts: 67

PostPosted: Sun Nov 17, 2002 1:42 am    Post subject: Reply with quote

I have no problem mounting the drive as a cdrom but can't as a cdrw (I guess).
Back to top
View user's profile Send private message
nalin
Apprentice
Apprentice


Joined: 27 Sep 2002
Posts: 172
Location: Long Beach

PostPosted: Sun Nov 17, 2002 1:59 am    Post subject: Reply with quote

MBCook wrote:
Is the drive mounted when you run cdrecord (or whatever)

Im using scsi-emulation for my IDE burner but I am quite sure it does not need be mounted to burn (and I am pretty sure it wouldnt mount as iso9660 with the blank disk if one tried).

BDEmore, Do you have all of the following enabled in your kernel.
From the CD-Writing howto...you should have
BLOCK loopback device M
SCSI SCSI support Y/M
SCSI SCSI CD-ROM support Y/M
SCSI Enable vendor-specific Y
SCSI SCSI generic support Y/M
SCSI (select a low-level driver) Y
FS ISO 9660 CDROM filesystem Y/M
FS Microsoft Joliet cdrom... Y

...lotta info at tldp.org cd-writing howto so id check that out if you havent yet done so, figure out exactly where your problem lies and use the forums for additional support if necessary...
good luck
Back to top
View user's profile Send private message
ronmon
Veteran
Veteran


Joined: 15 Apr 2002
Posts: 1043
Location: Key West, FL

PostPosted: Sun Nov 17, 2002 2:08 am    Post subject: Reply with quote

For writing, the drive is identified by its SCSI address in the order of Channel, ID, Lun (0,6,0) in my case. You can see yours by doing 'cat /proc/scsi/scsi'.

That translates to /dev/scsi/host0/bus0/target6/lun0/generic in devfs parlance. If you take a close look at /dev/sg0 (sg2 in my case) you should find that it is a link to your device. I used a very explicit setup in my devfsd.conf example above that points directly to the device, assigned it permissions, and then linked it to a descriptive name (/dev/cdr) so I don't have to remember which sg* is which. I do the same for /dev/scanner and just the link for /dev/dvd.

I'm convinced that the solution to your problem lies in devfsd.conf. It took a while to get the hang of it, but once I did things just started working.

P.S. No, you don't mount it to write to it. In fact you can't because there is no file system yet.
Back to top
View user's profile Send private message
bdemore
n00b
n00b


Joined: 22 Oct 2002
Posts: 67

PostPosted: Sun Nov 17, 2002 3:54 am    Post subject: Reply with quote

That's a lot of excellent descriptive help, thanks. Ronmon, could you post your fstab and devfs.config so that I can understand how they relate? Thanks again.
Back to top
View user's profile Send private message
bdemore
n00b
n00b


Joined: 22 Oct 2002
Posts: 67

PostPosted: Sun Nov 17, 2002 4:32 am    Post subject: Reply with quote

OK, thanks to ronmon I think I've made a breakthrough. sg0 points to my SCSI tape drive and sg1 points to my cdrw. Now I just have to figure out how to tell the cd software to link my cdrw to sg1 instead of sg0. I know it is done in devfsd.conf but i still don't know which line to change with the modification.
Back to top
View user's profile Send private message
ronmon
Veteran
Veteran


Joined: 15 Apr 2002
Posts: 1043
Location: Key West, FL

PostPosted: Sun Nov 17, 2002 12:13 pm    Post subject: Reply with quote

Well, instead of cluttering up the thread with the entire files, how about the chunks that matter.

/etc/fstab (actually this does not matter because writing is done to the raw device)
Code:

/dev/cdroms/cdrom0  /dvd        iso9660     noauto,ro,users                     0 0
/dev/cdroms/cdrom1  /cdr        iso9660     noauto,ro,users                     0 0
/dev/floppy/0       /floppy     auto        rw,noauto,users,uid=1000,gid=100    0 0


/etc/devfsd.conf
Code:

REGISTER        ^scsi/host0/bus0/target5/lun0/generic$  PERMISSIONS root.cdrw   660
REGISTER        ^scanner$                               PERMISSIONS root.cdrw   660
REGISTER        ^scsi/host0/bus0/target6/lun0/generic$  PERMISSIONS root.cdrw   660
REGISTER        ^cdr$                                   PERMISSIONS root.cdrw   660

LOOKUP          ^dvd$           CFUNCTION GLOBAL mksymlink cdroms/cdrom0 dvd
REGISTER        ^cdroms/cdrom0$ CFUNCTION GLOBAL mksymlink $devname dvd
UNREGISTER      ^cdroms/cdrom0$ CFUNCTION GLOBAL unlink dvd

LOOKUP          ^cdr$           CFUNCTION GLOBAL mksymlink cdroms/cdrom1 cdr
REGISTER        ^cdroms/cdrom1$ CFUNCTION GLOBAL mksymlink $devname cdr
UNREGISTER      ^cdroms/cdrom1$ CFUNCTION GLOBAL unlink cdr

LOOKUP          ^scanner$ CFUNCTION GLOBAL mksymlink scsi/host0/bus0/target5/lun0/generic scanner
REGISTER        ^scsi/host0/bus0/target5/lun0/generic$  CFUNCTION GLOBAL mksymlink $devname scanner
UNREGISTER      ^scsi/host0/bus0/target5/lun0/generic$  CFUNCTION GLOBAL unlink scanner


Aargh, it's wrapping two lines in that last section. Hope you can figure it out.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum