Search code examples
diskfragmentation

Disk fragmentation calculation


So if I have disk with 10 free spaces. Add two files, A with size 3 and B with size 4.

A A A B B B B - - -

After removing A, - - - B B B - - -

Is now B fragmented or not?


Solution

  • No.

    B will stay fragmented if it was fragmented before, and it will stay unfragmented if it was unfragmented before (that is the case in your example).

    Removing a different file / object generally does not affect fragmentation of an object without it being moved itself.

    (Note that B was truncated to length 3 in your example as a consequence of deleting A, this does not normally happen either.)