> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enable a read-only root filesystem

A read-only root filesystem prevents modifications to the root filesystem at runtime. This helps protect system files against unintended or unauthorized changes and improves the security of the system.

By default Qualcomm Linux root filesystem is read-write. It supports configuring the root filesystem as read-only by using the Yocto Project `read-only-rootfs` image feature.

## **Enable the read-only root filesystem**

To enable a read-only root filesystem, add `read-only-rootfs` to `IMAGE_FEATURES` in the image recipe.

In `meta-qcom-distro/recipes-products/images/qcom-minimal-image.bb`, do the following changes:

```text theme={null}
IMAGE_FEATURES += " read-only-rootfs "
```

The `read-only-rootfs` image feature configures the generated root filesystem to be mounted as read-only at runtime.

> [!NOTE]
>
>
> Packages included in an image with `read-only-rootfs` must complete the required configuration during image creation. Packages that require delayed post-installation operations which modify the root filesystem at runtime can cause the image build to fail.

## Build the image

Set up the Qualcomm Linux build environment for the required target.

For instructions to set up the build environment, see the Qualcomm Linux Build Guide.

Build the required image. For example:

```text theme={null}
bitbake qcom-minimal-image
```

The generated image contains the root filesystem configured for read-only operation.

## Verify the read-only root filesystem

After flashing and booting the image on the target, connect to the device.

Run the following command to check the mount options of the root filesystem:

```bash theme={null}
mount | grep " on / "
```
