Pattern detection and removal results in capacity savings and write avoidance. It scans incoming data, looking for duplicate 8kB chunks that meet predefined patterns, and they are never written. Instead, a small amount of metadata is created. This provides capacity savings since data that matches one of the predefined patterns does not need to be stored. Pattern detection and removal also avoids a write operation, which thereby prolongs flash media life.