> For the complete documentation index, see [llms.txt](https://digitalgarden.batamladen.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://digitalgarden.batamladen.com/notes/computer-concepts/file-systems/fragmentation.md).

# Fragmentation

Fragmentation in computing refers to the inefficient use of storage space, which occurs when files are divided into pieces and scattered across a disk or memory.

For example, lets say you downloaded 3 movies, red, blue and green, below is how they will be stored on the hard drive.

<figure><img src="/files/v84loNCu8lsLonNh1iaY" alt="" width="563"><figcaption></figcaption></figure>

Now lets say you didn't like the second movie and decide to delete it

<figure><img src="/files/CAHSNHbYurJKKokZgDmd" alt="" width="554"><figcaption></figcaption></figure>

Now this movies is not deleted as you would imagine, but the computer now knows that it can overwrite this space with other data, and that's why it is counting it in free space, although the movie is still there. And if this space is not used, you can get the data before, that is - the second movie. This is how data retrival is done.

But lets say now you saw a 3h Stiven Spilsberg movie and want to download it. This is how the disk would look now.

<figure><img src="/files/H9ej4mPwCZcxcLpA9w2T" alt="" width="553"><figcaption></figcaption></figure>

The device wants to utalise the "free" space and splits the movie in parts. This process is called **fragmentation**

When the movie is loaded into the RAM it works fine. But since it is on different places on the disk it takes a bit more time to load it to the RAM. and now imagine this done on almost all the files. Your computer slows down and you start to think maybe its because of the "Maria sent you a message" ads you clicked. But in fact your data is fragmented all over the place on the disk... and you downloaded a malware from the ad but nvm that now.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://digitalgarden.batamladen.com/notes/computer-concepts/file-systems/fragmentation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
