我已在 ZFS(包括根文件系统)上安装了 Debian Stretch,并在根池上创建了一个卷,我将其用作交换。一切工作正常,除了当机器关闭时我看到以下两条错误行输出到屏幕上(尽管该错误没有记录到任何文件中):
[...] failed deactivating swap /dev/rpool/swap
[...] failed deactivating swap /dev/zd0
交换按预期存在于池中:
root@cerberus:~# zfs list -o name,type,used,avail,refer,mountpoint
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 -
操作系统按预期使用交换:
root@cerberus:~# cat /proc/swaps
Filename Type Size Used Priority
/dev/zd0 partition 29360124 0 -1
最后,设备存在并按预期链接:
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
那么什么可能导致关机期间出现该错误消息呢?我得出的结论是,我可以安全地忽略这些错误,但更愿意知道它们的原因。
编辑1(对于airhuff的评论)
这些是交换卷的属性:
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
编辑2(Michael Kjörling 的评论):
输出中没有显示任何相关内容dmesg
,并且任何文件中都没有显示任何相关内容/var/log
(这就是我所说的“...(错误没有记录到任何文件中)...”)。我什至曾试图last -x
找出一些东西,但无济于事。
手动关闭交换似乎不会引起问题:
root@cerberus:~# swapoff /dev/zd0
root@cerberus:~# echo $?
0
root@cerberus:~#