Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/en/guide/clone.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Cloning specific data does not involve copying the actual object storage data bu

![clone](../images/juicefs-clone.svg)

The clone result is purely a metadata copy, meaning all files still refer to the same underlying object storage blocks. Therefore, a clone behaves exactly like the original. When either the original or the clone is modified, the affected data blocks are copied on write, resulting in new blocks while the unchanged parts remain the same, still referencing the original blocks.
The clone result is a metadata copy only, where all the files still reference the same underlying object storage blocks. That is why a clone behaves the same in every way as its originals. Upon any file data modification, new data is written to new object storage blocks, with its associating metadata redirected to the new blocks as well (ROW, Redirect-on-Write), while the unchanged part of the files remains the same, still referencing the original blocks. And just like native JuiceFS files, random write on a clone can result in file fragmentations, you can merge them with `juicefs compact` to process the slice of the file,in order to improve read performance.

Note that system tools like disk-free or disk-usage (`df`, `du`) show the space used by the cloned data, but the underlying object storage space remains unchanged since the blocks are not duplicated. Cloning replicates metadata, so it will occupy the same metadata engine storage space as the original.

Expand Down
3 changes: 2 additions & 1 deletion docs/en/images/juicefs-arch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/zh_cn/guide/clone.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 6

![clone](../images/juicefs-clone.svg)

克隆结果是纯粹的元数据拷贝,实际引用的对象存储块和源文件相同,因此在各方面都和源文件一样,可以正常读写。有任何一方文件数据被实际修改时,对应的数据块变更会以写入时复制(Copy-on-Write)的方式,写入到新的数据块,而其他未经修改的文件区域,由于对象存储数据块仍然相同,所以引用关系依然保持不变。
克隆结果是纯粹的元数据拷贝,实际引用的对象存储块和源文件相同,因此在各方面都和源文件一样,可以正常读写。有任何一方文件数据被实际修改时,对应的数据块变更会以写入时重定向(ROW,Redirect on Write)的方式,写入到新的数据块,并将指针指向新的数据块。而其他未经修改的文件区域,由于对象存储数据块仍然相同,所以引用关系依然保持不变。如果对快照文件进行随机写、覆盖写等操作,和普通的 JuiceFS 文件一样,快照文件也会产生文件碎片,你可以通过执行`juicefs compact`来对文件的碎片进行合并,来提升读取效率

需要注意的是,**克隆产生的元数据,也同样占用文件系统存储空间,以及元数据引擎的存储空间**,因此对庞大的目录进行克隆操作时请格外谨慎。

Expand Down
3 changes: 2 additions & 1 deletion docs/zh_cn/images/juicefs-arch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.