unbrice / shake

Shake is a defragmenter that runs in userspace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for ZFS (open zfs) filesystems

stevecs opened this issue · comments

ZFS being a copy on write filesystem has many problems with fragmentation the older the system gets. the standard answer usually is to copy everything (send/receive) which basically is backing up and restoring the filesystem. A user space tool like shake which I've used before on other FS's would greatly help here.

I pulled the current copy from github to see what it would do and pretty much every file handle gets the same error:

shake -v -p /var/log/clientlogs/test

IDEAL START END FRAGC CRUMBC AGE SHOCKED NAME
./shake: /var/log/clientlogs/test/checkpoint/backups/log.20170422010001.tgz: FIBMAP failed: Invalid argument
./shake: /var/log/clientlogs/test/checkpoint/backups/log.20170424010001.tgz: FIBMAP failed: Invalid argument
./shake: /var/log/clientlogs/test/checkpoint/backups/log.20170426010001.tgz: FIBMAP failed: Invalid argument
./shake: /var/log/clientlogs/test/checkpoint/backups/log.20170427010001.tgz: FIBMAP failed: Invalid argument
./shake: /var/log/clientlogs/test/checkpoint/backups/log.20170423010001.tgz: FIBMAP failed: Invalid argument
./shake: /var/log/clientlogs/test/checkpoint/backups/log.20170425010001.tgz: FIBMAP failed: Invalid argument
./shake: /var/log/clientlogs/test/syslog/2017/20170427-kern.log: FIBMAP failed: Invalid argument

This is running under a ubuntu 16.04.2LTS 64bit system.

uname -a

Linux loki 4.4.0-71-generic #92-Ubuntu SMP Fri Mar 24 12:59:01 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

dpkg -l | grep zfs

ii libzfs2 0.6.5.7-1trusty amd64 Native OpenZFS filesystem library for Linux
ii ubuntu-zfs 8
trusty amd64 Native ZFS filesystem metapackage for Ubuntu.
ii zfs-dkms 0.6.5.7-1trusty amd64 Native OpenZFS filesystem kernel modules for Linux
ii zfs-doc 0.6.5.7-1
trusty amd64 Native OpenZFS filesystem documentation and examples.
ii zfsutils 0.6.5.7-1~trusty amd64 Native OpenZFS management utilities for Linux

Please try my patch from #7... Does it fix it? Apparently, the author of shake seems to be busy or unresponsive.

commented

Late followup.....
Your pull (#17) doesn't help (Ubuntu 18.* 19.* and 20.*)

As an aside - it looks like brice has pulled in the executive.c (fs hinting) stuff already but not the linux.c stuff so you probably need to rebase this pull

also, it looks like the code is showing its age:

/ZFSMEDIA/SCRATCH/shakefs/shake-master/linux.c: In function ‘set_ptime’:
/ZFSMEDIA/SCRATCH/shakefs/shake-master/linux.c:177:3: warning: ‘attr_setf’ is deprecated: Use fsetxattr instead [-Wdeprecated-declarations]
  177 |   return attr_setf (fd, "shake.ptime", (char *) &date, DATE_SIZE,
      |   ^~~~~~
In file included from /ZFSMEDIA/SCRATCH/shakefs/shake-master/linux.c:32:
/usr/include/attr/attributes.h:143:12: note: declared here
  143 | extern int attr_setf (int __fd, const char *__attrname,
      |            ^~~~~~~~~
/ZFSMEDIA/SCRATCH/shakefs/shake-master/linux.c: In function ‘get_ptime’:
/ZFSMEDIA/SCRATCH/shakefs/shake-master/linux.c:188:7: warning: ‘attr_getf’ is deprecated: Use fgetxattr instead [-Wdeprecated-declarations]
  188 |       attr_getf (fd, "shake.ptime", (char *) &date, &size, ATTR_DONTFOLLOW))
      |       ^~~~~~~~~
In file included from /ZFSMEDIA/SCRATCH/shakefs/shake-master/linux.c:32:
/usr/include/attr/attributes.h:131:12: note: declared here
  131 | extern int attr_getf (int __fd, const char *__attrname, char *__attrvalue,
      |            ^~~~~~~~~
[ 71%] Building C object CMakeFiles/unattr.dir/signals.o
[ 78%] Building C object CMakeFiles/unattr.dir/unattr.o
/ZFSMEDIA/SCRATCH/shakefs/shake-master/unattr.c: In function ‘strip’:
/ZFSMEDIA/SCRATCH/shakefs/shake-master/unattr.c:114:5: warning: ‘attr_removef’ is deprecated: Use fremovexattr instead [-Wdeprecated-declarations]
  114 |     attr_removef (fd, *attr, ATTR_DONTFOLLOW);
      |     ^~~~~~~~~~~~
In file included from /ZFSMEDIA/SCRATCH/shakefs/shake-master/unattr.c:29:
/usr/include/attr/attributes.h:155:12: note: declared here
  155 | extern int attr_removef (int __fd, const char *__attrname, int __flags)
      |            ^~~~~~~~~~~~