ZFS on Linux

Posted by colby
  • Notes on creating zeventd for ZFS on Linux
  • Development host: hood
  • OS: openSUSE 11.3 kernel:
  • github forks: https://github.com/colbygk/zfs https://github.com/colbygk/spl
  • Build area: ~/zfs
  • Build packages/projects: zfs and spl
  • git urls: git@github.com:colbygk/zfs.git git@github.com:colbygk/spl.git

      May 16th, 2011

    1. Building SPL:
      Requires non-PREEMPT kernel, easiest to install kernel-default package, modify /boot/grub/menu.lst to boot this kernel by default
      $ ./configure
      $ make
      $ sudo make install

      Building ZFS:

        $ ./configure --with-spl=/home/colby/zfs/spl-0.6.0-rc4
        $ make

      Fails on

      /home/colby/zfs/zfs/module/zfs/../../module/zfs/spa.c:672:14: error: ‘TASKQ_NORECLAIM’ undeclared (first use in this function)

      TASKQ_NORECLAIM is defined in zfs/include/sys/zfs_context.h which is included in spa.c
      This is part of a kernel module build, so the output is not very verbose, to make verbose output:

      $ make V=1
      make -f /usr/src/linux-2.6.34-12/scripts/Makefile.build obj=/home/colby/zfs/zfs/module/zfs
        gcc -Wp,-MD,/home/colby/zfs/zfs/module/zfs/../../module/zfs/.spa.o.d  -nostdinc -isystem /usr/lib64/gcc/x86_64-suse-linux/4.5/include -I/usr/src/linux-2.6.34-12/arch/x86/include -Iinclude  -I/usr/src/linux-2.6.34-12/include -include include/generated/autoconf.h   -I/home/colby/zfs/zfs/module/zfs -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -Wframe-larger-than=2048 -fno-stack-protector -fomit-frame-pointer -fasynchronous-unwind-tables -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -Wno-unused-but-set-variable -DHAVE_SPL -D_KERNEL -DTEXT_DOMAIN=\"zfs-linux-kernel\" -DNDEBUG -include /home/colby/zfs/spl-0.6.0-rc4/spl_config.h -include /home/colby/zfs/zfs/zfs_config.h   -I/home/colby/zfs/zfs/include   -I/home/colby/zfs/spl-0.6.0-rc4/include   -I/home/colby/zfs/spl-0.6.0-rc4  -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(spa)"  -D"KBUILD_MODNAME=KBUILD_STR(zfs)" -D"DEBUG_HASH=32" -D"DEBUG_HASH2=7" -c -o /home/colby/zfs/zfs/module/zfs/../../module/zfs/.tmp_spa.o /home/colby/zfs/zfs/module/zfs/../../module/zfs/spa.c

      On same command-line, add -save-temps. Looks like __KERNEL__ is defined during this part of the build, hiding the rest of the file away when building spa.c
      Sending question to maintainer...

      May 17th, 2011

    1. Response from developer, needed to check out latest copy of spl to build against. Did so, and working build now.
    2. Default kernel installed after PREEMPT issue found above, sources not installed, need to install specific devel package:
      zypper in kernel-default-devel
    3. Install of libraries went to /usr/local/lib, need to add that to ld.so.conf so that other programs pick them up. Noticed that when running zpool, new process is opened that does the mount, loses LD_LIBRARY_PATH.
      # zpool create test1 mirror /dev/sdi /dev/sdj
      /sbin/mount.zfs: error while loading shared libraries: libspl.so.0: cannot open shared object file: No such file or directory
      cannot mount 'test1': Input/output error
      # echo "/usr/local/lib" > /etc/ld.so.conf.d/locallib.conf && ldconfig
      # zpool destroy -f test1
      # zpool create test1 mirror /dev/sdi /dev/sdj
      # zpool list
      test1   696G    84K   696G     0%  1.00x  ONLINE  -
      # zpool status
        pool: test1
       state: ONLINE
       scan: none requested
      	test1       ONLINE       0     0     0
      	  mirror-0  ONLINE       0     0     0
      	    sdi     ONLINE       0     0     0
      	    sdj     ONLINE       0     0     0
      errors: No known data errors