Mount External Storage as Read-Only in Ubuntu
Mounting external storage as read-only in Ubuntu locks your files so you cannot change or delete them by mistake. This setup lets you open and copy everything on a USB drive or hard disk, while stopping any new data from being saved or edited.
Ubuntu normally lets you read and write to any plugged-in drive right away. Setting a drive to read-only gives you extra safety for important backups or shared files.
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 mounting external storage devices as read-only. Viewing files on USB sticks or external hard drives works normally, but altering or deleting them remains restricted. This read-only mounting serves as a safety feature, preventing accidental data loss.
System modifications require using the Ubuntu Terminal. Launch this interface by pressing the Super key and searching for ‘Terminal,’ or use the keyboard shortcut Ctrl+Alt+T.

Run the following command in the terminal to make all external drives read-only:
gsettings set org.gnome.desktop.lockdown mount-removable-storage-devices-as-read-only trueReverting this behavior to permit writing requires running a different 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
The Dconf Editor tool acts as a visual settings manager for the system, letting users change configuration values without typing terminal commands. Installing the utility comes first before making any configuration changes.
Installing the tool requires running this command in the terminal:
sudo apt update && sudo apt install dconf-editor
Learn more about software management via the guide on How to add or remove software on Ubuntu Linux.

Launch Dconf Editor from the app menu after completing the installation. Navigate through the following schema path: org -> gnome -> desktop -> media-handling
Locate the setting labeled "mount-removable-storage-devices-as-read-only" and toggle the switch to "On."

Enforcing read-only status on external storage stops any connected USB drive from accepting new writes. Notifications or lock icons appear to signal that writing to the device remains blocked.

Conclusion
Controlling whether external drives mount as read-only on an Ubuntu computer helps prevent accidental file modifications.
Questions or assistance requests belong in the comment section below.
Was this guide helpful?
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.
No comments yet — be the first to share your thoughts!