Skip to content
Ubuntu Linux

Mount External Storage as Read-Only in Ubuntu

Richard
Written by
Richard
Updated 3 min read
How to Use Sticky Notes in Windows 11
How to Use Sticky Notes in Windows 11
Before you start
  • 9 steps
  • Needs administrator rights

Mounting external storage as read-only in Ubuntu lets you open and copy files from a USB drive or external hard disk while blocking any changes or deletes. It protects backups and shared data from accidental edits, and it is a useful habit when you plug in a drive you don’t fully trust.

By default, Ubuntu gives you full read and write access to any drive you plug in. The steps below change that, so you can look through a drive’s contents without risking data loss. Both methods are reversible, and nothing on the drive itself is altered.

⚡ 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

The quickest way to block changes and accidental deletions on USB drives and external hard disks is from the Terminal. One command locks the file system behavior so you can only read the data on the device.

  1. Press Ctrl+Alt+T to open the Terminal.
  2. Wait for a window with a command prompt to appear. You type the commands below at that prompt.
Ubuntu Linux activities overview Terminal search
Ubuntu Linux activities overview Terminal search

Run the command below to make external drives read-only. Copy it exactly, then press Enter.

Advertisement

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

The change applies to drives mounted from now on. If a drive is already plugged in, unplug it and connect it again so it mounts under the new rule. After that, copying files off the drive works, but saving, editing or deleting files on it should be refused.

To go back to normal read and write behavior, run this different command:

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

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

Dconf Editor is a visual settings manager. It lets you change system configuration through a graphical interface instead of typing commands. You can use it to mount external storage read-only if you prefer clicking to typing. Install the tool first, then change the drive setting with a few clicks.

Open the Terminal again with Ctrl+Alt+T if it is closed, and run the command below to install Dconf Editor. You need an account with administrator rights, and you may be asked for your password. The password does not show on screen as you type it.

sudo apt update && sudo apt install dconf-editor

Learn more about software management in the guide on How to add or remove software on Ubuntu Linux.

ubuntu linux decon editor install
Ubuntu Linux decon editor install
  1. Open the app menu and launch Dconf Editor. If it is not listed, check that the installation finished without errors.
  2. On the first launch, you may see a warning about making changes. Read it, then accept it to continue.
  3. Go to this schema path: org > gnome > desktop > media-handling
  4. You should now see a list of settings for removable media.
  1. Find the setting labeled mount-removable-storage-devices-as-read-only.
  2. Switch the toggle to On.
  3. Unplug any connected drive and plug it back in so it mounts with the new setting.

If you don’t see this setting in your version of Ubuntu, use the Terminal method above instead. To undo the change, return to the same place and switch the toggle back to Off.

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

With read-only status enforced, a connected USB drive stops accepting new writes. You may see notifications or lock icons showing that writing to the device is blocked.

To check, try to create a new file or delete one on the drive in the Files app. The action should fail with an error about the drive being read-only or permission being denied. Opening and copying files from the drive to your computer should still work.

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

Conclusion

Deciding whether external drives mount as read-only on your Ubuntu computer helps prevent accidental file changes. Use the Terminal commands for a fast switch either way, or Dconf Editor if you prefer a graphical setting. Remember to reconnect the drive after you change the behavior.

If you have questions or need help, leave a comment below.

Have a question about this guide?

Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.

Did this guide fix your problem?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

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

Leave a Comment

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