Linux
系統升級後,ZFS 數據集不再在重新啟動時自動掛載
我有一個 Arch linux ZFS 備份系統,它很長時間沒有更新,因為它執行良好,沒有理由打擾。但是,在最近一次升級之後,我的 ZFS 數據集在我重新啟動時不再自動掛載。不幸的是,這些服務沒有顯示任何錯誤消息,我可以執行
# zfs mount -a
系統啟動後沒有問題。一些細節:
[root@elephant etc]# uname -a Linux elephant 4.16.11-1-ARCH #1 SMP PREEMPT Tue May 22 21:40:27 UTC 2018 x86_64 GNU/Linux [root@elephant etc]# pacman -Q | grep spl spl-dkms 0.7.9-1 spl-utils 0.7.9-1 [root@elephant etc]# pacman -Q | grep zfs zfs-dkms 0.7.9-1 zfs-utils 0.7.9-1 root@elephant etc]# zfs get mountpoint backup/www NAME PROPERTY VALUE SOURCE backup/www mountpoint /backup/www default [root@elephant etc]# zfs get mountpoint backup/data NAME PROPERTY VALUE SOURCE backup/data mountpoint /backup/data default [root@elephant etc]# zfs get mountpoint backup/metadata NAME PROPERTY VALUE SOURCE backup/metadata mountpoint /backup/metadata default
特別注意 zfs-mount 服務似乎非常滿意:
[root@elephant ~]# systemctl -l status zfs* ● zfs.target - ZFS startup target Loaded: loaded (/usr/lib/systemd/system/zfs.target; enabled; vendor preset: enabled) Active: active since Mon 2018-05-28 15:30:18 CDT; 1min 32s ago May 28 15:30:18 elephant systemd[1]: Reached target ZFS startup target. ● zfs-import-cache.service - Import ZFS pools by cache file Loaded: loaded (/usr/lib/systemd/system/zfs-import-cache.service; enabled; vendor preset: enabled) Active: active (exited) since Mon 2018-05-28 15:30:18 CDT; 1min 32s ago Process: 659 ExecStart=/usr/bin/zpool import -c /etc/zfs/zpool.cache -aN (code=exited, status=0/SUCCESS) Process: 656 ExecStartPre=/sbin/modprobe zfs (code=exited, status=0/SUCCESS) Main PID: 659 (code=exited, status=0/SUCCESS) May 28 15:30:12 elephant systemd[1]: Starting Import ZFS pools by cache file... May 28 15:30:18 elephant systemd[1]: Started Import ZFS pools by cache file. ● zfs-zed.service - ZFS Event Daemon (zed) Loaded: loaded (/usr/lib/systemd/system/zfs-zed.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2018-05-28 15:30:18 CDT; 1min 32s ago Docs: man:zed(8) Main PID: 1586 (zed) Tasks: 3 (limit: 4915) Memory: 5.6M CGroup: /system.slice/zfs-zed.service └─1586 /usr/bin/zed -F May 28 15:30:18 elephant systemd[1]: Started ZFS Event Daemon (zed). May 28 15:30:18 elephant zed[1586]: ZFS Event Daemon 0.7.9-1 (PID 1586) May 28 15:30:18 elephant zed[1586]: Processing events since eid=0 May 28 15:30:18 elephant zed[1591]: eid=1 class=history_event pool_guid=0x7314E37F1A1C0088 May 28 15:30:18 elephant zed[1593]: eid=2 class=config_sync pool_guid=0x7314E37F1A1C0088 May 28 15:30:18 elephant zed[1595]: eid=3 class=pool_import pool_guid=0x7314E37F1A1C0088 May 28 15:30:18 elephant zed[1618]: eid=5 class=config_sync pool_guid=0x7314E37F1A1C0088 ● zfs-mount.service - Mount ZFS filesystems Loaded: loaded (/usr/lib/systemd/system/zfs-mount.service; enabled; vendor preset: enabled) Active: active (exited) since Mon 2018-05-28 15:30:12 CDT; 1min 38s ago Process: 657 ExecStart=/usr/bin/zfs mount -a (code=exited, status=0/SUCCESS) Main PID: 657 (code=exited, status=0/SUCCESS) May 28 15:30:12 elephant systemd[1]: Starting Mount ZFS filesystems... May 28 15:30:12 elephant systemd[1]: Started Mount ZFS filesystems. [root@elephant ~]#
然而:
[root@elephant ~]# zfs mount [root@elephant ~]# [root@elephant ~]# zfs mount -a [root@elephant ~]# zfs mount backup /backup backup/data /backup/data backup/metadata /backup/metadata backup/www /backup/www
我已經沒有時間來處理這個問題了,我只想將所有數據集切換到傳統掛載,但我仍然很好奇為什麼這適用於 zfs 0.6.x 但不適用於 0.7.9 - - 可能是某種系統不兼容?
原來我的問題是我沒有啟用zfs-import.target。當我第一次使用 ZoL 0.6.x 設置這個系統時,我什至不確定這個單元文件是否存在,但無論如何
systemctl enable zfs-import.target
解決了這個問題。ZFS 數據集在啟動時再次正確掛載。