Chunk flagging magic and block replacement