英文:
Created a zpool without dataset
问题
I have a long existing zpool consisting of 2 disks.
现有一个长期存在的 zpool,由 2 个磁盘组成。
Now i think i originally did not explicitly create a filesystem in the pool like: pool/myfilesystem.
现在我认为最初在池中没有明确创建文件系统,例如:pool/myfilesystem。
So my data resides in the root of the pool (i guess the pool itself is also a filesystem)
因此,我的数据位于池的根目录中(我猜测池本身也是一个文件系统)
The zfs list command shows the pool name:zfs-samba with no embedded filesystem.
zfs list 命令显示池的名称为 zfs-samba,没有嵌入的文件系统。
Can i correct this and 'move' all the data including snapshots to a filesystem like: zfs-samba/myfilesystem ?
我可以纠正这个问题,并将所有数据,包括快照,移到一个文件系统,例如:zfs-samba/myfilesystem 吗?
If this is not possible, how should i copy all data + snapshots to a newly create filesystem?
如果这不可能,我应该如何将所有数据和快照复制到一个新创建的文件系统?
英文:
I have a long existing zpool constisting of 2 disks.
Now i think i originally did not explicitly created a filesystem in the pool like: pool/myfilesystem.
So my data resides in the root of the pool (i guess the pool itself is also a filesystem)
><pre>zpool status
pool: zfs-samba
state: ONLINE
NAME STATE READ WRITE CKSUM
zfs-samba ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
sdb ONLINE 0 0 0
sdc ONLINE 0 0 0
</pre>
<pre>zfs list
NAME USED AVAIL REFER MOUNTPOINT
zfs-samba 427G 472G 190G /zfs-samba
zfs-samba@20180305 2,24G - 129G -
zfs-samba@20180324 2,71G - 130G -
a lot of snapshots...
</pre>
The zfs list command shows the pool name:zfs-samba with no embedded filesystem.
Can i correct this and 'move' all the data including snapshots to
a filesystem like: zfs-samba/myfilesystem ?
If this is not possible, how should i copy all data + snapshots to a
newly create filesystem?
答案1
得分: 1
这是根数据集,因此,您无法重命名或删除它。根数据集是在创建存储池时创建的。
但是,您可以创建根数据集的快照以及子数据集的快照,然后通过运行 zfs clone tank@snapshot tank/target
来克隆它们。
如果您需要包括所有快照,您需要使用 zfs send-recv
。这已在Server Fault上回答过。
英文:
This is the root dataset, so, you can't rename nor delete it. The root dataset is created along pool creation.
However, you can create a snapshot of the root dataset along with a snapshot of the child datasets, then, clone them by running zfs clone tank@snapshot tank/target
.
If you need to include all the snapshots, you need to use zfs send-recv
. This has been answered at Server Fault.
答案2
得分: 1
以下是翻译的内容:
所以我认为纠正这个问题的最佳方法是:
- 打破镜像
- 删除dsk1中的池,重新在根文件系统内创建池和文件系统
- 从dsk2发送接收到dsk1
- 删除dsk2中的池,将dsk2添加到与dsk1的镜像
这样做安全吗?
英文:
So I think the best way to correct this:
- Break the mirror
- Delete the pool in dsk1, recreate pool + filesystem inside root filesystem
- Zfs send-recvfrom dsk2 to dsk1
- Delete pool in dsk2, add dsk2 to mirror with dsk1
Is this a safe way?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论