SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm running Slackware 10 2.4.26 kernel and KDE 3.2.3.
Being relatively new to linux, I can't figure out how to get my PNY 128MB USB memory stick to be recognized/mounted.
1) Do I need to upgrade the kernel to use the USB memory stick?
2) Is is possible to have Slackware autorecongize the device when insterted? How do you set this up?
3) Do I have to manually mount the device each time? How do you to this?
I did a search of the web and this site, but did not find anthing useful.
Originally posted by freddie_leaf I'm running Slackware 10 2.4.26 kernel and KDE 3.2.3.
Being relatively new to linux, I can't figure out how to get my PNY 128MB USB memory stick to be recognized/mounted.
1) Do I need to upgrade the kernel to use the USB memory stick?
2) Is is possible to have Slackware autorecongize the device when insterted? How do you set this up?
3) Do I have to manually mount the device each time? How do you to this?
I did a search of the web and this site, but did not find anthing useful.
Any help would be appreciated.
Thanks!
1. No. you don't have to upgrade your kernel
2. Yes, Not sure of how to do it.
3. You can manually mount if you want. But I suggest semi-auto way,
add the following line to your /etc/fstab
Code:
/dev/sda1 /mnt/pendrive vfat noauto,owner 0 0
then mkdir /mnt/pendrive
Not sure about KDE, but in gnome, under Computer icon on the desktop, the pendrive would appear.
Everytime you insert the pendrive, just doubleclick the pendrive icon in Computer folder. And it will automatically mount and open the window of contents.
Remember to right click and choose unmount before you remove the device.
3. You can manually mount if you want. But I suggest semi-auto way,
add the following line to your /etc/fstab
Code:
/dev/sda1 /mnt/pendrive vfat noauto,owner 0 0
then mkdir /mnt/pendrive
Not sure about KDE, but in gnome, under Computer icon on the desktop, the pendrive would appear.
Everytime you insert the pendrive, just doubleclick the pendrive icon in Computer folder. And it will automatically mount and open the window of contents.
Remember to right click and choose unmount before you remove the device. [/B]
carboncopy,
This works great. Seems so simple once you see how to do it. I changed one thing from your suggestions, to allow all users access to read and write to the USB device. I changed the "noauto,owner" to "noauto,user" so my fstab file looks like:
Code:
/dev/sda1 /mnt/pendrive vfat noauto,user 0 0
Thanks for this great tip!!
Last edited by freddie_leaf; 10-09-2004 at 10:28 AM.
This is only a small completion to carboncopy reply.
You can enable automatic recognizing of pluggable devices by "hotplug" + "udev".Unfortunately udev is available only with 2.6 kernel series. Have a look to /usr/doc/udev-026. There is a "satisfactory" explanation of how to ebable udev.
It works perfectly well with usb storage drives and usb printers. Not working properly with devices using pseudo-nodes (ie all in one scanner/printer/copier devices).
Hope this helps
Ciao
udev .... works perfectly well with usb storage drives and usb printers.
Perhaps you could help me. I've read the man pages for udev and figured out, I think, how things are supposed to work, but I am stuck.
I am trying to configure udev to solidfy usb devices names (so I can have one fstab that works for a bunch of usb devices regardless of the order they are plugged in). So far I have managed to get udev to identify my usb memory stick and create a node called /dev/usbkey when I plug the device in.
However, when I try to mount it I get:
mount: /dev/usbkey is not a block device
Before I started messing around writing udev rules I could mount it as sda1 or sda2 easily enough.
here's my fstab entry for the device:
/dev/usbkey /mnt/usbkey vfat noauto,users,rw 0 0
here's the old one that worked:
/dev/sda2 /mnt/usbkey vfat noauto,users,rw 0 0
here's my new udev rule:
BUS="usb", SYSFS{serial}="070B000109E0D60", NAME="usbkey"
I'd really appreciate any ideas or advice.
Thanks,
-geomatt
btw I am using slackware 10.0 with the 2.6.8 kernel
edit:
here's another clue: if I reboot leaving the usb key in the slot I can mount it.
udev read any "formatted" file in /etc/rules.d in lexical order. If you create your own rules, you have to make sure they are read before the "general purpose" udev.rules. A simple method is you create a file with customised rules and call it ie AA-udev.rules.
In this way you can override any general setup.
That worked for me.
Hope this helps
Ciao
urka58,
Thanks for the tip. I don't think that's the issue - the rule is being read and acted on - the device name in my custom rule is being created. It's just that once udev names the device it no longer gets recognized as a block device.
Here's what /var/log/messages records upon plugging in the usb key:
Oct 9 11:05:18 slack kernel: usb 1-3: new high speed USB device using address 8
Oct 9 11:05:18 slack kernel: scsi6 : SCSI emulation for USB Mass Storage devices
Oct 9 11:05:18 slack kernel: Vendor: USB Model: Flash Drive Rev: 1.12
Oct 9 11:05:18 slack kernel: Type: Direct-Access ANSI SCSI revision: 02
Oct 9 11:05:18 slack scsi.agent[6292]: how to add device type= at /devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host6/6:0:0:0 ??
Oct 9 11:05:18 slack kernel: SCSI device sda: 126973 512-byte hdwr sectors (65 MB)
Oct 9 11:05:18 slack kernel: sda: assuming Write Enabled
Oct 9 11:05:18 slack kernel: sda: sda2
Oct 9 11:05:18 slack kernel: Attached scsi removable disk sda at scsi6, channel 0, id 0, lun 0
Oct 9 11:05:18 slack kernel: Attached scsi generic sg0 at scsi6, channel 0, id 0, lun 0, type 0
Oct 9 11:05:18 slack udev[6322]: creating device node '/dev/sda2'
Oct 9 11:05:18 slack udev[6337]: configured rule in '/etc/udev/rules.d/10-local.rules' at line 4 applied, 'sg0' becomes 'usbkey'
Oct 9 11:05:18 slack udev[6337]: creating device node '/dev/usbkey'
Oct 9 11:05:19 slack udev[6313]: creating device node '/dev/sda'
Did you compiled the kernel from sources or are you using the generic 2.6.7 provided by slack "testing"?
It seems the scsi sg module is missing.
If using generic 2.6.7 I'd try loading that module to see what happen
Hope this helps
Ciao
From what I can tell so far that is probably the issue, but I am not sure how to fix it. I compiled 2.6.8 from source and can't figure out which listing in the .config file corresponds to scsi sg support. I tried modprobe scsi_sg, modprobe scsi-sg, modprobe sg and all give me the same result: FATAL: module not found. Any ideas?
In case it helps diagnose the problem here's the SCSI sections from my kernel .config file:
#
# SCSI device support
#
CONFIG_SCSI=y
CONFIG_SCSI_PROC_FS=y
#
# SCSI support type (disk, tape, CD-ROM)
#
CONFIG_BLK_DEV_SD=y
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
CONFIG_BLK_DEV_SR=y
# CONFIG_BLK_DEV_SR_VENDOR is not set
CONFIG_CHR_DEV_SG=y
#
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
#
# CONFIG_SCSI_MULTI_LUN is not set
# CONFIG_SCSI_CONSTANTS is not set
# CONFIG_SCSI_LOGGING is not set
#
# SCSI Transport Attributes
#
CONFIG_SCSI_SPI_ATTRS=m
# CONFIG_SCSI_FC_ATTRS is not set
#
# SCSI low-level drivers
#
CONFIG_BLK_DEV_3W_XXXX_RAID=m
# CONFIG_SCSI_3W_9XXX is not set
CONFIG_SCSI_7000FASST=m
CONFIG_SCSI_ACARD=m
CONFIG_SCSI_AHA152X=m
CONFIG_SCSI_AHA1542=m
CONFIG_SCSI_AACRAID=m
CONFIG_SCSI_AIC7XXX=m
CONFIG_AIC7XXX_CMDS_PER_DEVICE=8
CONFIG_AIC7XXX_RESET_DELAY_MS=15000
# CONFIG_AIC7XXX_BUILD_FIRMWARE is not set
# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
CONFIG_AIC7XXX_DEBUG_MASK=0
# CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set
CONFIG_SCSI_AIC7XXX_OLD=m
CONFIG_SCSI_AIC79XX=m
CONFIG_AIC79XX_CMDS_PER_DEVICE=32
CONFIG_AIC79XX_RESET_DELAY_MS=15000
# CONFIG_AIC79XX_BUILD_FIRMWARE is not set
# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
# CONFIG_AIC79XX_DEBUG_ENABLE is not set
CONFIG_AIC79XX_DEBUG_MASK=0
# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
CONFIG_SCSI_DPT_I2O=m
CONFIG_SCSI_IN2000=m
CONFIG_SCSI_MEGARAID=m
# CONFIG_SCSI_SATA is not set
CONFIG_SCSI_BUSLOGIC=m
# CONFIG_SCSI_OMIT_FLASHPOINT is not set
CONFIG_SCSI_DMX3191D=m
CONFIG_SCSI_DTC3280=m
CONFIG_SCSI_EATA=m
# CONFIG_SCSI_EATA_TAGGED_QUEUE is not set
# CONFIG_SCSI_EATA_LINKED_COMMANDS is not set
CONFIG_SCSI_EATA_MAX_TAGS=16
CONFIG_SCSI_EATA_PIO=m
CONFIG_SCSI_FUTURE_DOMAIN=m
CONFIG_SCSI_GDTH=m
CONFIG_SCSI_GENERIC_NCR5380=m
# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set
CONFIG_SCSI_GENERIC_NCR53C400=y
CONFIG_SCSI_IPS=m
CONFIG_SCSI_INIA100=m
CONFIG_SCSI_PPA=m
CONFIG_SCSI_IMM=m
CONFIG_SCSI_IZIP_EPP16=y
# CONFIG_SCSI_IZIP_SLOW_CTR is not set
CONFIG_SCSI_NCR53C406A=m
CONFIG_SCSI_SYM53C8XX_2=m
CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
# CONFIG_SCSI_IPR is not set
CONFIG_SCSI_PAS16=m
CONFIG_SCSI_PSI240I=m
CONFIG_SCSI_QLOGIC_FAS=m
CONFIG_SCSI_QLOGIC_ISP=m
CONFIG_SCSI_QLOGIC_FC=m
CONFIG_SCSI_QLOGIC_FC_FIRMWARE=y
CONFIG_SCSI_QLOGIC_1280=m
CONFIG_SCSI_QLA2XXX=y
# CONFIG_SCSI_QLA21XX is not set
# CONFIG_SCSI_QLA22XX is not set
# CONFIG_SCSI_QLA2300 is not set
# CONFIG_SCSI_QLA2322 is not set
# CONFIG_SCSI_QLA6312 is not set
# CONFIG_SCSI_QLA6322 is not set
CONFIG_SCSI_SYM53C416=m
# CONFIG_SCSI_DC395x is not set
CONFIG_SCSI_DC390T=m
CONFIG_SCSI_T128=m
CONFIG_SCSI_U14_34F=m
# CONFIG_SCSI_U14_34F_TAGGED_QUEUE is not set
# CONFIG_SCSI_U14_34F_LINKED_COMMANDS is not set
CONFIG_SCSI_U14_34F_MAX_TAGS=8
CONFIG_SCSI_ULTRASTOR=m
CONFIG_SCSI_NSP32=m
CONFIG_SCSI_DEBUG=m
Scsi sg was not the problem as you compiled the kernel with CONFIG_CHR_DEV_SG=y built in.
I'd try setting your own udev rules moving from the "usb" bus to "scsi". (it should be the upper section).
This is the output of my system. I marked with the arrows what I guess you should try according to your system configuration (I think it should be sda2 for you)
elio@darkstar:~$ udevinfo -a -p `udevinfo -q path -n /dev/sda1`
udevinfo starts with the device the node belongs to and then walks up the
device chain, to print for every device found, all possibly useful attributes
in the udev key format.
Only attributes within one device section may be used together in one rule,
to match the device for which the node will be created.
looking at class device '/sys/block/sda/sda1':
SYSFS{dev}="8:1"
SYSFS{size}="250592"
SYSFS{start}="32"
SYSFS{stat}=" 0 0 0 0"
follow the class device's "device"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host0/0:0:0:0':
BUS="scsi" ---------> use this
ID="0:0:0:0"
SYSFS{detach_state}="0"
SYSFS{device_blocked}="0"
SYSFS{max_sectors}="240"
SYSFS{model}="JUMPDRIVE " --------> use this
SYSFS{queue_depth}="1"
SYSFS{rev}="1.01"
SYSFS{scsi_level}="3"
SYSFS{state}="running"
SYSFS{timeout}="30"
SYSFS{type}="0"
SYSFS{vendor}="LEXAR " ---------------> use this
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host0':
BUS=""
ID="host0"
SYSFS{detach_state}="0"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0':
BUS="usb"
ID="3-1:1.0"
SYSFS{bAlternateSetting}=" 0"
SYSFS{bInterfaceClass}="08"
SYSFS{bInterfaceNumber}="00"
SYSFS{bInterfaceProtocol}="50"
SYSFS{bInterfaceSubClass}="06"
SYSFS{bNumEndpoints}="02"
SYSFS{detach_state}="0"
SYSFS{iInterface}="01"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.1/usb3':
BUS="usb"
ID="usb3"
SYSFS{bConfigurationValue}="1"
SYSFS{bDeviceClass}="09"
SYSFS{bDeviceProtocol}="00"
SYSFS{bDeviceSubClass}="00"
SYSFS{bMaxPower}=" 0mA"
SYSFS{bNumConfigurations}="1"
SYSFS{bNumInterfaces}=" 1"
SYSFS{bcdDevice}="0206"
SYSFS{bmAttributes}="c0"
SYSFS{detach_state}="0"
SYSFS{devnum}="1"
SYSFS{idProduct}="0000"
SYSFS{idVendor}="0000"
SYSFS{manufacturer}="Linux 2.6.7 uhci_hcd"
SYSFS{maxchild}="2"
SYSFS{product}="Intel Corp. 82801DB (ICH4) USB UHCI #2"
SYSFS{serial}="0000:00:1d.1"
SYSFS{speed}="12"
SYSFS{version}=" 1.10"
looking at the device chain at '/sys/devices/pci0000:00/0000:00:1d.1':
BUS="pci"
ID="0000:00:1d.1"
SYSFS{class}="0x0c0300"
SYSFS{detach_state}="0"
SYSFS{device}="0x24c4"
SYSFS{irq}="9"
SYSFS{subsystem_device}="0x8089"
SYSFS{subsystem_vendor}="0x1043"
SYSFS{vendor}="0x8086"
looking at the device chain at '/sys/devices/pci0000:00':
BUS=""
ID="pci0000:00"
SYSFS{detach_state}="0"
Hope this helps
Ciao
PS This is my AA-udev.rules, if you find it useful
# Prova per rinominare il pendrive secondo le regole udev
BUS="ide",KERNEL="hdc",NAME="%k",SYMLINK="dvd"
BUS="ide",KERNEL="hdd",NAME="%k",SYMLINK="dvdrw"
BUS="scsi",SYSFS{model}="JUMPDRIVE ",SYSFS{vendor}="LEXAR ",NAME="pendrive"
------------------------------------------------------------------------
To make sure I got the whitespace the same in the rule and the identifier I cut and pasted (don't know if this detail is relevant).
When I plug in the device /var/log/messages records as follows:
Oct 12 20:17:45 slack kernel: usb 1-3: new high speed USB device using address 7
Oct 12 20:17:45 slack kernel: scsi5 : SCSI emulation for USB Mass Storage devices
Oct 12 20:17:45 slack kernel: Vendor: USB Model: Flash Drive Rev: 1.12
Oct 12 20:17:45 slack kernel: Type: Direct-Access ANSI SCSI revision: 02
Oct 12 20:17:45 slack scsi.agent[4463]: how to add device type= at /devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/host5/5:0:0:0 ??
Oct 12 20:17:45 slack kernel: SCSI device sda: 126973 512-byte hdwr sectors (65 MB)
Oct 12 20:17:45 slack kernel: sda: assuming Write Enabled
Oct 12 20:17:45 slack kernel: sda: sda2
Oct 12 20:17:45 slack kernel: Attached scsi removable disk sda at scsi5, channel 0, id 0, lun 0
Oct 12 20:17:45 slack kernel: Attached scsi generic sg0 at scsi5, channel 0, id 0, lun 0, type 0
Oct 12 20:17:47 slack udev[4509]: configured rule in '/etc/udev/rules.d/10-local.rules' at line 4 applied, 'sda' becomes 'usbkey'
Oct 12 20:17:47 slack udev[4509]: creating device node '/dev/usbkey'
Oct 12 20:17:47 slack udev[4510]: configured rule in '/etc/udev/rules.d/10-local.rules' at line 4 applied, 'sda2' becomes 'usbkey'
Oct 12 20:17:47 slack udev[4510]: creating device node '/dev/usbkey'
Oct 12 20:17:47 slack udev[4512]: configured rule in '/etc/udev/rules.d/10-local.rules' at line 4 applied, 'sg0' becomes 'usbkey'
Oct 12 20:17:47 slack udev[4512]: creating device node '/dev/usbkey'
-----------------------------------------------------------------------
I'm about finishing the reasonable ideas.
as last chance I' would try editing your etc/fstab replacing the line
/dev/usbkey /mnt/usbkey auto noauto,users, rw 0 0
with
/dev/usbkey /mnt/usbkey vfat noauto,users, rw 0 0
I cannot understand why you're having so many problems. It worked for me very easily.
Anyway good luck
Ciao
I don't like the sound of that - especially because I've already tried changing the file type in /etc/fstab. Maybe there is something minor and stupid I'm doing wrong like misspelling something in a crucial file.
I should probably also try with a second or third usb key device to see if it is something odd about the one I've been using.
Rather than using my own name - I just let the kernel name the devices and use a symlink. And I included the the key KERNEL="sda*" to convince udev that it is in fact a block device (I think that's what it does anyway).
Whew!
Now I'll see what happens when I try adding other devices to my rules list. Should get mighty confusing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.