Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: HOWTO: UDEV/SCSI Scanner Configuration

  1. #1
    Join Date
    Jan 2005
    Location
    Calgary, Alberta, Canada
    Beans
    32
    Distro
    Ubuntu 9.10 Karmic Koala

    HOWTO: UDEV/SCSI Scanner Configuration

    I really hope this information will help others as it was a real head scratcher for me. I have an HP Scanjet 6100C SCSI scanner attached to an Adaptec AHA-7850 based PCI SCSI card. I have never had much luck getting my scanner to work under Linux without having to change permissions on some device file which always seemed kind of wrong to me. I never believed that I should have to do that manually. I have spent hours reading posts on this forum with all of them basically saying to change the permissions on the device. Well I figured, especially with UDEV that there had to be a better way. And with a little bit of basic UDEV help from here I have found that way. Complete the instructions below and hopefully you too will soon be happily scanning in Ubuntu with your SCSI scanner...

    First, load the SCSI Generic (sg) module.
    Code:
    gordo@neo:~ $ sudo modprobe sg
    Next, add sg to the bottom of /etc/modules.
    Code:
    gordo@neo:~ $ sudo gedit /etc/modules
    Code:
    # /etc/modules: kernel modules to load at boot time.
    #
    # This file should contain the names of kernel modules that are
    # to be loaded at boot time, one per line.  Comments begin with
    # a "#", and everything on the line after them are ignored.
    
    psmouse
    mousedev
    ide-cd
    ide-disk
    ide-generic
    lp
    sg
    Next, install the sane-utils package.
    Code:
    gordo@neo:~ $ sudo apt-get install sane-utils
    Next, run sane-find-scanner to detect your scanner device.
    Code:
    gordo@neo:~ $ sudo sane-find-scanner
    
    found SCSI processor "HP C2520A 3644" at /dev/sg0
      # Your SCSI scanner was detected. It may or may not be supported by SANE. Try
      # scanimage -L and read the backend's manpage.
    
    found USB scanner (vendor=0x05a9, product=0xa511) at libusb:003:003
      # Your USB scanner was (probably) detected. It may or may not be supported by
      # SANE. Try scanimage -L and read the backend's manpage.
    
      # Not checking for parallel port scanners.
    
      # Most Scanners connected to the parallel port or other proprietary ports
      # can't be detected by this program
    Next, run udevinfo as follows to find out the exact model name of your scanner substituting your scanners device for sg0.
    Code:
    udevinfo -a -p /sys/class/scsi_generic/sg0
    Look for the line starting with "SYSFS{model}" as illustrated below then write down the exact model name ignoring any trailing spaces. For example the model name of my scanner is exactly "C2520A" minus the quotes.
    Code:
    follow the class device's "device"
      looking at the device chain at '/sys/devices/pci0000:00/0000:00:1e.0/0000:02:03.0/host0/0:0:1:0':
        BUS="scsi"
        ID="0:0:1:0"
        SYSFS{detach_state}="0"
        SYSFS{device_blocked}="0"
        SYSFS{model}="C2520A          "
        SYSFS{queue_depth}="2"
        SYSFS{rev}="3644"
        SYSFS{scsi_level}="3"
        SYSFS{state}="running"
        SYSFS{timeout}="0"
        SYSFS{type}="3"
        SYSFS{vendor}="HP      "
    Next, run the following to backup your current udev.rules file.
    Code:
    sudo cp /etc/udev/udev.rules /etc/udev/udev.rules.backup
    Next, run the following to edit the udev.rules file.
    Code:
    sudo gedit /etc/udev/udev.rules
    And below these two lines.
    Code:
    # permissions for SCSI sg devices
    BUS="scsi", KERNEL="s[grt][0-9]*", SYSFS_type="5", NAME="%k", MODE="0660", GROUP="cdrom"
    Add these two new lines substituting the exact model name of your scanner for C2520A. The SYMLINK="scanner" portion is optional. It is only needed if you actually want to have a /dev/scanner symlink that will always point to your actual scanner device.
    Code:
    # permissions for SCSI scanner
    BUS="scsi", SYSFS{model}="C2520A", NAME="%k", SYMLINK="scanner", MODE="0660", GROUP="scanner"
    Now make sure your user is a member of the scanner group, reboot then run XSane. Your SCSI scanner should hopefully be detected and working properly as a regular user.

    But, just because this procedure works perfectly fine for me doesn't mean it will for you. Hopefully it will work for you. I am interested in hearing back from people about thier experiences. Also any constructive comments about this HOWTO are welcome and appreciated.

    Gordo
    Last edited by gbusse; January 19th, 2005 at 02:11 AM.

  2. #2
    Join Date
    Nov 2004
    Location
    UK
    Beans
    22

    Re: HOWTO: UDEV/SCSI Scanner Configuration

    Great article and very clear.

    But... the ScanJet 5P was also supplied with a Symbios SYM20403 card - a wacky triangular ISA card. You don't know where drivers for that one are available, by any chance? (The ones at driverguide.com don't untar)

  3. #3
    Join Date
    Mar 2005
    Beans
    3

    Re: HOWTO: UDEV/SCSI Scanner Configuration

    Excellent article. I just used it to install my HP ScanJet 4c with an AHA-7850, and everything worked perfectly.

    A suggestion to speed up the install process: instead of rebooting, you can use

    Code:
    sudo modprobe -r sg
    sudo modprobe sg
    That will reload the SCSI module quickly.
    Last edited by kstamper; March 5th, 2005 at 08:58 PM. Reason: Can't type

  4. #4
    Join Date
    Nov 2004
    Location
    Quebec
    Beans
    741
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: HOWTO: UDEV/SCSI Scanner Configuration

    Excellent, i had given up on my old astra1220s after trying to get it working(non root).

    I'll give it a try soon.

    Thanks!

  5. #5
    Join Date
    Jun 2005
    Beans
    1

    Re: HOWTO: UDEV/SCSI Scanner Configuration

    Just my own experience with my Epson Expression800, to avoid
    the reboot and not have to be root I had to manually change the
    group on /dev/sg0 to scanner.

    Thanks for the writeup I can't say how great the ubuntu community
    has been.

    -Ben

  6. #6
    Join Date
    Aug 2005
    Location
    Canada, eh?
    Beans
    17

    Re: HOWTO: UDEV/SCSI Scanner Configuration

    This is fantastic! I've spent hours trying to find the correct place to edit device permisions, and here it is.

    Thanks for the wonderful step-by-step guide - it works on Hoary Hedgehog as well!

    Regards,

    Eric

  7. #7
    Join Date
    Sep 2005
    Location
    New York
    Beans
    32
    Distro
    Ubuntu Breezy 5.10

    Re: HOWTO: UDEV/SCSI Scanner Configuration

    Awesome! now my scanjet 4c works
    thanks

  8. #8
    Join Date
    Dec 2005
    Beans
    6

    Re: HOWTO: UDEV/SCSI Scanner Configuration

    Works great with my Umax Astra scanner, but I can't get my Minolta F-2800 SCSI slide scanner to work. I'm guessing it's not supported by Sane - anyone have any ideas to get it working?

    Andy

  9. #9

    Re: HOWTO: UDEV/SCSI Scanner Configuration

    Worked for me and my 6100C also! I've got an AHA-2109B, I believe.

  10. #10
    Join Date
    Apr 2006
    Beans
    4

    Re: HOWTO: UDEV/SCSI Scanner Configuration

    You are a genius scanjet 4p (C5110A) work very well!
    I'll writhe a wiki for ubuntu italian comunity
    thank I serched a lot without result

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •