I have installed Debian stretch on ZFS (including the root filesystem) and have made a volume on the root pool which I am using as swap. Everything is working fine, except that I am seeing the following two error lines output to the screen when the machine shuts down (the error is not logged to any file, though):

[...] failed deactivating swap /dev/rpool/swap
[...] failed deactivating swap /dev/zd0

The swap exists in the pool as expected:

root@cerberus:~# zfs list -o name,type,used,avail,refer,mountpoint
rpool          filesystem   609G   290G    96K  none
rpool/stretch  filesystem   580G   290G   580G  /
rpool/swap     volume      29.8G   319G  29.1M  -

The O/S uses the swap as expected:

root@cerberus:~# cat /proc/swaps
Filename      Type            Size    Used    Priority
/dev/zd0      partition       29360124        0       -1

Finally, the devices exist and are linked as expected:

root@cerberus:~# dir /dev/zd0
brw-rw---- 1 root disk 230, 0 2017-01-18 19:51 /dev/zd0

root@cerberus:~# dir /dev/rpool/swap
lrwxrwxrwx 1 root root 6 2017-01-18 19:51 /dev/rpool/swap -> ../zd0

root@cerberus:~# dir /dev/zvol/rpool/swap
lrwxrwxrwx 1 root root 9 2017-01-18 19:51 /dev/zvol/rpool/swap -> ../../zd0

So what could cause that error message during shutdown? I have come to the conclusion that I can safely ignore those errors, but would prefer to know their cause.

EDIT 1 (for airhuff's comment)

These are the properties of the swap volume:

root@cerberus:~# zfs get all rpool/swap
NAME        PROPERTY               VALUE                  SOURCE
rpool/swap  type                   volume                 -
rpool/swap  creation               Tue Jan 17 16:36 2017  -
rpool/swap  used                   29.8G                  -
rpool/swap  available              319G                   -
rpool/swap  referenced             29.1M                  -
rpool/swap  compressratio          1.00x                  -
rpool/swap  reservation            none                   default
rpool/swap  volsize                28G                    local
rpool/swap  volblocksize           4K                     -
rpool/swap  checksum               on                     default
rpool/swap  compression            off                    local
rpool/swap  readonly               off                    default
rpool/swap  copies                 1                      default
rpool/swap  refreservation         29.8G                  local
rpool/swap  primarycache           metadata               local
rpool/swap  secondarycache         none                   local
rpool/swap  usedbysnapshots        0                      -
rpool/swap  usedbydataset          29.1M                  -
rpool/swap  usedbychildren         0                      -
rpool/swap  usedbyrefreservation   29.7G                  -
rpool/swap  logbias                throughput             local
rpool/swap  dedup                  off                    inherited from rpool
rpool/swap  mlslabel               none                   default
rpool/swap  sync                   always                 local
rpool/swap  refcompressratio       1.00x                  -
rpool/swap  written                29.1M                  -
rpool/swap  logicalused            28.6M                  -
rpool/swap  logicalreferenced      28.6M                  -
rpool/swap  snapshot_limit         none                   default
rpool/swap  snapshot_count         none                   default
rpool/swap  snapdev                hidden                 default
rpool/swap  context                none                   default
rpool/swap  fscontext              none                   default
rpool/swap  defcontext             none                   default
rpool/swap  rootcontext            none                   default
rpool/swap  redundant_metadata     all                    default
rpool/swap  com.sun:auto-snapshot  false                  local

EDIT 2 (for Michael Kjörling's comment):

Nothing of relevance is shown in dmesg output, and nothing of relevance is in any of the files in /var/log (this is what I meant by saying "...(the error is not logged to any file, though)..."). I even have used last -x in the hope to find out something, but to no avail.

Manually turning swap off does not seem to cause problems:

root@cerberus:~# swapoff /dev/zd0
root@cerberus:~# echo $?
  • Could you post the output of 'zfs get all rpool/swap'?
    – airhuff
    Jan 18, 2017 at 21:05
  • And while you are at it, tell us what happens if you manually swapoff /dev/zd0 (from a root shell, not through sudo, for thoroughness), including the value of $? immediately afterwards and if anything of relevance shows up in dmesg or /var/log/messages.
    – user
    Jan 18, 2017 at 21:08
  • Bummer, the properties of your swap file system look exactly as they should be...I have to think about this some more.
    – airhuff
    Jan 19, 2017 at 18:25
  • I still have absolutely no clue. I am suspecting that most of the messages during the shutdown process are coming from scripts which are made or altered by package maintainers (and not upstream developers), and there might be an error in the ZFS scripts. After all, Debian stretch is not released yet (should be in about a month).
    – Binarus
    Jan 19, 2017 at 19:44


You must log in to answer this question.

Browse other questions tagged .