Skip to content
Follow
Ubuntu Linux

Mount External Storage as Read-Only in Ubuntu

Richard
Written by
Richard
Jan 18, 2023 Updated Jul 14, 2026 2 min read
How to Use Sticky Notes in Windows 11
How to Use Sticky Notes in Windows 11

Mounting external storage as read-only in Ubuntu protects your files from accidental changes or deletions.

This means that once the drive is mounted this way, you can see and copy files from it, but you cannot add, delete, or edit anything on it. It acts like a safety lock for your data.

This is especially helpful for drives with important backups or when using Ubuntu 22.04 LTS installation media, preventing any unintentional modifications.

By default, Ubuntu lets you read and write to external drives. This guide shows you how to change that behavior for specific drives.

⚡ Quick Answer

Open the Terminal and run `gsettings set org.gnome.desktop.lockdown mount-removable-storage-devices-as-read-only true`. To allow writing again, use `gsettings set org.gnome.desktop.lockdown mount-removable-storage-devices-as-read-only false`.

Enable or disable mounting external storage devices as read-only

Ubuntu allows you to mount external storage devices as read-only. This means you can view files on drives such as USB sticks or external hard drives, but you cannot change or delete them. This read-only mounting serves as a safety feature, preventing accidental data loss.

The Ubuntu Terminal allows you to make changes to your system. Open the Ubuntu Terminal by pressing the Super key and searching for ‘Terminal,’ or use 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 the following command and press Enter:

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

To revert this and allow writing to drives again, use this command:

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

You can use the Dconf Editor tool to set whether external storage devices automatically mount as read-only in Ubuntu. Dconf Editor acts as a visual settings manager for your system, letting you make changes without typing commands. Before using it, you’ll need to install it first.

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.

Setting the external storage as read-only prevents any USB drive you plug in from being written to. You will see a notification or a lock icon that indicates the device cannot be written to.

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

Conclusion

You’ve learned how to control if external drives on your Ubuntu computer mount as read-only, which helps prevent accidental changes to your files.

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

Was this guide helpful?

Was this 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.

📚 Related Tutorials

How to Enable or Disable Access to Removable Storage Devices in Windows 11
Windows How to Enable or Disable Access to Removable Storage Devices in Windows 11
How to Install Additional Software on Ubuntu
Ubuntu Linux How to Install Additional Software on Ubuntu
How to Uninstall Software in Ubuntu Linux
Ubuntu Linux How to Uninstall Software in Ubuntu Linux
How to Disable Logout on Ubuntu Desktop
Ubuntu Linux How to Disable Logout on Ubuntu Desktop

No comments yet — be the first to share your thoughts!

Leave a Comment

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