LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices

Reply
 
Search this Thread
Old 06-08-2007, 04:27 AM   #31
sulvereagle59
Member
 
Registered: May 2007
Location: Portland, Oregon
Distribution: Slackware 11
Posts: 42

Original Poster
Rep: Reputation: 15

BUS=="scsi", KERNEL=="sd*", SYSFS {model}=="5000AAKS Externa", NAME="My Book",SYMLINK+="usbhd%n"

information gotten from
Quote:
root@darkstar:/home/david# udevinfo -a -p /sys/block/sde

Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

looking at device '/block/sde':
KERNEL=="sde"
SUBSYSTEM=="block"
DRIVER==""
SYSFS{stat}==" 34 215 565 756 0 0 0 0 0 496 756"
SYSFS{size}=="976773168"
SYSFS{removable}=="0"
SYSFS{range}=="16"
SYSFS{dev}=="8:64"

looking at parent device '/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1.2/1-1.2:1.0/host1/target1:0:0/1:0:0:0':
ID=="1:0:0:0"
BUS=="scsi"
DRIVER=="sd"
SYSFS{ioerr_cnt}=="0x0"
SYSFS{iodone_cnt}=="0x29"
SYSFS{iorequest_cnt}=="0x29"
SYSFS{iocounterbits}=="32"
SYSFS{timeout}=="30"
SYSFS{state}=="running"
SYSFS{rev}=="101a"
SYSFS{model}=="5000AAKS Externa"
SYSFS{vendor}=="WD "
SYSFS{scsi_level}=="3"
SYSFS{type}=="0"
SYSFS{queue_type}=="none"
SYSFS{queue_depth}=="1"
SYSFS{device_blocked}=="0"
SYSFS{max_sectors}=="240"
 
Old 06-08-2007, 04:36 AM   #32
sulvereagle59
Member
 
Registered: May 2007
Location: Portland, Oregon
Distribution: Slackware 11
Posts: 42

Original Poster
Rep: Reputation: 15
OK I am confused on which BUS i should use sinbce there are at least 2 listed in this here is everything that udevinfo -a -p /sys/block/sde supplied me.

Quote:
root@darkstar:/home/david# udevinfo -a -p /sys/block/sde

Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

looking at device '/block/sde':
KERNEL=="sde"
SUBSYSTEM=="block"
DRIVER==""
SYSFS{stat}==" 34 215 565 756 0 0 0 0 0 496 756"
SYSFS{size}=="976773168"
SYSFS{removable}=="0"
SYSFS{range}=="16"
SYSFS{dev}=="8:64"

looking at parent device '/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1.2/1-1.2:1.0/host1/target1:0:0/1:0:0:0':
ID=="1:0:0:0"
BUS=="scsi"
DRIVER=="sd"
SYSFS{ioerr_cnt}=="0x0"
SYSFS{iodone_cnt}=="0x29"
SYSFS{iorequest_cnt}=="0x29"
SYSFS{iocounterbits}=="32"
SYSFS{timeout}=="30"
SYSFS{state}=="running"
SYSFS{rev}=="101a"
SYSFS{model}=="5000AAKS Externa"
SYSFS{vendor}=="WD "
SYSFS{scsi_level}=="3"
SYSFS{type}=="0"
SYSFS{queue_type}=="none"
SYSFS{queue_depth}=="1"
SYSFS{device_blocked}=="0"
SYSFS{max_sectors}=="240"

looking at parent device '/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1.2/1-1.2:1.0/host1/target1:0:0':
ID=="target1:0:0"
BUS==""
DRIVER==""

looking at parent device '/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1.2/1-1.2:1.0/host1':
ID=="host1"
BUS==""
DRIVER==""

looking at parent device '/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1.2/1-1.2:1.0':
ID=="1-1.2:1.0"
BUS=="usb"
DRIVER=="usb-storage"
SYSFS{interface}=="Interface0"
SYSFS{modalias}=="usb:v1058p0900d0000dc00dsc00dp00ic08isc06ip50"
SYSFS{bInterfaceProtocol}=="50"
SYSFS{bInterfaceSubClass}=="06"
SYSFS{bInterfaceClass}=="08"
SYSFS{bNumEndpoints}=="02"
SYSFS{bAlternateSetting}==" 0"
SYSFS{bInterfaceNumber}=="00"

