Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cstor-pool on K3OS is not working #2686

pawanpraka1 opened this issue Jul 25, 2019 · 1 comment


Copy link

commented Jul 25, 2019

On K3OS we are not able to create the pool. The pool creation is failing mainly because K3Os does not support udev. When we use "zpool create" command, the zpool labels the disk and rely on udev to get the information about the devices (Specialy it checks if device is initialized by udev or not via udev_device_get_is_initialized library call). It creates a partition and waits for (via udev)

  • it to be initialized
  • all of the device links to be verified to exist

Once this is done the device can be accessed reliably. Since K3Os does not have udev, the above check will fail and zpool create command will return with the failure.

currently we use udev for the following items :-

  1. get persistent physical location used for device matching during auto-{online,expand,replace}.

  2. enclosure sysfs path for turning on enclosure LEDs

  3. device is ready for IOs or not

This is the test sample code which checks and return if device is initialized by udev or not.

$ cat udev.c
#include <libudev.h>
#include <stdio.h>

int main(int argc, char **argv)
        char *device;
        struct udev *udev;
        struct udev_device *dev = NULL;

        if ((udev = udev_new()) == NULL) {
                printf("failed to get udev device\n");
                return (-1);

        if (argc > 1) {
                device = argv[1];
        } else {
                fprintf(stderr, "device is not provided\n");
                return (-1);

        dev = udev_device_new_from_subsystem_sysname(udev, "block", device);

        if ((dev != NULL) && udev_device_get_is_initialized(dev)) {
                printf("device = %s is initialized by udev\n", device);
        } else {
                printf("device = %s is not initialized by udev\n", device);

        return (0);

$ gcc udev.c -ludev
$ ./a.out sdb1
device = sdb1 is not initialized by udev

The above binary should return device = sdb1 is initialized by udev

@kmova kmova added this to the 1.x Backlog milestone Aug 1, 2019


This comment has been minimized.

Copy link

commented Aug 1, 2019

rancher/k3os#151 is tracking the enhancement for supporting udev in K3Os

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.