While we can technically put /dev/disks/by-path back for ATA devices in Ubuntu, that still won't help upstream ceph on other distros, and I believe this approach is buggy anyway. is_partition() currently looks a bit underdefined/buggy to me, as it's not uncommon to have file systems on unpartitioned block devices (i. e. mounting /dev/sdb directly); this will also completely miss devmapper or other "virtual" devices. To mimic the current behaviou, one could do something like
return not os.path.exists('/sys/block/%s' % os.path.basename(dev)) as devices will be there (like /sys/block/sdb), and partitions under that (like /sys/block/sdb/sdb2). But again, that's not really what you want there: Judging by how is_partition() is being used in verify_not_in_use(), it should probably be called is_filesystem() and query udev (CLI example: udevadm info --name=/dev/sda2 | grep ID_FS) or blkid. There are a couple of options how to rewrite these functions, including reading /sys/block/, /proc/partitions, asking blkid, querying udevadm, or querying udisks. If you want a list of block devices with mountable file systems which are present, and don't want to use any extra libraries, then perhaps the simplest thing is udevadm trigger --dry-run --verbose --property- match=ID_FS_USAGE=filesystem (this doesn't need any root privileges). If you want all block devices, then udevadm trigger --dry-run --verbose --subsystem-match=block will give a list, including device-mapper (and also loopback, etc.). -- You received this bug notification because you are a member of Ubuntu Server Team, which is subscribed to ceph in Ubuntu. https://bugs.launchpad.net/bugs/1193705 Title: [udev] /dev/disk/by-path missing To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/ceph/+bug/1193705/+subscriptions -- Ubuntu-server-bugs mailing list Ubuntu-server-bugs@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs