Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-5060

mkfs.lustre --backfstype=zfs fails to execute due to fix library name libzfs.so.1

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • Lustre 2.5.1
    • None
    • Debian 7.5, 3.2 kernel,
      SPL 0.6.2-38_gad3412e
      ZFS 0.6.2-274_g2c33b91
    • 3
    • 13978

    Description

      Cloning master SPL/ZFS from github and compiling and running Lustre (cloned from master) with ZFS backend
      only, results in:

      # mkfs.lustre --reformat --mgs --backfstype=zfs ....
      
      mkfs.lustre FATAL: Failed to initialize ZFS library. Are the ZFS
      packages and modules correctly installed?
      mkfs.lustre FATAL: unable to prepare backend (22)
      mkfs.lustre: exiting with 22 (Invalid argument)
      

      strace reveals:

      # strace mkfs.lustre --backfstype=zfs ...
      
      ...
      ...
      open("/usr/lib/tls/x86_64/libzfs.so.1", O_RDONLY) = -1 ENOENT (No such
      file or directory)
      stat("/usr/lib/tls/x86_64", 0x7fffcb620930) = -1 ENOENT (No such file or
      directory)
      open("/usr/lib/tls/libzfs.so.1", O_RDONLY) = -1 ENOENT (No such file or
      directory)
      stat("/usr/lib/tls", 0x7fffcb620930)    = -1 ENOENT (No such file or
      directory)
      open("/usr/lib/x86_64/libzfs.so.1", O_RDONLY) = -1 ENOENT (No such file
      or directory)
      stat("/usr/lib/x86_64", 0x7fffcb620930) = -1 ENOENT (No such file or
      directory)
      open("/usr/lib/libzfs.so.1", O_RDONLY)  = -1 ENOENT (No such file or
      directory)
      stat("/usr/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
      munmap(0x7f650e274000, 13380)           = 0
      write(2, "\nmkfs.lustre FATAL: ", 20
      mkfs.lustre FATAL: )   = 20
      write(2, "Failed to initialize ZFS library"..., 88Failed to initialize
      ZFS library. Are the ZFS packages and modules correctly installed?
      

      In mount_utils_zfs.c:

      ...
      	handle_libzfs = dlopen("libzfs.so.1", RTLD_LAZY);
      	if (handle_libzfs == NULL)
      		return EINVAL;
      
      	handle_nvpair = dlopen("libnvpair.so.1", RTLD_LAZY);
      	if (handle_nvpair == NULL) {
      		ret = EINVAL;
      		goto out;
      	}
      ...
      

      However, the latest ZFS libraries are named:

      lrwxrwxrwx 1 root staff      15 May 14 11:46 libzfs.so -> libzfs.so.2.0.0
      lrwxrwxrwx 1 root staff      15 May 14 11:46 libzfs.so.2 -> libzfs.so.2.0.0
      -rwxr-xr-x 1 root staff 1040438 May 14 11:46 libzfs.so.2.0.0
      ...
      lrwxrwxrwx 1 root staff      18 May 14 11:46 libnvpair.so -> libnvpair.so.1.0.1
      lrwxrwxrwx 1 root staff      18 May 14 11:46 libnvpair.so.1 -> libnvpair.so.1.0.1
      -rwxr-xr-x 1 root staff  317279 May 14 11:46 libnvpair.so.1.0.1
      

      I guess the most simplest solution to fix that, would be changing

      handle_libzfs = dlopen("libzfs.so.1", RTLD_LAZY);
      

      into

      handle_libzfs = dlopen("libzfs.so", RTLD_LAZY);
      

      So it will based on the proper symbolic links.

      I will provide a simple patch for this problem.

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              thomas.stibor Thomas Stibor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: