You are not logged in.

#1 2012-01-30 10:27:20

indianahorst
Member
Registered: 2008-08-23
Posts: 129

[Solved] udev rules: serial for persistent device naming disappeared

Hello,

since the latest upgrade of udev and kmod I cant't mount my external e-SATA hard disk with my working udev rules.

This is my udev rule:

$ cat /etc/udev/rules.d/66-persistent_esata.rules

KERNEL=="sd?1", SUBSYSTEMS=="block", ENV{ID_SERIAL_SHORT}=="S1VSJ1LS301247", NAME="aluguard"

When plugged in, I could decrypt and mount it with "sudo cryptsetup luksOpen /dev/aluguard aluguard && mount /mnt/aluguard".

Since the update above I get "Device /dev/aluguard doesn't exist or access denied."
While I re-checked https://wiki.archlinux.org/index.php/Ma … _with_udev, I discovered, that the serial entry in the output of udevadm has vanished:

 $ udevadm info -a -p $(udevadm info -q path -n /dev/sdg)

Udevadm info 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 '/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sdg':
    KERNEL=="sdg"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{range}=="16"
    ATTR{ext_range}=="256"
    ATTR{removable}=="0"
    ATTR{ro}=="0"
    ATTR{size}=="1953525168"
    ATTR{alignment_offset}=="0"
    ATTR{discard_alignment}=="0"
    ATTR{capability}=="50"
    ATTR{stat}=="      96       24      762      780        0        0        0        0        0      780      780"
    ATTR{inflight}=="       0        0"
    ATTR{events}==""
    ATTR{events_async}==""
    ATTR{events_poll_msecs}=="-1"

  looking at parent device '/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0':
    KERNELS=="3:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sd"
    ATTRS{device_blocked}=="0"
    ATTRS{type}=="0"
    ATTRS{scsi_level}=="6"
    ATTRS{vendor}=="ATA     "
    ATTRS{model}=="SAMSUNG HD103SI "
    ATTRS{rev}=="1AG0"
    ATTRS{state}=="running"
    ATTRS{timeout}=="30"
    ATTRS{iocounterbits}=="32"
    ATTRS{iorequest_cnt}=="0xa2"
    ATTRS{iodone_cnt}=="0x98"
    ATTRS{ioerr_cnt}=="0xc"
    ATTRS{evt_media_change}=="0"
    ATTRS{queue_depth}=="31"
    ATTRS{queue_ramp_up_period}=="120000"
    ATTRS{queue_type}=="simple"

  looking at parent device '/devices/pci0000:00/0000:00:09.0/host3/target3:0:0':
    KERNELS=="target3:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:09.0/host3':
    KERNELS=="host3"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:09.0':
    KERNELS=="0000:00:09.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="ahci"
    ATTRS{vendor}=="0x10de"
    ATTRS{device}=="0x0554"
    ATTRS{subsystem_vendor}=="0x1849"
    ATTRS{subsystem_device}=="0x0554"
    ATTRS{class}=="0x010601"
    ATTRS{irq}=="23"
    ATTRS{local_cpus}=="00000000,00000003"
    ATTRS{local_cpulist}=="0-1"
    ATTRS{numa_node}=="0"
    ATTRS{dma_mask_bits}=="64"
    ATTRS{consistent_dma_mask_bits}=="64"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

What is the reason for this strange behaviour, and how can I get back the serial entry?
Thank in advance!

Last edited by indianahorst (2012-01-31 13:03:20)

Offline

#2 2012-01-30 11:02:19

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved] udev rules: serial for persistent device naming disappeared

It'd be more useful to look at the output of:

udevadm info -q all -n /dev/sdg1

Offline

#3 2012-01-30 11:25:58

indianahorst
Member
Registered: 2008-08-23
Posts: 129

Re: [Solved] udev rules: serial for persistent device naming disappeared

