How to Mount Storage Devices as Read-only devices on Ubuntu Linux

This article explains the steps you can take to enable or disable mounting external storage devices as read-only devices in Ubuntu Linux.

By default, when you connect an external storage drive to Ubuntu Linux, users will be able to read from and write to it. Ubuntu Linux also has settings that allow system administrators to mount all storage devices as read-only devices so that users can only read from and not write to the drives.

When this policy is enabled, any external storage device connected to Ubuntu Linux will not be writable and thus protecting your confidential and personal data from being written to a storage device attached to your computer.

Enable or disable mounting external storage devices as read-only

As described above, Ubuntu Linux allows system administrators to set a policy setting to mount all external storage devices as read-only devices.

Below is how to do that.

Enable or Disable mounting storage devices as read-only via the terminal

As with many other Linux distributions, the majority of the system settings changes are done using the command terminal. Most Linux users should be somehow familiar with the command terminal.

First, open the Terminal app in Ubuntu Linux.

You can do that by pressing the Super key (or Windows key) to show the Overview screen. Then use the search box to search for ‘Terminal‘.

Select the Terminal app to launch.

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

Alternatively, press the keyboard shortcut (CTRL + ALT + T) on your keyboard to launch the Terminal app.

When the Terminal app opens, type the commands below to enable the policy to mount all external storage devices as read-only devices.

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

To reverse the change and mount all storage devices as normal read and write, run the commands below.

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 also use Dconf Editor to make common system changes if you can’t use the command Terminal app.

If you are familiar with Windows, then you know about Windows Registry Editor.

Ubuntu Linux doesn’t have a registry database to configure hidden system settings. Howerver, Ubuntu Linux uses the Dconf Editor tool to change low-level system configurations and settings.

You can call it a Ubuntu Linux Registry Editor because it provides similar functionality, but without a massive database that is in the Windows system.

To use Dconf Editor, you must first install it since it doesn’t come with Ubuntu Linux.

Read the post below to learn how to install software on Ubuntu Linux.

How to add or remove software on Ubuntu Linux

In the Ubuntu Software app, search for Dconf Editor to install.

ubuntu linux decon editor install
ubuntu Linux decon editor install

After installing and launching the Dconf Editor app, navigate to the path below:

org -> gnome -> desktop -> lockdown

Scroll down and locate the mount removable storage devices as read-only settings and toggle the button to the On position to mount all storage devices as read-only.

To enable it, simply toggle the button back to the Off position.

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 setting is enabled, the next time you connect a USB storage device to Ubuntu Linux, you won’t be able to write to it.

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

That should do it!

Conclusion:

This post showed you how to enable or disable mounting storage devices as read-only devices on Ubuntu Linux. If you find any error above or have something to add, please use the comment form below.