udev - permissions for generic scsi devices. - Slackware

This is a discussion on udev - permissions for generic scsi devices. - Slackware ; Chaps, I want to set5 the permissions on /dev/sg* to 666 to allow my scanning software (Vuescan) work as a user. I've been through the udev rules and changed what appears to be the appropriate lines: # permissions for SCSI ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: udev - permissions for generic scsi devices.

  1. udev - permissions for generic scsi devices.

    Chaps,

    I want to set5 the permissions on /dev/sg* to 666 to allow my scanning
    software (Vuescan) work as a user. I've been through the udev rules and
    changed what appears to be the appropriate lines:

    # permissions for SCSI sg/tape devices
    SUBSYSTEMS=="scsi", KERNEL=="s[gt][0-9]*", ATTRS{type}=="5", NAME="%k",
    GROUP="cdrom", MODE="0666"

    Mode was 0660 which, as you can see, I have changed to 0666. However, this
    does not do the trick, they are still 0660 on reboot.

    Thoughts?

    Pete

    --
    http://www.petezilla.co.uk

  2. Re: udev - permissions for generic scsi devices.

    On 11/11/07 11:55, Peter Chant wrote:
    > Chaps,
    >
    > I want to set5 the permissions on /dev/sg* to 666 to allow my scanning
    > software (Vuescan) work as a user. I've been through the udev rules and
    > changed what appears to be the appropriate lines:
    >
    > # permissions for SCSI sg/tape devices
    > SUBSYSTEMS=="scsi", KERNEL=="s[gt][0-9]*", ATTRS{type}=="5", NAME="%k",
    > GROUP="cdrom", MODE="0666"
    >
    > Mode was 0660 which, as you can see, I have changed to 0666. However, this
    > does not do the trick, they are still 0660 on reboot.
    >
    > Thoughts?


    Add the relevant users that are allowed to use the devices to the
    group ("cdrom" ?) assigned to /dev/sg*

    Ciao
    Giovanni
    --
    A computer is like an air conditioner,
    it stops working when you open Windows.
    Registered Linux user #337974 < http://giovanni.homelinux.net/ >

  3. Re: udev - permissions for generic scsi devices.

    Giovanni wrote:


    >> # permissions for SCSI sg/tape devices
    >> SUBSYSTEMS=="scsi", KERNEL=="s[gt][0-9]*", ATTRS{type}=="5", NAME="%k",
    >> GROUP="cdrom", MODE="0666"


    > Add the relevant users that are allowed to use the devices to the
    > group ("cdrom" ?) assigned to /dev/sg*


    I see what you mean, but /dev/sg* is uid root, group id root. So either I
    don't understand udev (yes) or this line is not working!

    Pete

    --
    http://www.petezilla.co.uk

  4. Re: udev - permissions for generic scsi devices.

    On 11/11/07 12:35, Peter Chant wrote:

    >> Add the relevant users that are allowed to use the devices to the
    >> group ("cdrom" ?) assigned to /dev/sg*

    >
    > I see what you mean, but /dev/sg* is uid root, group id root. So either I
    > don't understand udev (yes) or this line is not working!
    >


    Sorry. My scanner is an USB device and it worked after I added the
    user to the proper group. But this is a different problem.

    Ciao
    Giovanni
    --
    A computer is like an air conditioner,
    it stops working when you open Windows.
    Registered Linux user #337974 < http://giovanni.homelinux.net/ >

  5. Re: udev - permissions for generic scsi devices.


    Peter Chant wrote :

    > Thoughts?


    I think you should take a look at /etc/udev/rules.d/80-libsane.rules
    --
    Thomas O.

    This area is designed to become quite warm during normal operation.

  6. Re: udev - permissions for generic scsi devices.

    Thomas Overgaard wrote:

    >
    > Peter Chant wrote :
    >
    >> Thoughts?

    >
    > I think you should take a look at /etc/udev/rules.d/80-libsane.rules


    Scanner not listed. Also that file appears to be for usb scanners and the
    one in question is SCSI.

    Pete

    --
    http://www.petezilla.co.uk

  7. Re: udev - permissions for generic scsi devices.


    Peter Chant wrote :

    > Scanner not listed. Also that file appears to be for usb scanners and the
    > one in question is SCSI.


    Then try this. Run this command and replace sgX with the device your
    scanner is using:
    udevinfo -a -p /sys/class/scsi_generic/sgX

    Find this line(replace xxxXXxxx with whatever model you have):
    SYSFS{model}="xxxXXXxxx"

    Then add this line to 50-udev.rules:
    SUBSYSTEMS=="scsi", SYSFS{model}="xxxXXXxxx", NAME="%k",
    SYMLINK="scanner", MODE="0666", GROUP="scanner"

    Now your scanner should be found at /dev/scanner, and the permission
    should be 666. But 660 would do if you add your User to the scanner
    group.
    --
    Thomas O.

    This area is designed to become quite warm during normal operation.

  8. Re: udev - permissions for generic scsi devices.

    REMpeteOVE@CAPpetezilla.ITALSco.uk wrote:
    > Chaps,
    >
    > I want to set5 the permissions on /dev/sg* to 666 to allow my scanning
    > software (Vuescan) work as a user. I've been through the udev rules and
    > changed what appears to be the appropriate lines:
    >
    > # permissions for SCSI sg/tape devices
    > SUBSYSTEMS=="scsi", KERNEL=="s[gt][0-9]*", ATTRS{type}=="5", NAME="%k",
    > GROUP="cdrom", MODE="0666"
    >
    > Mode was 0660 which, as you can see, I have changed to 0666. However, this
    > does not do the trick, they are still 0660 on reboot.
    >
    > Thoughts?


    It looks like you copied the rule from 50-udev.rules and changed the mode.
    When I tried that for my own devices, it didn't work, because the original
    rule ran after mine and reset the protections.
    To fix it, I added: OPTIONS="last_rule"
    to my copy of the rule. That prevents the system rule from running.
    Perhaps you should try that.

  9. Re: udev - permissions for generic scsi devices.

    ljb wrote:

    > It looks like you copied the rule from 50-udev.rules and changed the mode.
    > When I tried that for my own devices, it didn't work, because the original
    > rule ran after mine and reset the protections.
    > To fix it, I added: OPTIONS="last_rule"
    > to my copy of the rule. That prevents the system rule from running.
    > Perhaps you should try that.


    Hmm, I edited the entry in 50-udev.rules, and using grep it is the only rule
    that pertains to the generic SCSI devices, sg*.

    I wonder, on my SATA machine, sg0 and sg1 are used by the disks - does that
    have any bearing?

    Pete

    --
    http://www.petezilla.co.uk

  10. Re: udev - permissions for generic scsi devices.

    Peter Chant wrote:
    > ljb wrote:
    >
    >> It looks like you copied the rule from 50-udev.rules and changed the mode.
    >> When I tried that for my own devices, it didn't work, because the original
    >> rule ran after mine and reset the protections.
    >> To fix it, I added: OPTIONS="last_rule"
    >> to my copy of the rule. That prevents the system rule from running.
    >> Perhaps you should try that.

    >
    > Hmm, I edited the entry in 50-udev.rules, and using grep it is the only rule
    > that pertains to the generic SCSI devices, sg*.
    >
    > I wonder, on my SATA machine, sg0 and sg1 are used by the disks - does that
    > have any bearing?
    >
    > Pete


    My linited knowledge says, it do. You may try scd0. Remembering trying to
    set up my SCSI devices and getting no where until someone told me to try
    scd even though the logs were telling me they were sg devices. GL
    --
    Bud, waiting for the roof to fall in on my head

  11. Re: udev - permissions for generic scsi devices.

    Thomas Overgaard wrote:

    >
    > Peter Chant wrote :
    >
    >> Scanner not listed. Also that file appears to be for usb scanners and
    >> the one in question is SCSI.

    >
    > Then try this. Run this command and replace sgX with the device your
    > scanner is using:
    > udevinfo -a -p /sys/class/scsi_generic/sgX
    >
    > Find this line(replace xxxXXxxx with whatever model you have):
    > SYSFS{model}="xxxXXXxxx"


    Don't get that line in the output:

    http://www.petezilla.co.uk/Linux/scanwitt.txt

    Vuescan does recognise it correctly as a Scanwitt thought.

    >
    > Then add this line to 50-udev.rules:
    > SUBSYSTEMS=="scsi", SYSFS{model}="xxxXXXxxx", NAME="%k",
    > SYMLINK="scanner", MODE="0666", GROUP="scanner"
    >
    > Now your scanner should be found at /dev/scanner, and the permission
    > should be 666. But 660 would do if you add your User to the scanner
    > group.


    My scanner software, Vuescan looks through the generic scsi devices, it will
    not look for /dev/scanner nor is there an option to change it from what I
    am aware - so unfortunately this approach won't work. Probally a legacy of
    it running on Windows, as it bypasses TWAIN and talks directly to the SCSI
    card.

    Pete


    --
    http://www.petezilla.co.uk

  12. Re: udev - permissions for generic scsi devices.

    Bud wrote:


    >
    > My linited knowledge says, it do. You may try scd0. Remembering trying to
    > set up my SCSI devices and getting no where until someone told me to try
    > scd even though the logs were telling me they were sg devices. GL


    No, scanner is definitely at sg0, chmod 777 definitely lets vuescan see the
    scanner. However, this is reset on each reboot as it is a udev issue.
    Vuescan scans the generic devices.

    Pete

    --
    http://www.petezilla.co.uk

+ Reply to Thread