# missing /dev/disk/by-path/ with udev only on [Solved]

## piavlo

Hi

i've many gentoo machines and that all have

```
#ls -la /dev/disk/

total 0

drwxr-xr-x  5 root root   100 Nov 20 18:25 ./

drwxr-xr-x 18 root root 13820 Nov 22 16:12 ../

drwxr-xr-x  2 root root   140 Nov 20 18:25 by-id/

drwxr-xr-x  2 root root   140 Nov 20 18:25 by-path/

drwxr-xr-x  2 root root   220 Nov 20 18:25 by-uuid/
```

 and all have same udev version and configuration

but only one machine is missing only the the /dev/disk/by-path/ directory, what could be the problem?

```
# fgrep by-path /etc/udev/rules.d/50-udev.rules 

KERNEL=="*[!0-9]", ENV{ID_TYPE}=="?*", IMPORT="/sbin/path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"

KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
```

Last edited by piavlo on Thu Nov 23, 2006 3:05 pm; edited 1 time in total

----------

## Da Fox

I also don't have this '/dev/disk/by-path', but what do these things do?

I do have '/dev/disk/by-label' which you are (also?) missing.

Do I need them for something? (Everything seems to be working perfectly)

Or is there some nice trick that you can use them for? (I would like to know that trick too then  :Wink: )

I have udev-087-r1 and all config is standard, if it matters.

----------

## piavlo

 *Da Fox wrote:*   

> Do I need them for something? (Everything seems to be working perfectly)
> 
> Or is there some nice trick that you can use them for? (I would like to know that trick too then ).

 

These entries under /dev/disk allow you, for example to identify disks uniqely with /dev/disk/by-uuid

so what in case the named like /dev/sda and /dev/sdb get swapped , or renamed (this uslually happens with

direrent distros or from install or rescue cd you see these diffrently than on already installed system)

I my case i need /dev/disk/by-path since i'm using it for sowtware raid devices, for example i have 8 ide disks attached

to 4 controlers, i split them in 2 raid5 of 4 disk each while for to disk attached to same controller each one is used

in different raid.

like in mdadm i have

ARRAY /dev/md4 level=raid5 num-devices=4 devices=/dev/disk/by-path/pci-0000:03:0[0123].0-ide-0:0-part4

ARRAY /dev/md5 level=raid5 num-devices=4 devices=/dev/disk/by-path/pci-0000:03:0[0123].0-ide-1:0-part4

by the pci path i can tell which disk is on which controller, and this more reliable wy than just using /dev/hd? names directly

```
#ls -la /dev/disk/by-path

lrwxrwxrwx 1 root root   9 2006-08-07 21:30 pci-0000:00:1f.1-ide-0:0 -> ../../hda

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:00:1f.1-ide-0:0-part1 -> ../../hda1

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:00:1f.1-ide-0:0-part2 -> ../../hda2

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:00:1f.1-ide-0:0-part3 -> ../../hda3

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:00:1f.1-ide-0:0-part4 -> ../../hda4

lrwxrwxrwx 1 root root   9 2006-08-07 21:30 pci-0000:03:00.0-ide-0:0 -> ../../hde

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:03:00.0-ide-0:0-part1 -> ../../hde1

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:03:00.0-ide-0:0-part2 -> ../../hde2

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:03:00.0-ide-0:0-part3 -> ../../hde3

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:03:00.0-ide-0:0-part4 -> ../../hde4

lrwxrwxrwx 1 root root   9 2006-08-07 21:30 pci-0000:03:00.0-ide-1:0 -> ../../hdg

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:03:00.0-ide-1:0-part1 -> ../../hdg1

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:03:00.0-ide-1:0-part2 -> ../../hdg2

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:03:00.0-ide-1:0-part3 -> ../../hdg3

lrwxrwxrwx 1 root root  10 2006-08-07 21:30 pci-0000:03:00.0-ide-1:0-part4 -> ../../hdg4

lrwxrwxrwx 1 root root   9 2006-08-07 21:30 pci-0000:03:01.0-ide-0:0 -> ../../hdm

...
```

----------

## piavlo

Found the problem , the /sbin/path_id probgram is buggy in udev-087-r1, i've looked at masked udev-103

and the code seemed to fix the problem so i emegred the latest udev and now it works

----------

