udevadm: missing or unknown command
I have an (x86) application where the end users can hot plug disks drives. Since I have no control over what they put where, labels etc are of limited use so I switched from mdev to eudev so I could match the actual SATA port in use These rules added to a file in /etc/udev/rules.d seem to do the trick
# Bind the drive names to the physical port they connect too - udev no longer allow renaming device nodes so set up HDi* symlinks instead DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDia%n" DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata2/host1/target1:0:0/1:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDib%n" DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata3/host2/target2:0:0/2:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDie%n" DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata4/host3/target3:0:0/3:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDif%n" DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDic%n" DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata6/host5/target5:0:0/5:0:0:0/block/sd*", ENV{ID_TYPE}=="disk", SYMLINK+="HDid%n"
They create the symlinks I was wanting and which do indeed track the SATA cables regardless of the order the drives are plugged
$ ls -l /dev/H* lrwxrwxrwx 1 root root 3 Jul 27 13:38 /dev/HDia -> sda lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDia1 -> sda1 lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDia2 -> sda2 lrwxrwxrwx 1 root root 3 Jul 27 13:38 /dev/HDib -> sdb lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDib1 -> sdb1 lrwxrwxrwx 1 root root 3 Jul 27 13:38 /dev/HDic -> sdc lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDic1 -> sdc1 lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDic2 -> sdc2 lrwxrwxrwx 1 root root 4 Jul 27 13:38 /dev/HDic5 -> sdc5
However, when I try to run udevadm - which does exist:
$ ls -l /sbin/udevadm lrwxrwxrwx 1 root root 16 Jul 27 10:55 sbin/udevadm -> /usr/bin/udevadm
$ ls -l /usr/bin/udevadm -rwxr-xr-x 1 root root 253568 Jul 27 12:38 usr/bin/udevadm
And appears to be a valid executable file
$ file udevadm udevadm: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped
I get this message
$ ./udevadm udevadm: missing or unknown command
Missing dependency Somewhere maybe? Anyone have a clue? Because I'm stuck.
Thanks, Steve
Quoted 2 lines · Steve Kenton
I have an (x86) application where the end
users can hot plug disks drives.
Quoted 1 line
Since I have no control over what they put
where, labels etc are of limited use
Quoted 1 line
so I switched from mdev to eudev so I could
match the actual SATA port in use
Quoted 1 line
These rules added to a file in
/etc/udev/rules.d seem to do the trick
Quoted 2 lines
# Bind the drive names to the physical port
they connect too - udev no longer allow renaming device nodes so
Quoted 2 lines
set up HDi* symlinks instead
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata1/ host0/target0:0:0/0:0:0:0/block/sd*",
Quoted 2 lines
ENV{ID_TYPE}=="disk", SYMLINK+="HDia%n"
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata2/ host1/target1:0:0/1:0:0:0/block/sd*",
Quoted 2 lines
ENV{ID_TYPE}=="disk", SYMLINK+="HDib%n"
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata3/ host2/target2:0:0/2:0:0:0/block/sd*",
Quoted 2 lines
ENV{ID_TYPE}=="disk", SYMLINK+="HDie%n"
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata4/ host3/target3:0:0/3:0:0:0/block/sd*",
Quoted 2 lines
ENV{ID_TYPE}=="disk", SYMLINK+="HDif%n"
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata5/ host4/target4:0:0/4:0:0:0/block/sd*",
Quoted 2 lines
ENV{ID_TYPE}=="disk", SYMLINK+="HDic%n"
DEVPATH=="/devices/pci0000:00/0000:00:1f.2/ata6/ host5/target5:0:0/5:0:0:0/block/sd*",
Quoted 3 lines
ENV{ID_TYPE}=="disk", SYMLINK+="HDid%n"
They create the symlinks I was wanting and
which do indeed track the SATA cables regardless of the order the
Quoted 4 lines
drives are plugged
$ ls -l /dev/H* lrwxrwxrwx 1 root root 3 Jul 27 13:38
/dev/HDia -> sda
Quoted 1 line
lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDia1 -> sda1
Quoted 1 line
lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDia2 -> sda2
Quoted 1 line
lrwxrwxrwx 1 root root 3 Jul 27 13:38
/dev/HDib -> sdb
Quoted 1 line
lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDib1 -> sdb1
Quoted 1 line
lrwxrwxrwx 1 root root 3 Jul 27 13:38
/dev/HDic -> sdc
Quoted 1 line
lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDic1 -> sdc1
Quoted 1 line
lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDic2 -> sdc2
Quoted 1 line
lrwxrwxrwx 1 root root 4 Jul 27 13:38
/dev/HDic5 -> sdc5
Quoted 2 lines
However, when I try to run udevadm - which
does exist:
Quoted 3 lines
$ ls -l /sbin/udevadm lrwxrwxrwx 1 root root 16 Jul 27 10:55
sbin/udevadm -> /usr/bin/udevadm
Quoted 3 lines
$ ls -l /usr/bin/udevadm -rwxr-xr-x 1 root root 253568 Jul 27 12:38
usr/bin/udevadm
Quoted 5 lines
And appears to be a valid executable file
$ file udevadm udevadm: ELF 64-bit LSB executable, x86-64,
version 1 (SYSV), dynamically linked (uses shared libs), for
Quoted 6 lines
GNU/Linux 2.6.32, stripped
I get this message
$ ./udevadm udevadm: missing or unknown command
I believe this is just a simple case of udevadm requiring a command. Try udevadm monitor. Missing or unknown command is obviously not the clearest error message; it should really just print out standard usage.
Nimai
Quoted 2 lines
Missing dependency Somewhere maybe? Anyone
have a clue? Because I'm stuck.
Quoted 3 lines
Thanks, Steve