分割 ZFS 克隆?

分割 ZFS 克隆?

是否可以分割 zfs 克隆以允许销毁原始快照?

# zfs create zpool1/test1
# zfs snapshot zpool1/test1@snap1
# zfs clone zpool1/test1@snap1 zpool1/test1clone
# zfs destroy zpool1/test1@snap1
cannot destroy 'zpool1/test1@snap1': snapshot has dependent clones
use '-R' to destroy the following datasets:
zpool1/test1clone
# 

此时,它想要“实现” zpool1/test1clone 文件系统,本质上就像我执行了一个zfs send zpool1/test1@snap1 | zfs receive zpool1/test1clone.

答案1

您需要将 ZFS 克隆提升为文件系统,以便能够销毁原始快照/文件系统。

zfs promote zpool1/test1clone

请参见:http://download.oracle.com/docs/cd/E19253-01/819-5461/gcvfl/index.html

zfs promote filesystem
     Promotes a clone file system to no longer  be  dependent
     on its "origin" snapshot. This makes it possible to des-
     troy the file system that the clone  was  created  from.
     The   clone   parent-child  dependency  relationship  is
     reversed, so that the "origin"  file  system  becomes  a
     clone of the specified file system.

答案2

如果您不希望子文件系统和父文件系统之间存在任何联系,则必须执行 zfs 发送/接收。

相关内容