Defragmentation for Copy-on-Write File-systems with Snapshots

File systems like ZFS, WAFL, and BTRFS use a copy-on-write transactional model to implement updates, crash recovery, snapshots, and clones. The resulting disk layout is one where there could be many physical pointers to a single block. This allows quick lookup when accessing a block from all the snapshots it belongs to.

When performing defragmentation, blocks are moved, requiring the update of all incoming pointers. A reverse lookup capability is needed, allowing the quick location of all pointers to a particular block. One solution is to track back-references. However, this adds an additional meta-data structure that needs to be kept up-to-date, taking up disk space and memory.

This document suggests a different approach, applying ideas from the realm of programming language garbage collection to file-system defragmentation.

By: Ohad Rodeh

Published in: RJ10465 REVISED in 2010


This Research Report is available. This report has been submitted for publication outside of IBM and will probably be copyrighted if accepted for publication. It has been issued as a Research Report for early dissemination of its contents. In view of the transfer of copyright to the outside publisher, its distribution outside of IBM prior to publication should be limited to peer communications and specific requests. After outside publication, requests should be filled only by reprints or legally obtained copies of the article (e.g., payment of royalties). I have read and understand this notice and am a member of the scientific community outside or inside of IBM seeking a single copy only.


Questions about this service can be mailed to .