Linux

我可以通過 netcat 恢復失敗的 (ZoL) ZFS 發送嗎?

  • October 23, 2017

我有一個包含使用 ZFS 本機加密加密的客戶端數據的捲。我試圖將它從 Ubuntu 伺服器發送到 Debian 伺服器。無法將zfs send數據接收到加密卷中,因此目標卷是一個新卷。

但是現在在一次小中斷後傳輸失敗,並且新容器沒有出現。

接收到的數據還在某處嗎?我可以以某種方式繼續此轉移嗎?

來源

zfs snapshot pool/bigdata@bup
zfs send pool/bigdata@bup | pv | nc -l -p 5555

目標

nc -w 10 1.2.3.4 5555 | zfs receive pool/bup201710

(其中 1.2.3.4 是源 IP 地址。)

注意: ZoL ZFS 原生加密在Debian 和 Ubuntu 附帶的 ZFS 版本 ( ) 中不可用。0.6.x此功能是在 2016 年實現的 ZoL,只能通過手動編譯獲得。它不在任何標記版本中,但可以從master他們的github 頁面上獲得。預計將包含在0.8. 看到 Ubuntu 和 Debian 遠遠落後於非常活躍的開發,許多人自己編譯 ZFS。

我不知道是否可以使用包含的加密(我假設它會),但通常您可以使用特殊標誌恢復失敗的發送send -t | recv -s,如果您的池支持它(文件來自 illumos,我假設它與ZOL):

zfs send [-Penv] -t receive_resume_token
      Creates a send stream which resumes an interrupted receive.  The
      receive_resume_token is the value of this property on the filesystem or
      volume that was being received into.  See the documentation for zfs
      receive -s for more details.

zfs receive [-Fnsuv] [-o origin=snapshot] filesystem|volume|snapshot
zfs receive [-Fnsuv] [-d|-e] [-o origin=snapshot] filesystem

  -s  If the receive is interrupted, save the partially received state,
      rather than deleting it.  Interruption may be due to premature
      termination of the stream (e.g. due to network failure or failure
      of the remote system if the stream is being read over a network
      connection), a checksum error in the stream, termination of the zfs
      receive process, or unclean shutdown of the system.

      The receive can be resumed with a stream generated by zfs send -t
      token, where the token is the value of the receive_resume_token
      property of the filesystem or volume which is received into.

      To use this flag, the storage pool must have the extensible_dataset
      feature enabled.  See zpool-features(5) for details on ZFS feature
      flags.

zfs receive -A filesystem|volume
      Abort an interrupted zfs receive -s, deleting its saved partially
      received state.

我會首先在本地(管道,no netcator pv)用一個小系統嘗試它,然後只是Ctrl-C轉移,看看它是否在原則上有效。

引用自:https://unix.stackexchange.com/questions/399538