$ udevadm info -q all -n /dev/sdg1
P: /devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sdg/sdg1
N: sdg1
S: disk/by-id/ata-SAMSUNG_HD103SI_S1VSJ1LS301247-part1
S: disk/by-id/scsi-SATA_SAMSUNG_HD103SIS1VSJ1LS301247-part1
S: disk/by-id/wwn-0x50024e900136a03e-part1
S: disk/by-path/pci-0000:00:09.0-scsi-3:0:0:0-part1
S: disk/by-uuid/bb024e1b-78a5-4ed0-9e80-aaa7633aa493
E: DEVLINKS=/dev/disk/by-id/ata-SAMSUNG_HD103SI_S1VSJ1LS301247-part1 /dev/disk/by-id/scsi-SATA_SAMSUNG_HD103SIS1VSJ1LS301247-part1 /dev/disk/by-id/wwn-0x50024e900136a03e-part1 /dev/disk/by-path/pci-0000:00:09.0-scsi-3:0:0:0-part1 /dev/disk/by-uuid/bb024e1b-78a5-4ed0-9e80-aaa7633aa493
E: DEVNAME=/dev/sdg1
E: DEVPATH=/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sdg/sdg1
E: DEVTYPE=partition
E: ID_ATA=1
E: ID_ATA_DOWNLOAD_MICROCODE=1
E: ID_ATA_FEATURE_SET_AAM=1
E: ID_ATA_FEATURE_SET_AAM_CURRENT_VALUE=254
E: ID_ATA_FEATURE_SET_AAM_ENABLED=1
E: ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE=254
E: ID_ATA_FEATURE_SET_APM=1
E: ID_ATA_FEATURE_SET_APM_ENABLED=0
E: ID_ATA_FEATURE_SET_HPA=1
E: ID_ATA_FEATURE_SET_HPA_ENABLED=1
E: ID_ATA_FEATURE_SET_PM=1
E: ID_ATA_FEATURE_SET_PM_ENABLED=1
E: ID_ATA_FEATURE_SET_PUIS=1
E: ID_ATA_FEATURE_SET_PUIS_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY=1
E: ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=194
E: ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=194
E: ID_ATA_FEATURE_SET_SMART=1
E: ID_ATA_FEATURE_SET_SMART_ENABLED=1
E: ID_ATA_SATA=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1
E: ID_ATA_WRITE_CACHE=1
E: ID_ATA_WRITE_CACHE_ENABLED=1
E: ID_BUS=ata
E: ID_FS_TYPE=crypto_LUKS
E: ID_FS_USAGE=crypto
E: ID_FS_UUID=bb024e1b-78a5-4ed0-9e80-aaa7633aa493
E: ID_FS_UUID_ENC=bb024e1b-78a5-4ed0-9e80-aaa7633aa493
E: ID_FS_VERSION=1
E: ID_MODEL=SAMSUNG_HD103SI
E: ID_MODEL_ENC=SAMSUNG\x20HD103SI\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_PART_ENTRY_TYPE=0x83
E: ID_PART_TABLE_TYPE=dos
E: ID_PATH=pci-0000:00:09.0-scsi-3:0:0:0
E: ID_PATH_TAG=pci-0000_00_09_0-scsi-3_0_0_0
E: ID_REVISION=1AG01131
E: ID_SCSI_COMPAT=SATA_SAMSUNG_HD103SIS1VSJ1LS301247
E: ID_SERIAL=SAMSUNG_HD103SI_S1VSJ1LS301247
E: ID_SERIAL_SHORT=S1VSJ1LS301247
E: ID_TYPE=disk
E: ID_WWN=0x50024e900136a03e
E: ID_WWN_WITH_EXTENSION=0x50024e900136a03e
E: MAJOR=8
E: MINOR=97
E: PART_ENTRY_DISK=8:96
E: PART_ENTRY_NUMBER=1
E: PART_ENTRY_OFFSET=63
E: PART_ENTRY_SCHEME=dos
E: PART_ENTRY_SIZE=1953520002
E: SUBSYSTEM=block
E: UDEV_LOG=3
E: UDISKS_PARTITION=1
E: UDISKS_PARTITION_ALIGNMENT_OFFSET=0
E: UDISKS_PARTITION_NUMBER=1
E: UDISKS_PARTITION_OFFSET=32256
E: UDISKS_PARTITION_SCHEME=mbr
E: UDISKS_PARTITION_SIZE=1000202241024
E: UDISKS_PARTITION_SLAVE=/sys/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sdg
E: UDISKS_PARTITION_TYPE=0x83
E: UDISKS_PRESENTATION_NOPOLICY=0
E: USEC_INITIALIZED=6897248001

OK, there is the serial.... but the problem persists - udev doesn't execute the rule and doesn't create /dev/aluguard.

Offline

#4 2012-01-30 15:48:41

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [Solved] udev rules: serial for persistent device naming disappeared

NAME= is forbidden in udev rules. It has been for a while.

Offline

#5 2012-01-30 18:25:01

indianahorst
Member
Registered: 2008-08-23
Posts: 129

Re: [Solved] udev rules: serial for persistent device naming disappeared

brain0 wrote:

NAME= is forbidden in udev rules. It has been for a while.

Could you cite a source for this information? I can't find anything. As well in http://reactivated.net/writing_udev_rules.html as in https://wiki.archlinux.org/index.php/Ma … _with_udev NAME= is used.

Offline

#6 2012-01-30 19:41:57

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [Solved] udev rules: serial for persistent device naming disappeared

indianahorst wrote:

cite a source

"man udev" has a paragraph-long description, including:

Instead of renaming a device node, SYMLINK should be used.

So use SYMLINK+="whatever" instead. And that's a plus sign before the equals sign, so as not to erase any other symlinks which other udev rules might have added.

The gist isn't quite as strong as "forbidden", though.

You haven't mentioned that you've tried debugging the rules - google "udev debugging".

Offline

#7 2012-01-30 21:24:45

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Solved] udev rules: serial for persistent device naming disappeared

indianahorst wrote:
brain0 wrote:

NAME= is forbidden in udev rules. It has been for a while.

Could you cite a source for this information? I can't find anything. As well in http://reactivated.net/writing_udev_rules.html as in https://wiki.archlinux.org/index.php/Ma … _with_udev NAME= is used.

Despite the first site claiming to be up to date, it's not. The udevmonitor command got replaced by udevadm monitor, as well as other tidbits that are out of date on the site now. I think it's a bit behind...

I know it's not helpful, just throwing it out there smile.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#8 2012-01-31 13:02:46

indianahorst
Member
Registered: 2008-08-23
Posts: 129

Re: [Solved] udev rules: serial for persistent device naming disappeared

Okay, problem solved - SYMLINK+= instead of NAME= does the trick! Thank you!

Offline

Board footer

Powered by FluxBB