looking at parent device '/devices/pci0000:00/0000:00:07.2/usb1/1-1/1-1.2':
ID=="1-1.2"
BUS=="usb"
DRIVER=="usb"
SYSFS{configuration}=="Config0"
SYSFS{serial}=="57442D574341505730333539303535"
SYSFS{product}=="External HDD"
SYSFS{manufacturer}=="Western Digital"
SYSFS{maxchild}=="0"
SYSFS{version}==" 2.00"
SYSFS{devnum}=="9"
SYSFS{speed}=="12"
SYSFS{bMaxPacketSize0}=="64"
SYSFS{bNumConfigurations}=="1"
SYSFS{bDeviceProtocol}=="00"
SYSFS{bDeviceSubClass}=="00"
SYSFS{bDeviceClass}=="00"
SYSFS{bcdDevice}=="0000"
SYSFS{idProduct}=="0900"
SYSFS{idVendor}=="1058"
SYSFS{bMaxPower}==" 0mA"
SYSFS{bmAttributes}=="c0"
SYSFS{bConfigurationValue}=="1"
SYSFS{bNumInterfaces}==" 1"

looking at parent device '/devices/pci0000:00/0000:00:07.2/usb1/1-1':
ID=="1-1"
BUS=="usb"
DRIVER=="usb"
SYSFS{configuration}==""
SYSFS{maxchild}=="4"
SYSFS{version}==" 1.10"
SYSFS{devnum}=="2"
SYSFS{speed}=="12"
SYSFS{bMaxPacketSize0}=="8"
SYSFS{bNumConfigurations}=="1"
SYSFS{bDeviceProtocol}=="00"
SYSFS{bDeviceSubClass}=="00"
SYSFS{bDeviceClass}=="09"
SYSFS{bcdDevice}=="0125"
SYSFS{idProduct}=="2046"
SYSFS{idVendor}=="0451"
SYSFS{bMaxPower}==" 0mA"
SYSFS{bmAttributes}=="e0"
SYSFS{bConfigurationValue}=="1"
SYSFS{bNumInterfaces}==" 1"

looking at parent device '/devices/pci0000:00/0000:00:07.2/usb1':
ID=="usb1"
BUS=="usb"
DRIVER=="usb"
SYSFS{configuration}==""
SYSFS{serial}=="0000:00:07.2"
SYSFS{product}=="UHCI Host Controller"
SYSFS{manufacturer}=="Linux 2.6.17.13 uhci_hcd"
SYSFS{maxchild}=="2"
SYSFS{version}==" 1.10"
SYSFS{devnum}=="1"
SYSFS{speed}=="12"
SYSFS{bMaxPacketSize0}=="64"
SYSFS{bNumConfigurations}=="1"
SYSFS{bDeviceProtocol}=="00"
SYSFS{bDeviceSubClass}=="00"
SYSFS{bDeviceClass}=="09"
SYSFS{bcdDevice}=="0206"
SYSFS{idProduct}=="0000"
SYSFS{idVendor}=="0000"
SYSFS{bMaxPower}==" 0mA"
SYSFS{bmAttributes}=="e0"
SYSFS{bConfigurationValue}=="1"
SYSFS{bNumInterfaces}==" 1"

looking at parent device '/devices/pci0000:00/0000:00:07.2':
ID=="0000:00:07.2"
BUS=="pci"
DRIVER=="uhci_hcd"
SYSFS{modalias}=="pci:v00008086d00007112sv00000000sd00000000bc0Csc03i00"
SYSFS{local_cpus}=="1"
SYSFS{irq}=="11"
SYSFS{class}=="0x0c0300"
SYSFS{subsystem_device}=="0x0000"
SYSFS{subsystem_vendor}=="0x0000"
SYSFS{device}=="0x7112"
SYSFS{vendor}=="0x8086"

looking at parent device '/devices/pci0000:00':
ID=="pci0000:00"
BUS==""
DRIVER==""

root@darkstar:/home/david#
 
Old 06-08-2007, 05:30 AM   #33
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
"Writing udev rules" says you should use things in your rule that come from the same section only. So, for example, you could use

BUS=="scsi", DRIVER=="sd", SYSFS{model}=="5000AAKS Externa", SYSFS{vendor}=="WD "

