So both /dev/bcache/by-uuid and /dev/disk/by-uuid both point to the bcache
device (b250:0)
udevd shows this:
Nov 30 23:39:10.738290 ubuntu systemd-udevd[465]: LINK
'disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869'
/lib/udev/rules.d/60-persistent-storage.rules:79
Nov 30 23:39:10.738304 ubuntu systemd-udevd[465]: update old name,
'/dev/bcache/by-uuid/92d882d8-38cd-4537-847b-6f9c40ba67b4' no longer
belonging to '/devices/virtual/block/bcache1'
Nov 30 23:39:10.738321 ubuntu systemd-udevd[465]: no reference left, remove
'/dev/bcache/by-uuid/92d882d8-38cd-4537-847b-6f9c40ba67b4'
Nov 30 23:39:10.738361 ubuntu systemd-udevd[465]: found 'b250:1' claiming
'/run/udev/links/\x2fdisk\x2fby-uuid\x2f0a270acb-56b8-4498-8bad-b3bb149fe869'
Nov 30 23:39:10.738370 ubuntu systemd-udevd[465]: creating link
'/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869' to '/dev/bcache1'
Nov 30 23:39:10.738380 ubuntu systemd-udevd[465]: preserve already existing
symlink '/dev/disk/by-uuid/0a270acb-56b8-4498-8bad-b3bb149fe869' to
'../../bcache1'
Nov 30 23:39:10.743215 ubuntu systemd-udevd[487]: LINK
'disk/by-uuid/92b0868d-7e56-4956-8e55-2c90ebee4a72'
/lib/udev/rules.d/60-persistent-storage.rules:79
Nov 30 23:39:10.743228 ubuntu systemd-udevd[487]: update old name,
'/dev/bcache/by-uuid/57e009b1-6bf4-42ea-abe0-334b10941a0b' no longer
belonging to '/devices/virtual/block/bcache0'
Nov 30 23:39:10.743247 ubuntu systemd-udevd[487]: no reference left, remove
'/dev/bcache/by-uuid/57e009b1-6bf4-42ea-abe0-334b10941a0b'
Nov 30 23:39:10.743291 ubuntu systemd-udevd[487]: found 'b250:0' claiming
'/run/udev/links/\x2fdisk\x2fby-uuid\x2f92b0868d-7e56-4956-8e55-2c90ebee4a72'
Nov 30 23:39:10.743302 ubuntu systemd-udevd[487]: creating link
'/dev/disk/by-uuid/92b0868d-7e56-4956-8e55-2c90ebee4a72' to '/dev/bcache0'
Nov 30 23:39:10.743312 ubuntu systemd-udevd[487]: preserve already existing
symlink '/dev/disk/by-uuid/92b0868d-7e56-4956-8e55-2c90ebee4a72' to
'../../bcache0'
It would seem that the 'no longer belonging to ...bcache1' is the trigger
for the removal
however, 250:1 is indeed bcache1 device.
# ls -al /dev/bcache1
brw-rw---- 1 root disk 250, 1 Nov 30 23:39 /dev/bcache1
Looking at the systemd/udev/udev-event.c it appears that for entries in
the current udev database that don't have a new event associated with them
get the call to remove the old link
void udev_event_execute_rules()
...
if (major(udev_device_get_devnum(dev)) > 0) { bool apply;
/* remove/update possible left-over symlinks from
old database entry */ if (event->dev_db != NULL) udev_node_update_old_links(dev,
event->dev_db);
Will need to crawl through the db to see what the the event->dev_db entry
is and where that get's set.
On Thu, Nov 30, 2017 at 2:41 PM, Dmitrii Shcherbakov <
<email address hidden>> wrote:
> Looks like masking systemd-udevd removes this behavior. Need to figure
> out where it actually clears everything out.
>
> ubuntu@maas-xenial4:~$ sudo systemctl mask systemd-udevd
> 11:32 PM Created symlink from /etc/systemd/system/systemd-udevd.service
> to /dev/null.
>
> # reboot
>
> ubuntu@maas-xenial4:~$ ls /dev/bcache/by-uuid/
> 2963855b-3d2b-4387-abd1-3ae788919de4 727212eb-0f0b-4d20-9191-f0577a38454e
> 835afacf-6213-48a9-864c-43733822668b aa04ab39-a42c-446f-aff5-addbd9c80e06
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1729145
>
> Title:
> /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/
> 1729145/+subscriptions
>
It looks like there is some ordering issues:
This is a grep through /run/udev/links ; these are checked by udev-dev
# find . -name 'b250*' x2fby-uuid\ x2f0a270acb- 56b8-4498- 8bad-b3bb149fe8 69/b250: 1 x2fby-uuid\ x2f92b0868d- 7e56-4956- 8e55-2c90ebee4a 72/b250: 0 x2fby-uuid\ x2f92d882d8- 38cd-4537- 847b-6f9c40ba67 b4/b250: 1 x2fby-uuid\ x2f57e009b1- 6bf4-42ea- abe0-334b10941a 0b/b250: 0
./\x2fdisk\
./\x2fdisk\
./\x2fbcache\
./\x2fbcache\
So both /dev/bcache/by-uuid and /dev/disk/by-uuid both point to the bcache
device (b250:0)
udevd shows this:
Nov 30 23:39:10.738290 ubuntu systemd-udevd[465]: LINK uuid/0a270acb- 56b8-4498- 8bad-b3bb149fe8 69' rules.d/ 60-persistent- storage. rules:79 by-uuid/ 92d882d8- 38cd-4537- 847b-6f9c40ba67 b4' no longer virtual/ block/bcache1' by-uuid/ 92d882d8- 38cd-4537- 847b-6f9c40ba67 b4' links/\ x2fdisk\ x2fby-uuid\ x2f0a270acb- 56b8-4498- 8bad-b3bb149fe8 69' by-uuid/ 0a270acb- 56b8-4498- 8bad-b3bb149fe8 69' to '/dev/bcache1' by-uuid/ 0a270acb- 56b8-4498- 8bad-b3bb149fe8 69' to uuid/92b0868d- 7e56-4956- 8e55-2c90ebee4a 72' rules.d/ 60-persistent- storage. rules:79 by-uuid/ 57e009b1- 6bf4-42ea- abe0-334b10941a 0b' no longer virtual/ block/bcache0' by-uuid/ 57e009b1- 6bf4-42ea- abe0-334b10941a 0b' links/\ x2fdisk\ x2fby-uuid\ x2f92b0868d- 7e56-4956- 8e55-2c90ebee4a 72' by-uuid/ 92b0868d- 7e56-4956- 8e55-2c90ebee4a 72' to '/dev/bcache0' by-uuid/ 92b0868d- 7e56-4956- 8e55-2c90ebee4a 72' to
'disk/by-
/lib/udev/
Nov 30 23:39:10.738304 ubuntu systemd-udevd[465]: update old name,
'/dev/bcache/
belonging to '/devices/
Nov 30 23:39:10.738321 ubuntu systemd-udevd[465]: no reference left, remove
'/dev/bcache/
Nov 30 23:39:10.738361 ubuntu systemd-udevd[465]: found 'b250:1' claiming
'/run/udev/
Nov 30 23:39:10.738370 ubuntu systemd-udevd[465]: creating link
'/dev/disk/
Nov 30 23:39:10.738380 ubuntu systemd-udevd[465]: preserve already existing
symlink '/dev/disk/
'../../bcache1'
Nov 30 23:39:10.743215 ubuntu systemd-udevd[487]: LINK
'disk/by-
/lib/udev/
Nov 30 23:39:10.743228 ubuntu systemd-udevd[487]: update old name,
'/dev/bcache/
belonging to '/devices/
Nov 30 23:39:10.743247 ubuntu systemd-udevd[487]: no reference left, remove
'/dev/bcache/
Nov 30 23:39:10.743291 ubuntu systemd-udevd[487]: found 'b250:0' claiming
'/run/udev/
Nov 30 23:39:10.743302 ubuntu systemd-udevd[487]: creating link
'/dev/disk/
Nov 30 23:39:10.743312 ubuntu systemd-udevd[487]: preserve already existing
symlink '/dev/disk/
'../../bcache0'
It would seem that the 'no longer belonging to ...bcache1' is the trigger
for the removal
however, 250:1 is indeed bcache1 device.
# ls -al /dev/bcache1
brw-rw---- 1 root disk 250, 1 Nov 30 23:39 /dev/bcache1
Looking at the systemd/ udev/udev- event.c it appears that for entries in
the current udev database that don't have a new event associated with them
get the call to remove the old link
void udev_event_ execute_ rules() udev_device_ get_devnum( dev)) > 0) {
bool apply;
...
if (major(
old database entry */
event->dev_db);
Will need to crawl through the db to see what the the event->dev_db entry
is and where that get's set.
On Thu, Nov 30, 2017 at 2:41 PM, Dmitrii Shcherbakov <
<email address hidden>> wrote:
> Looks like masking systemd-udevd removes this behavior. Need to figure maas-xenial4: ~$ sudo systemctl mask systemd-udevd system/ systemd- udevd.service maas-xenial4: ~$ ls /dev/bcache/ by-uuid/ 3d2b-4387- abd1-3ae788919d e4 727212eb- 0f0b-4d20- 9191-f0577a3845 4e 6213-48a9- 864c-4373382266 8b aa04ab39- a42c-446f- aff5-addbd9c80e 06 /bugs.launchpad .net/bugs/ 1729145 /bugs.launchpad .net/ubuntu/ +source/ linux/+ bug/ +subscriptions
> out where it actually clears everything out.
>
> ubuntu@
> 11:32 PM Created symlink from /etc/systemd/
> to /dev/null.
>
> # reboot
>
> ubuntu@
> 2963855b-
> 835afacf-
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https:/
>
> Title:
> /dev/bcache/by-uuid links not created after reboot
>
> To manage notifications about this bug go to:
> https:/
> 1729145/
>