Hello, >> hmm... how can I "catch" which is the label of the attached disk? > > > "ls -l /dev/disk/by-label" will tell you if there is any current label on > the filesystems. Look: > > s...@stt008:~$ ls -l /dev/disk/by-label > total 0 > lrwxrwxrwx 1 root root 10 mar 17 07:50 ALFA -> ../../sda2 > lrwxrwxrwx 1 root root 10 mar 17 07:50 system2 -> ../../sda3 > > I use to specify a label on partitions at install time, when formatting, > even though I do not use it :-P.
thanks, sorry I think we don't understand each other... I know how can I determine labels, I would like to make some elegant way for user plug USB disk, and udev catch that event, send an email for me which contains serial part of disk. I think I can do that just udev calls a script which read the label... >> 'Cause (theorerically) udev gives disk id by disk phisycal attributes, eg >> serial... >> Label is _not_ a phisycal attribute (as I know). > > > Well, it's a physical attribute as soon as you write it on the disk :-) It's good for a joke... :) >> Is there any way? > > You said before something about writting udev rules "to differentiate the > disks". What is your main purpose on this? I mean, you can mount them > using their "label" nomenclature :-? no, the system is so far for me, I just administrate it. There are two disks for backups. Users (near system) change disks every monday. They need to know, which is the next disk (eg.: user misses change disk at last week...) After the user plugs new disk it need to send a notify message, backup disk has changed, and which is the new disk. So, I belived it till now udev and rules can handle this - udev calls a script with a parameter, and scripts send a mail - but now it need to find the label/correct id, and after it can send the mail. >>> Yes, but they get a different ID: one disks lasts with "B000" and the >>> other with "B0008". Curious :-S >> >> hmmm... I think they didn't _get_ serial - they _have_ serial. and my >> problem is system can't recognize that. And it's more than curious... :P > > I'm not sure this works when using USB enclosures (as not all ATA > commands are passed to "smart"), but it is worth a try: > > smartctl -i /dev/sdb > smartctl -i /dev/sdc meantime a user unplugs disks, so _currently_ I can't check it out. > And put here the output (if any). That should give us more information > (serial number, firmware release, etc...) about the drives. ok, thanks. > It's possible the drives have indeed the same serial number, or just that > udev is not gathering the right information from the right place, who > knows... we have to dig a bit more. no, I'm sure it's not, 'cause the symlinks couldn't shows different serial... (and it's been working a few months ago - may be the last update messes it...? it was in January) thank you for your help: a -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/ed4274f21003170755n15396eb1qb20cb6548123d...@mail.gmail.com