in your rule, taking stuff from the second section of your output from udevinfo. Edit: obviously this isn't a complete rule as there's no NAME or SYMLINK in it.

Last edited by Nylex; 06-08-2007 at 05:38 AM.
 
Old 06-08-2007, 06:31 AM   #34
sulvereagle59
Member
 
Registered: May 2007
Location: Portland, Oregon
Distribution: Slackware 11
Posts: 42

Original Poster
Rep: Reputation: 15
OK, after writing the rule (with KWrite) an placing it in it's proper folder how do I find out if it worked or not? where do I look to see if it did?
 
Old 06-08-2007, 06:37 AM   #35
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
What did you use for NAME and/or SYMLINK in your rule? Check if there's a node in /dev with that name. You can do this with ls, e.g. if you named the device "usbdisk", run "ls /dev/usbdisk" and see if there's anything there.
 
Old 06-08-2007, 06:58 AM   #36
sulvereagle59
Member
 
Registered: May 2007
Location: Portland, Oregon
Distribution: Slackware 11
Posts: 42

Original Poster
Rep: Reputation: 15
OK, this is exactly what I have for the rule
Quote:
BUS=="scsi", DRIVER=="sd", SYSFS{model}=="5000AAKS Externa", SYSFS{vendor}=="WD ", NAME="mybook", SYMLINK+="usbhd%n"
but it did not seem to work since when I out in
Quote:
ls /dev/mybook
I get the following message
Quote:
/bin/ls: /dev/mybook: No such file or directory
So what is it that I have done wrong?
 
