The document describes iDedup, a system for performing inline data deduplication on primary storage systems while minimizing performance impacts. It leverages two insights about duplicated data in real-world workloads: 1) spatial locality exists where duplicated data occurs in sequences of disk blocks, and 2) temporal locality exists where duplicated data is accessed repeatedly close in time. The system performs selective deduplication of block sequences to reduce fragmentation and seeks during reads. It also replaces expensive on-disk deduplication metadata with a smaller in-memory fingerprint cache to reduce writes. Evaluation shows the system achieves 60-70% deduplication with less than 5% CPU overhead and 2-4% increased latency.