How to Stop Ubuntu from Automatically Formatting USB Drives

The Accidental Wipe

When you plug a brand-new, unformatted USB drive into an Ubuntu Linux machine, the system will usually detect the raw block device. In some desktop environments or when using specific third-party automounting utilities, a pop-up might appear offering to automatically initialize or format the drive so it can be mounted and used immediately. While convenient for entirely blank drives, this is a terrifying prospect if you have plugged in a corrupted drive for data recovery purposes, or a drive utilizing a proprietary filesystem (like a camera’s SD card) that Ubuntu simply doesn’t recognize. An accidental click could instantly wipe the partition table.

Disabling Automount Utilities

To ensure data safety and stop Ubuntu from automatically attempting to format or initialize unrecognized USB drives upon insertion, you must rely on manual mounting via the Disks utility or the terminal.

Standard Ubuntu (using GNOME) rarely forces a format without explicit user consent, but if you have installed utilities like `udisks2` auto-mounters or are using a different file manager (like Thunar or PCManFM), the behavior changes. If you are experiencing aggressive formatting prompts, the safest approach is to disable the automounting daemon entirely. Open a terminal (Ctrl+Alt+T). If you are using the default GNOME environment, you can disable the auto-mounting behavior of Nautilus via dconf. Type gsettings set org.gnome.desktop.media-handling automount false and press Enter. Then type gsettings set org.gnome.desktop.media-handling automount-open false. Now, when you plug in a drive, Ubuntu will do absolutely nothing. You must manually open the Disks utility (gnome-disk-utility), select the drive, and choose to mount it or format it explicitly, giving you complete, deliberate control.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.