Old 06-08-2007, 07:01 AM   #37
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Try disconnecting the device (unmount it before doing so, if it's mounted) and reconnecting it and then trying again. Sometimes I have this with udev when adding a new rule.
 
Old 06-08-2007, 07:11 AM   #38
sulvereagle59
Member
 
Registered: May 2007
Location: Portland, Oregon
Distribution: Slackware 11
Posts: 42

Original Poster
Rep: Reputation: 15
Nothing Now should I try taking davids.rules out of the folder 10-local.rules and placing it in the folder rules.d??
 
Old 06-08-2007, 08:57 AM   #39
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Yes. Try renaming the file to 10-local.rules as well. Edit: also see the "Debugging your rules" section in "writing udev rules".

Last edited by Nylex; 06-08-2007 at 09:04 AM.
 
Old 06-08-2007, 11:21 AM   #40
sulvereagle59
Member
 
Registered: May 2007
Location: Portland, Oregon
Distribution: Slackware 11
Posts: 42

Original Poster
Rep: Reputation: 15
OK, I ran a udevtest and this was the results maybe it can help in determining what is happening. Only thing is I have no idea of what to look for to fix anything.Here is what the results from the test give

Quote:
root@darkstar:/dev# udevtest /block/sde
main: looking at device '/block/sde' from subsystem 'block'
udev_rules_get_name: rule applied, 'sde' becomes 'sde'
run_program: '/lib/udev/usb_id -x'
run_program: '/lib/udev/usb_id' (stdout) 'ID_VENDOR=WD'
run_program: '/lib/udev/usb_id' (stdout) 'ID_MODEL=5000AAKS_Externa'
run_program: '/lib/udev/usb_id' (stdout) 'ID_REVISION=101a'
run_program: '/lib/udev/usb_id' (stdout) 'ID_SERIAL=WD_5000AAKS_Externa_57442D574341505730333539303535'
run_program: '/lib/udev/usb_id' (stdout) 'ID_TYPE=disk'
run_program: '/lib/udev/usb_id' (stdout) 'ID_BUS=usb'
run_program: '/lib/udev/usb_id' returned with status 0
udev_rules_get_name: add symlink 'disk/by-id/usb-WD_5000AAKS_Externa_57442D574341505730333539303535'
run_program: '/lib/udev/path_id /block/sde'
run_program: '/lib/udev/path_id' (stdout) 'ID_PATH=pci-0000:00:07.2-usb-0:1.2:1.0-scsi-0:0:0:0'
run_program: '/lib/udev/path_id' returned with status 0
udev_rules_get_name: add symlink 'disk/by-path/pci-0000:00:07.2-usb-0:1.2:1.0-scsi-0:0:0:0'
run_program: '/lib/udev/vol_id --export /dev/.tmp-8-64'
run_program: '/lib/udev/vol_id' (stderr) '/dev/.tmp-8-64: unknown volume type'
run_program: '/lib/udev/vol_id' returned with status 4
run_program: '/lib/udev/edd_id --export /dev/.tmp-8-64'
run_program: '/lib/udev/edd_id' (stderr) 'no kernel EDD support'
run_program: '/lib/udev/edd_id' returned with status 2
udev_device_event: device '/block/sde' already in database, validate currently present symlinks
udev_node_add: creating device node '/dev/sde', major = '8', minor = '64', mode = '0660', uid = '0', gid = '6'
udev_node_add: creating symlink '/dev/disk/by-id/usb-WD_5000AAKS_Externa_57442D574341505730333539303535' to '../../sde'
udev_node_add: creating symlink '/dev/disk/by-path/pci-0000:00:07.2-usb-0:1.2:1.0-scsi-0:0:0:0' to '../../sde'
main: run: 'socket:/org/kernel/udev/monitor'

Last edited by sulvereagle59; 06-08-2007 at 11:23 AM.
 
Old 06-08-2007, 11:49 AM   #41
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Looking at that output, it does appear that your rules aren't being applied. When you wrote the rule, you didn't split it on to two lines did you?
 
Old 06-08-2007, 12:41 PM   #42
sulvereagle59
Member
 
Registered: May 2007
Location: Portland, Oregon
Distribution: Slackware 11
Posts: 42

Original Poster
Rep: Reputation: 15
OK after some playing around I have finally gotten the rule to work and also wrote a couple more and they are working

Here is what i did
Quote:
BUS=="usb", KERNEL=="sd*", SYSFS{product}=="External HDD", NAME="mybook", SYMLINK+="usbhd%n" (this for my HD)

BUS=="usb", KERNEL=="sd*", SYSFS{product}=="Cruzer Micro", NAME="flashdrive", SYMLINK+="usb-storage" (this is for one of my flashdrives)

BUS=="usb", KERNEL=="sd*", SYSFS{product}=="Flash Disk", NAME="flashdrive", SYMLINK+="usb-storage" (this for my other flashdrive
Now the question is what do I have to add to my /etc/fstab so that they depending on what I have loaded I can easily mount to be able to use?
 
Old 06-08-2007, 01:06 PM   #43
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Are you sure you're a newbie?

In your fstab, you can now just use the symlinks as the device name in the first column and everything else as before. So, for your external hard disk, you used to have an entry like this:

/dev/sda2 /E vfat noauto,user,rw,exec,sync 0 0

You can now change the "/dev/sda2" to "/dev/usbhd2". The partition numbers are the same as before. I think you needed to mount /dev/sda5 to get it to work, right? So you'd actually use /dev/usbhd5. Does that make sense?

Similarly, just add an entry for your flash drives using /dev/usb-storage in the first column.
Here are my two entries

/dev/flash /mnt/memory vfat noauto,users 0 0
/dev/music /mnt/music vfat noauto,users 0 0

One's for my flash drive and the other is for my digital audio player.

Like you, I've got two flash drives and my udev rules are set up to call them both "flash". I don't know what would happen if I tried plugging them both in at the same time. I think maybe you'd have to use different names, rather than "usb-storage" for both.

Last edited by Nylex; 06-08-2007 at 01:12 PM.
 
Old 06-08-2007, 01:54 PM   #44
sulvereagle59
Member
 
Registered: May 2007
Location: Portland, Oregon
Distribution: Slackware 11
Posts: 42

Original Poster
Rep: Reputation: 15
Thank you so much for your help. I have now got all my drives loaded and configured in fstab and are working great.
 
Old 06-08-2007, 01:55 PM   #45
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Yay, good to hear .
 
  


Reply

Tags
hd, mount


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie seeking help with FTP cdawley4 Linux - Networking 2 07-28-2005 07:02 AM
A newbie is seeking for document about linux programing TruongAn Programming 4 02-21-2005 09:12 PM
newbie seeking help with initial mysql installation marvc Linux - Software 14 04-14-2003 07:05 PM
newbie seeking advice on properly configuring server marvc Linux - General 3 03-29-2003 03:45 PM
Real newbie seeking info for learning. DaDdY SnEb Linux - General 5 06-19-2002 04:58 PM


All times are GMT -5. The time now is 01:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration