# Disable Swap Memory on SD Card

Here's how we can disable the swap memory on SD Card in Raspberry Pi -

## Disabling the swap memory on SD Card

**1. Turn off the swap file:**

```bash
sudo dphys-swapfile swapoff
```

**2. Uninstall the swap file:**

```bash
sudo dphys-swapfile uninstall
```

**3. Remove the swap file service:**

```bash
sudo update-rc.d dphys-swapfile remove
```

**4. Remove the swap file manager \[Optional]:**

```bash
sudo apt purge dphys-swapfile -y
```

**5. Verifiy the swap is disabled:**

```bash
free -mh
```

***Source:*** [***Pi Australia***](https://raspberry.piaustralia.com.au/blogs/news/how-to-disable-swap-on-raspberry-pi-os-and-use-a-usb-drive-instead)


---

# Agent Instructions: 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:

```
GET https://til.devjugal.com/linux/raspberry-pi/disable-swap-memory-on-sd-card.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
