Skip to content
Follow
Ubuntu Linux

Mount External Storage as Read-Only in Ubuntu

Richard
Written by
Richard
Jan 18, 2023 Updated Sep 15, 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 lets you open and copy files from a USB drive or hard disk while blocking any changes or deletes. This setup protects important backups and shared data from accidental edits.

Advertisement

Ubuntu normally gives full read and write access to any plugged-in drive right away. Changing this behavior locks the drive so you can view its contents safely without risking data loss.

⚡ 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`.

Advertisement

Enable or disable mounting external storage devices as read-only

You can mount external storage read-only in Ubuntu to block any changes or accidental file deletions on your USB drives and external hard disks. To do this, open the Terminal and run a quick command to lock down the file system so you can only read the data stored on the device.

Open the Terminal by pressing Ctrl+Alt+T.

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

Run the following command in the terminal to make all external drives read-only:

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

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

Advertisement

Reverting 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

Dconf Editor (a visual settings manager for changing system configurations without typing commands) lets you mount external storage read-only through a graphical menu instead of the Terminal. Install the tool first by running the setup command, and then you can change your drive settings with a few clicks.

Installing the tool requires running this command in the terminal:

Advertisement

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.

ubuntu linux decon editor install
Ubuntu Linux decon editor install

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."

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

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.

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

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?

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.

Advertisement

📚 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 Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04
How to Uninstall Software in Ubuntu Linux
Ubuntu Linux How to Uninstall Software in Ubuntu Linux

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

Leave a Comment

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