Ubuntu Linux

Mount External Storage as Read-Only in Ubuntu

Richard
Written by
Richard
Jan 18, 2023 Updated Apr 18, 2026 2 min read

This article explains how to make external storage devices, like USB drives, read-only on Ubuntu Linux. Why do this? It helps prevent accidental changes to your files and stops others from saving data onto your drive. What happens when done? Any drive you plug in will let you see your files, but you will not be able to add, delete, or modify them.

Disclaimer: This is a convenience setting for desktop lockdown. It is not a robust security measure for preventing data exfiltration, as a determined user can bypass these settings.

Enable or disable mounting external storage devices as read-only

Ubuntu allows you to set a policy that forces all external drives to be read-only. This setting uses the org.gnome.desktop.lockdown schema, which remains the standard for Ubuntu 26.04 LTS and beyond. Note that this setting works consistently across both X11 and Wayland display sessions.

To change this, you will use the Terminal. Open the Terminal by pressing the Super key, searching for “Terminal,” or using the keyboard shortcut (CTRL + ALT + T).

Ubuntu Linux activities overview Terminal search
Ubuntu Linux activities overview Terminal search

To make all external drives read-only, type this command and press Enter:

gsettings set org.gnome.desktop.lockdown mount-removable-storage-devices-as-read-only true

To undo this and allow writing to drives again, type this command and press Enter:

gsettings set org.gnome.desktop.lockdown mount-removable-storage-devices-as-read-only false

Enable or Disable mounting storage devices as read-only devices using the Dconf Editor

If you prefer a visual interface, you can use the Dconf Editor. If you are familiar with Windows, you know about Windows Registry Editor. Dconf Editor is similar, acting as a tool to change system settings that are usually hidden.

First, install the tool by running this command in your terminal:

sudo apt update && sudo apt install dconf-editor

Read more about installing software on Ubuntu here: How to add or remove software on Ubuntu Linux

ubuntu linux decon editor install
Ubuntu Linux decon editor install

After installing, open Dconf Editor from your app menu. Navigate through these folders:

org -> gnome -> desktop -> lockdown

Find the setting labeled “mount-removable-storage-devices-as-read-only” and toggle the switch to “On.”

Ubuntu Linux enable or disable mount removable storage devices as read only
Ubuntu Linux enables or disables mounting removable storage devices as read-only.

When this is on, any USB drive you plug in will be read-only. You will see a notification or a lock icon indicating the device cannot be written to.

Ubuntu Linux usb ready only display
Ubuntu Linux USB ready only display

Conclusion

You now know how to control write access for external drives on your Ubuntu system. Keep in mind that this method is intended for desktop lockdown. If you are a system administrator looking for a more permanent, system-wide solution that cannot be easily bypassed by users, consider using udev rules to enforce mounting policies at the kernel level.

If you have questions or need help, please use the comment section below.

Was this guide helpful?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Exit mobile version