Unix Technical Forum

sr0? sg0?

This is a discussion on sr0? sg0? within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Hi, In a default configuration on 10.1, KAudioCreator has troubles accessing the CDROM (2.4.29 kernel, SCSI emulation activated). I've ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 08:50 AM
Niki Kovacs
 
Posts: n/a
Default sr0? sg0?

Hi,

In a default configuration on 10.1, KAudioCreator has troubles accessing the
CDROM (2.4.29 kernel, SCSI emulation activated).

I've noticed that fiddling around with the permissions for /dev/sg0
and /dev/sr0 solves the problem, although I don't understand why, and how.

1) What are these mysterious devices /dev/sr0 and /dev/sg0?

2) How should they be configured so KAudioCreator can access them correctly?

Thanks,

Niki Kovacs
--
I'm not as think as you stoned I am.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 08:50 AM
LiNuCe
 
Posts: n/a
Default Re: sr0? sg0?

Fri, 27 May 2005 08:39:29 +0200 - Niki Kovacs <mickey@mouse.com> :
> Hi,


Hello Mickey

> In a default configuration on 10.1, KAudioCreator has troubles
> accessing the CDROM (2.4.29 kernel, SCSI emulation activated).
>
> I've noticed that fiddling around with the permissions for /dev/sg0
> and /dev/sr0 solves the problem, although I don't understand why,
> and how.
>
> 1) What are these mysterious devices /dev/sr0 and /dev/sg0?


The sr0 and scd0 devices are SCSI CD-ROM/CD-RW devices. You should use
these devices to access your CD-ROM/CD-RW when SCSI emulation is
activated. In fact, scd0 is the recommanded one, but for now, both
sr0 and scd0 are the same device (both have the same minor & major
numbers).

sg0 is a generic SCSI device : you shouldn't need to access it
directly.

> 2) How should they be configured so KAudioCreator can access them
> correctly?


bash-3.00$ ls -la /dev/scd0 /dev/sr0
brw-rw-r-- 1 root cdrom 11, 0 2005-02-01 16:03 /dev/scd0
brw-rw---- 1 root cdrom 11, 0 1999-04-13 06:24 /dev/sr0

As you can see from the device's permissions & ownership, your user
account must be in the "cdrom" group to access them correctly in RW
mode.

> Niki Kovacs


--
LiNuCe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 08:50 AM
ste
 
Posts: n/a
Default Re:sr0? sg0?

> 1) What are these mysterious devices /dev/sr0 and /dev/sg0

Hi
Any program that tries to access a SCSI (also an emulated one) cdro
uses /dev/srX to communicate with the drive and any program tha
tries to access a SCSI (also an emulated one) generic peripheral, a
a CD/DVD burner, uses /dev/sgX
If I remember correctly In Slack 10.1, Kernel 2.4.X, the defaul
permissions of these devices are root:cdrom for /dev/srX an
root:root for /dev/sgX
A possible solution to your problem might be: change /dev/sg
permissions in root:cdrom with "chown root:cdrom /dev/sgX" and ad
yourserlf to the group "cdrom" with "usermod -G cdrom USER"
I hope It will be useful
Regards
St

Message posted via
====================
www.linuxpackages.net/foru
www.linuxpackages.ne
Expanding the world of Slackwar
=====================
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 08:50 AM
Niki Kovacs
 
Posts: n/a
Default Re:sr0? sg0?

ste wrote:

> Hi,
> Any program that tries to access a SCSI (also an emulated one) cdrom
> uses /dev/srX to communicate with the drive and any program that
> tries to access a SCSI (also an emulated one) generic peripheral, as
> a CD/DVD burner, uses /dev/sgX.
> If I remember correctly In Slack 10.1, Kernel 2.4.X, the default
> permissions of these devices are root:cdrom for /dev/srX and
> root:root for /dev/sgX.
> A possible solution to your problem might be: change /dev/sgX
> permissions in root:cdrom with "chown root:cdrom /dev/sgX" and add
> yourserlf to the group "cdrom" with "usermod -G cdrom USER" .
> I hope It will be useful.
> Regards.
> Ste


Thanks!

Niki Kovacs
--
I'm not as think as you stoned I am.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 09:00 AM
Eef Hartman
 
Posts: n/a
Default Re: sr0? sg0?

Niki Kovacs <mickey@mouse.com> wrote:
> 1) What are these mysterious devices /dev/sr0 and /dev/sg0?


sr0 (or scd0, which is the same device) is "first Scsi (CD-)Rom" device;
that is: the special file for the first SCSI-emulated CD-rom drive.
So as long as you're using "ide-scsi", your CD-rom/writer drive moves
from /dev/hd? to /dev/sr0 (cq /dev/scd0), which has to be readable
for the program to USE it, but to WRITE CD-r(w)'s, it also has to
be writable for the program to send "low-level" commands to it.

By default these devices are only read-write for people/programs,
belonging to the group "cdrom", so you may have to put yourself into
that group (or run the program as root, of course).

sg? are the Scsi Generic devices, which are needed for instance for
the "scan-bus" functions some programs use. In a lot of kernels you
will have to load the "sg" kernel module for them to be usable.
As sg is a low-level interface, ITS default is to be only read-writable
for ROOT.

> 2) How should they be configured so KAudioCreator can access them correctly?


I don't know KAudioCreator, am using "cdrecord" myself, and I normally
go to root first, to create CD's, as our scripts use too many "root-only"
functionality, for instance setting of real-time priority.
You could setup "sudo" for it, if that's a problem.
--
************************************************** ******************
** Eef Hartman, Delft University of Technology, dept. EWI/TW **
** e-mail: E.J.M.Hartman@math.tudelft.nl, fax: +31-15-278 7295 **
** snail-mail: P.O. Box 5031, 2600 GA Delft, The Netherlands **
************************************************** ******************
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:36 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com