{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/217","labels_url":"https://api.github.com/repos/systemd/systemd/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/217/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/217/events","html_url":"https://github.com/systemd/systemd/issues/217","id":88545445,"number":217,"title":"udev 220 not creating /dev/disk/by-uuid symlinks on ACTION=change?","user":{"login":"tycho","id":29616,"avatar_url":"https://avatars.githubusercontent.com/u/29616?v=3","gravatar_id":"","url":"https://api.github.com/users/tycho","html_url":"https://github.com/tycho","followers_url":"https://api.github.com/users/tycho/followers","following_url":"https://api.github.com/users/tycho/following{/other_user}","gists_url":"https://api.github.com/users/tycho/gists{/gist_id}","starred_url":"https://api.github.com/users/tycho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tycho/subscriptions","organizations_url":"https://api.github.com/users/tycho/orgs","repos_url":"https://api.github.com/users/tycho/repos","events_url":"https://api.github.com/users/tycho/events{/privacy}","received_events_url":"https://api.github.com/users/tycho/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systemd/systemd/labels/udev","name":"udev","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-15T21:27:43Z","updated_at":"2015-06-16T00:04:30Z","closed_at":null,"body":"First of all, I should note that I've cherry-picked ff2aa01e61f8aff149b63231365f1cef008296a2 to allow 'xvd' (xen) block devices to have /dev/disk symlinks.\r\n\r\n---\r\n\r\nI've noticed between udev-219 and udev-220 there's a change in what happens after a 'mkfs' to a partition.\r\n\r\n## udev 219\r\nHere's what happens with udev 219.\r\n\r\n```\r\n[root@ip-10-82-128-154 ~]# mkfs.ext4 /dev/xvdj1\r\nmke2fs 1.42.12 (29-Aug-2014)\r\nCreating filesystem with 2096891 4k blocks and 524288 inodes\r\nFilesystem UUID: 29910219-c3de-4a34-9d6d-58d410144634\r\nSuperblock backups stored on blocks:\r\n        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632\r\n\r\nAllocating group tables: done\r\nWriting inode tables: done\r\nCreating journal (32768 blocks): done\r\nWriting superblocks and filesystem accounting information: done\r\n\r\n[root@ip-10-82-128-154 ~]# ls -chal /dev/disk/by-uuid\r\ntotal 0\r\ndrwxr-xr-x 2 root root 100 Jun 15 21:21 .\r\ndrwxr-xr-x 5 root root 100 Jun 15 21:20 ..\r\nlrwxrwxrwx 1 root root  11 Jun 15 21:21 29910219-c3de-4a34-9d6d-58d410144634 -> ../../xvdj1\r\nlrwxrwxrwx 1 root root  10 Jun 15 21:18 8e0d26b1-f70c-4170-ac2e-d62f043decd6 -> ../../xvdb\r\nlrwxrwxrwx 1 root root  11 Jun 15 21:18 dfb8b6fe-7904-4058-8df8-187214c17008 -> ../../xvda1\r\n```\r\nNote the /dev/disk/by-uuid symlink for the newly formatted FS with UUID `29910219-c3de-4a34-9d6d-58d410144634` is present.\r\n\r\nHere's what `udevadm monitor` shows when the mkfs happens:\r\n```\r\n[root@ip-10-82-128-154 ~]# udevadm monitor --property\r\nmonitor will print the received events for:\r\nUDEV - the event which udev sends out after rule processing\r\nKERNEL - the kernel uevent\r\n\r\nKERNEL[193.026700] change   /devices/vbd-51856/block/xvdj/xvdj1 (block)\r\nACTION=change\r\nDEVNAME=/dev/xvdj1\r\nDEVPATH=/devices/vbd-51856/block/xvdj/xvdj1\r\nDEVTYPE=partition\r\nMAJOR=202\r\nMINOR=145\r\nSEQNUM=2418\r\nSUBSYSTEM=block\r\n\r\nUDEV  [193.088550] change   /devices/vbd-51856/block/xvdj/xvdj1 (block)\r\nACTION=change\r\nDEVLINKS=/dev/disk/by-partlabel/Linux\\x20filesystem /dev/disk/by-partuuid/77c06ce8-4fb3-4e5a-812e-312feb1e8d9a /dev/disk/by-uuid/29910219-c3de-4a34-9d6d-58d410144634\r\nDEVNAME=/dev/xvdj1\r\nDEVPATH=/devices/vbd-51856/block/xvdj/xvdj1\r\nDEVTYPE=partition\r\nID_FS_TYPE=ext4\r\nID_FS_USAGE=filesystem\r\nID_FS_UUID=29910219-c3de-4a34-9d6d-58d410144634\r\nID_FS_UUID_ENC=29910219-c3de-4a34-9d6d-58d410144634\r\nID_FS_VERSION=1.0\r\nID_PART_ENTRY_DISK=202:144\r\nID_PART_ENTRY_NAME=Linux\\x20filesystem\r\nID_PART_ENTRY_NUMBER=1\r\nID_PART_ENTRY_OFFSET=2048\r\nID_PART_ENTRY_SCHEME=gpt\r\nID_PART_ENTRY_SIZE=16775135\r\nID_PART_ENTRY_TYPE=0fc63daf-8483-4772-8e79-3d69d8477de4\r\nID_PART_ENTRY_UUID=77c06ce8-4fb3-4e5a-812e-312feb1e8d9a\r\nID_PART_TABLE_TYPE=gpt\r\nID_PART_TABLE_UUID=1f856753-4a4d-4e84-8045-76c7aebad1cc\r\nMAJOR=202\r\nMINOR=145\r\nSEQNUM=2418\r\nSUBSYSTEM=block\r\nTAGS=:systemd:\r\nUSEC_INITIALIZED=67232\r\n```\r\n\r\n## udev 220\r\n\r\nHere's what happens with udev 220.\r\n```\r\n[root@ip-10-83-129-157 ~]# mkfs.ext4 /dev/xvdj1\r\nmke2fs 1.42.12 (29-Aug-2014)\r\n/dev/xvdj1 contains a ext4 file system\r\n        created on Mon Jun 15 21:11:48 2015\r\nProceed anyway? (y,n) y\r\nCreating filesystem with 13106939 4k blocks and 3276800 inodes\r\nFilesystem UUID: 3a097965-1983-43c4-a87b-6743e1f2f888\r\nSuperblock backups stored on blocks:\r\n        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,\r\n        4096000, 7962624, 11239424\r\n\r\nAllocating group tables: done\r\nWriting inode tables: done\r\nCreating journal (32768 blocks): done\r\nWriting superblocks and filesystem accounting information: done\r\n\r\n[root@ip-10-83-129-157 ~]# ls -cahl /dev/disk/by-uuid\r\ntotal 0\r\ndrwxr-xr-x 2 root root 100 Jun 15 21:13 .\r\ndrwxr-xr-x 5 root root 100 Jun 15 21:13 ..\r\nlrwxrwxrwx 1 root root  10 Jun 15 21:13 333af03f-31d8-41b1-85ed-c1b555eeece6 -> ../../xvdb\r\nlrwxrwxrwx 1 root root  11 Jun 15 21:13 ac5f10ca-6575-401a-b0db-035d09b3d9e3 -> ../../xvdj1\r\nlrwxrwxrwx 1 root root  11 Jun 15 21:13 dfb8b6fe-7904-4058-8df8-187214c17008 -> ../../xvda1\r\n```\r\n\r\nNote the lack of a symlink for the new FS with UUID `3a097965-1983-43c4-a87b-6743e1f2f888`. Watching `udevadm monitor --property` showed *no events* fired when the mkfs completes:\r\n\r\n```\r\n[root@ip-10-83-129-157 ~]# udevadm monitor --property\r\nmonitor will print the received events for:\r\nUDEV - the event which udev sends out after rule processing\r\nKERNEL - the kernel uevent\r\n\r\n^C[root@ip-10-83-129-157 ~]#\r\n```\r\n\r\nIf I do a `udevadm trigger`, then the symlink gets created as expected:\r\n```\r\n[root@ip-10-83-129-157 ~]# udevadm trigger\r\n[root@ip-10-83-129-157 ~]# ls -cahl /dev/disk/by-uuid\r\ntotal 0\r\ndrwxr-xr-x 2 root root 100 Jun 15 21:19 .\r\ndrwxr-xr-x 5 root root 100 Jun 15 21:13 ..\r\nlrwxrwxrwx 1 root root  10 Jun 15 21:19 333af03f-31d8-41b1-85ed-c1b555eeece6 -> ../../xvdb\r\nlrwxrwxrwx 1 root root  11 Jun 15 21:19 3a097965-1983-43c4-a87b-6743e1f2f888 -> ../../xvdj1\r\nlrwxrwxrwx 1 root root  11 Jun 15 21:19 dfb8b6fe-7904-4058-8df8-187214c17008 -> ../../xvda1\r\n[root@ip-10-83-129-157 ~]#\r\n```"},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/112241402","html_url":"https://github.com/systemd/systemd/issues/217#issuecomment-112241402","issue_url":"https://api.github.com/repos/systemd/systemd/issues/217","id":112241402,"user":{"login":"tycho","id":29616,"avatar_url":"https://avatars.githubusercontent.com/u/29616?v=3","gravatar_id":"","url":"https://api.github.com/users/tycho","html_url":"https://github.com/tycho","followers_url":"https://api.github.com/users/tycho/followers","following_url":"https://api.github.com/users/tycho/following{/other_user}","gists_url":"https://api.github.com/users/tycho/gists{/gist_id}","starred_url":"https://api.github.com/users/tycho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tycho/subscriptions","organizations_url":"https://api.github.com/users/tycho/orgs","repos_url":"https://api.github.com/users/tycho/repos","events_url":"https://api.github.com/users/tycho/events{/privacy}","received_events_url":"https://api.github.com/users/tycho/received_events","type":"User","site_admin":false},"created_at":"2015-06-16T00:04:30Z","updated_at":"2015-06-16T00:04:30Z","body":"OK. So the latest git systemd does indeed work. I think the change I need for my systemd PKGBUILD is this (the first two added cherry-picks being the key here):\r\n\r\n```diff\r\ncommit c9aefbe000562e7f9550f692d9403187c76127a5\r\nAuthor: Steven Noonan <steven@uplinklabs.net>\r\nDate:   Mon Jun 15 17:01:53 2015 -0700\r\n\r\n    systemd: add patches to unbreak SUBSYSTEM=block ACTION=change events\r\n\r\n    Signed-off-by: Steven Noonan <steven@uplinklabs.net>\r\n\r\ndiff --git a/systemd/PKGBUILD b/systemd/PKGBUILD\r\nindex b039281..cad8327 100644\r\n--- a/systemd/PKGBUILD\r\n+++ b/systemd/PKGBUILD\r\n@@ -3,7 +3,7 @@\r\n pkgbase=systemd\r\n pkgname=('systemd' 'libsystemd' 'systemd-sysvcompat')\r\n pkgver=220\r\n-pkgrel=5\r\n+pkgrel=6\r\n arch=('i686' 'x86_64')\r\n url=\"http://www.freedesktop.org/wiki/Software/systemd\"\r\n makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'elfutils' 'gobject-introspection' 'gperf'\r\n@@ -57,6 +57,22 @@ prepare() {\r\n   # https://github.com/systemd/systemd/commit/d38e01dc96c5\r\n   git cherry-pick -n d38e01dc96c5\r\n\r\n+  # rules: fix typo in block watch rule\r\n+  # https://github.com/systemd/systemd/commit/f07689517e37\r\n+  git cherry-pick -n f07689517e37\r\n+\r\n+  # rules: restore block watch after CHANGE events\r\n+  # https://github.com/systemd/systemd/commit/b50063512d4b\r\n+  git cherry-pick -n b50063512d4b\r\n+\r\n+  # udev: Bring back persistant storage symlinks for bcache\r\n+  # https://github.com/systemd/systemd/commit/19672f1e5fd2\r\n+  git cherry-pick -n 19672f1e5fd2\r\n+\r\n+  # Add /dev/xvd* to 60-persistent-storage whitelist\r\n+  # https://github.com/systemd/systemd/commit/ff2aa01e61f8\r\n+  git cherry-pick -n ff2aa01e61f8\r\n+\r\n   patch -Np1 -i \"${srcdir}/enable-magic-sysrq.patch\"\r\n\r\n   ./autogen.sh\r\n```"}}