Re: [gentoo-user] help with UDEV and USB flash drive
Am Freitag, 9. Juni 2006 10:12 schrieb ext Daevid Vincent: Can someone tell me what I am doing wrong? locutus mnt # cat /etc/udev/rules.d/local.rules # This is for my Intelligent Stick USB Memory flash drive BUS==usb, SYSFS{serial}==20031112223132-01, NAME=istick, MODE=0666 BUS==scsi and I would also use SYMLINK=istick%n instead of NAME. I'd also guess that the SYSFS{serial} is not the one of the stick, but four your USB hub. locutus linux # cat /etc/fstab # Intelligent Stick flash drive (UDEV) /dev/istick /mnt/istick vfat defaults,noauto,user,umask=000 0 0 locutus linux # ll /dev/istick crw-rw-rw- 1 root root 21, 1 Jun 9 00:32 /dev/istick This is a character device. So, why doesn't my /dev/istick work? I assume it has to do with that 'b' on /dev/sda1 and the 'c' on /dev/istick Yes. You should also read http://www.reactivated.net/writing_udev_rules.html. HTH... Dirk -- Dirk Heinrichs | Tel: +49 (0)162 234 3408 Configuration Manager | Fax: +49 (0)211 47068 111 Capgemini Deutschland | Mail: [EMAIL PROTECTED] Hambornerstraße 55 | Web: http://www.capgemini.com D-40472 Düsseldorf | ICQ#: 110037733 GPG Public Key C2E467BB | Keyserver: www.keyserver.net pgpEcBuaBp38B.pgp Description: PGP signature
Re: [gentoo-user] help with UDEV and USB flash drive
On Fri, 9 Jun 2006 01:12:50 -0700, Daevid Vincent wrote: I've been googling and hacking at this for about three hours now. Can someone tell me what I am doing wrong? locutus mnt # cat /etc/udev/rules.d/local.rules # This is for my Intelligent Stick USB Memory flash drive BUS==usb, SYSFS{serial}==20031112223132-01, NAME=istick, MODE=0666 This should be in /etc/udev/rules.d/10-local.rules, so it is processed before the default rules, but that's not the problem here. locutus linux # cat /etc/fstab # Intelligent Stick flash drive (UDEV) /dev/istick /mnt/istick vfat defaults,noauto,user,umask=000 0 0 locutus linux # ll /dev/istick crw-rw-rw- 1 root root 21, 1 Jun 9 00:32 /dev/istick locutus linux # mount /dev/istick mount: /dev/istick is not a block device That's because you are trying to mount the whole device, not the partition. locutus linux # ll /dev/sda1 brw-rw 1 root disk 8, 1 Jun 9 00:32 /dev/sda1 locutus linux # mount -t vfat /dev/sda1 /mnt/istick/ locutus linux # ls /mnt/istick/ MIDI Files pwsafe.key Now you are mounting the partition. So, why doesn't my /dev/istick work? I assume it has to do with that 'b' on /dev/sda1 and the 'c' on /dev/istick Yes, it's not a block device. Change the NAME part of the rule to NAME=istick%n and mount /dev/istick1. Or just set up a rule to match the partition. This is the sort of thing I use for a USB stick BUS==usb, KERNEL==sd?1, SYSFS{idProduct}==0845, SYSFS{idVendor}==08ec, NAME=gigabyte, SYMLINK=%k usb/gigabyte I don't use fstab, but let KDE/HAL/pmount mount it on /media/gigabyte. But I could put /dev/gigabyte in fstab if I didn't want automounting. -- Neil Bothwick Any sufficiently advanced bug is indistinguishable from a feature. signature.asc Description: PGP signature
Re: [gentoo-user] help with UDEV and USB flash drive
Am Freitag, 9. Juni 2006 10:35 schrieb ext Neil Bothwick: That's because you are trying to mount the whole device, not the partition. Even the whole device should be a block device, shouldn't it? And if it had a filesystem, you could even mount it, having one partition is as good as having no partition, at least for Linux. BUS==usb, KERNEL==sd?1, SYSFS{idProduct}==0845, SYSFS{idVendor}==08ec, NAME=gigabyte, SYMLINK=%k usb/gigabyte OK, here is what I do :-) BUS==scsi, KERNEL==sd*, SYSFS{model}==HardDrive , SYSFS{rev}==1.11, SYSFS{vendor}==32MB, SYMLINK=usb/stick%n This will give me nodes for the device itself and its partitions. Bye... Dirk -- Dirk Heinrichs | Tel: +49 (0)162 234 3408 Configuration Manager | Fax: +49 (0)211 47068 111 Capgemini Deutschland | Mail: [EMAIL PROTECTED] Hambornerstraße 55 | Web: http://www.capgemini.com D-40472 Düsseldorf | ICQ#: 110037733 GPG Public Key C2E467BB | Keyserver: www.keyserver.net pgpHom1m8TpPt.pgp Description: PGP signature
Re: [gentoo-user] help with UDEV and USB flash drive
On Fri, 9 Jun 2006 10:59:13 +0200, Dirk Heinrichs wrote: That's because you are trying to mount the whole device, not the partition. Even the whole device should be a block device, shouldn't it? Yes it should, it's podd that is appears as a character device. And if it had a filesystem, you could even mount it, having one partition is as good as having no partition, at least for Linux. It's not the same. A filesystem on a single partition filling the device is not the same as a filesystem on the device itself. Both are possible, and mountable, but not at the same time. I've just checked with with a single partition device to be sure, it didn't work. BUS==usb, KERNEL==sd?1, SYSFS{idProduct}==0845, SYSFS{idVendor}==08ec, NAME=gigabyte, SYMLINK=%k usb/gigabyte OK, here is what I do :-) BUS==scsi, KERNEL==sd*, SYSFS{model}==HardDrive , SYSFS{rev}==1.11, SYSFS{vendor}==32MB, SYMLINK=usb/stick%n This will give me nodes for the device itself and its partitions. I do that for some drives, but my USB sticks are always a single partition, so I give the name to the partition not the device. I also set NAME and put %k in SYMLINK, because pmount uses the name to create the directory in /media, and I want the device mounted at /media/somethingmeaningful, not /media/sdxn. -- Neil Bothwick This fortune soaks up 47 times its own weight in excess memory. signature.asc Description: PGP signature
Re: [gentoo-user] help with UDEV and USB flash drive
Am Freitag, 9. Juni 2006 12:16 schrieb ext Neil Bothwick: On Fri, 9 Jun 2006 10:59:13 +0200, Dirk Heinrichs wrote: That's because you are trying to mount the whole device, not the partition. Even the whole device should be a block device, shouldn't it? Yes it should, it's podd that is appears as a character device. It isn't. Read my very first answer. And if it had a filesystem, you could even mount it, having one partition is as good as having no partition, at least for Linux. It's not the same. A filesystem on a single partition filling the device is not the same as a filesystem on the device itself. Both are possible, and mountable, but not at the same time. I've just checked with with a single partition device to be sure, it didn't work. Of course not at the same time, thought that would be clear :-) I do that for some drives, but my USB sticks are always a single partition, so I give the name to the partition not the device. I also set NAME and put %k in SYMLINK, because pmount uses the name to create the directory in /media, and I want the device mounted at /media/somethingmeaningful, not /media/sdxn. Good point, I switched to hal/dbus not long ago. Seems I need to rework my rules :-) Bye... Dirk -- Dirk Heinrichs | Tel: +49 (0)162 234 3408 Configuration Manager | Fax: +49 (0)211 47068 111 Capgemini Deutschland | Mail: [EMAIL PROTECTED] Hambornerstraße 55 | Web: http://www.capgemini.com D-40472 Düsseldorf | ICQ#: 110037733 GPG Public Key C2E467BB | Keyserver: www.keyserver.net pgpYoklvEj6PH.pgp Description: PGP signature
Re: [gentoo-user] help with UDEV and USB flash drive
Am Freitag, 9. Juni 2006 10:12 schrieb ext Daevid Vincent: Another hint: locutus mnt # cat /etc/udev/rules.d/local.rules # This is for my Intelligent Stick USB Memory flash drive BUS==usb, SYSFS{serial}==20031112223132-01, NAME=istick, MODE=0666 locutus linux # cat /etc/fstab # Intelligent Stick flash drive (UDEV) /dev/istick /mnt/istick vfat defaults,noauto,user,umask=000 0 0 locutus linux # ll /dev/istick crw-rw-rw- 1 root root 21, 1 Jun 9 00:32 /dev/istick The device has major number 21, and char device 21 is SCSI generic, not SCSI disk (which is block device 8, see below). This may come from not having KERNEL==sd* in your rule. locutus linux # ll /dev/sda1 brw-rw 1 root disk 8, 1 Jun 9 00:32 /dev/sda1 Bye... Dirk -- Dirk Heinrichs | Tel: +49 (0)162 234 3408 Configuration Manager | Fax: +49 (0)211 47068 111 Capgemini Deutschland | Mail: [EMAIL PROTECTED] Hambornerstraße 55 | Web: http://www.capgemini.com D-40472 Düsseldorf | ICQ#: 110037733 GPG Public Key C2E467BB | Keyserver: www.keyserver.net pgpW6l7NjoYh4.pgp Description: PGP signature
RE: [gentoo-user] help with UDEV and USB flash drive
Thanks everybody that was the trick. I settled upon this: BUS==usb, KERNEL==sd?1, SYSFS{idVendor}==0ef5, SYSFS{idProduct}==2202, SYMLINK=istick%n, MODE=0666 And for my /etc/fstab entry: /dev/istick1 /mnt/istick vfat defaults,noauto,user,umask=000 0 0 Now the second part of this. SOMETIMES, when I plug the stick in (I assume that's when it happens), KDE gives me a nice little window to view the files or take no action. But it's not consistent?! What triggers that 'event', and how can I make it happen all the time? Also related, is there an easy way to make this stick auto un/mount upon removal/insertion respectively? I tried taking out the 'noauto' in fstab, but that didn't do it. I saw some web search results, but most of them feel outdated, or for other distros. DÆVID -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] help with UDEV and USB flash drive
On 09/06/06, Daevid Vincent [EMAIL PROTECTED] wrote: Also related, is there an easy way to make this stick auto un/mount upon removal/insertion respectively? Try looking into autofs .. simple to setup and works really well for me with my USB/CD-ROM devices. Mark -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] help with UDEV and USB flash drive
On 6/9/06, Daevid Vincent [EMAIL PROTECTED] wrote: Thanks everybody that was the trick. I settled upon this: BUS==usb, KERNEL==sd?1, SYSFS{idVendor}==0ef5, SYSFS{idProduct}==2202, SYMLINK=istick%n, MODE=0666 One problem with this. Udev will apply all matching rules until it finds one with a NAME entry. So you probably want MODE:=0666 to prevent any later rules from overwriting your mode. -Richard -- gentoo-user@gentoo.org mailing list
RE: [gentoo-user] help with UDEV and USB flash drive
-Original Message- From: Daevid Vincent [EMAIL PROTECTED] Subj: RE: [gentoo-user] help with UDEV and USB flash drive Date: Fri 9 Jun 2006 20:32 Size: 848 bytes To: gentoo-user@lists.gentoo.org Now the second part of this. SOMETIMES, when I plug the stick in (I assume that's when it happens), KDE gives me a nice little window to view the files or take no action. But it's not consistent?! What triggers that 'event', and how can I make it happen all the time? KDE uses HAL for this, but it can take a few seconds to see the device. You don't need an fstab entry for this, it may even confuse things. Also related, is there an easy way to make this stick auto un/mount upon removal/insertion respectively? KDE will do that, and open a window too if you want it. It is set in the Control Centre. -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] help with UDEV and USB flash drive
Richard Fish wrote: One problem with this. Udev will apply all matching rules until it finds one with a NAME entry. So you probably want MODE:=0666 to prevent any later rules from overwriting your mode. This isn't entirely true, udev doesn't stop at NAME any more. It stops at the end of the rules files, or when it sees OPTIONS=last_rule. Daniel -- gentoo-user@gentoo.org mailing list
Re: [gentoo-user] help with UDEV and USB flash drive
On 6/9/06, Daniel Drake [EMAIL PROTECTED] wrote: Richard Fish wrote: One problem with this. Udev will apply all matching rules until it finds one with a NAME entry. So you probably want MODE:=0666 to prevent any later rules from overwriting your mode. This isn't entirely true, udev doesn't stop at NAME any more. It stops at the end of the rules files, or when it sees OPTIONS=last_rule. Ah, thanks. Sadly, this change is not noted in /usr/share/doc/udev-*/RELEASE-NOTES.gz file. The 057 notes specify the stop-on-NAME behavior, and nothing newer (at least through 090) retracts that statement. -Richard -- gentoo-user@gentoo.org mailing list