How to Stop Nemo From Freezing When You Plug In a New USB Stick

Why Nemo Sometimes Freezes on USB Insertion

Plug a USB stick into a Cinnamon‑powered machine and you’ll often see Nemo pause for a few seconds.
It’s not a mysterious bug; the culprit is usually the thumbnail generation daemon (nemo‑thumbnailer).
When the drive is large, full of files, or uses a filesystem that the thumbnailer struggles with, the UI can stall.
For a homelab operator juggling media libraries or a developer who needs a snappy workflow, that pause can feel like a real roadblock.

Below is a practical, hands‑on walk‑through that works on Debian‑based, Arch‑based, and Fedora‑based Cinnamon setups.
We’ll cover how to confirm the problem, disable thumbnails for removable media, swap to a lighter thumbnailer, add a quick‑mount script, and keep security in mind.


1. Confirm the Cause

First, make sure it’s really the thumbnailer that’s biting.

# In a terminal, while you plug in the stick, run
journalctl -f -u nemo.service

You’ll see something like:

nemo[1234]: Thumbnailing /media/user/USB/largefile.iso

If you notice a steady stream of “Thumbnailing” lines or a long queue, the daemon is the bottleneck.

Another quick sanity check: plug in the stick, hit Ctrl+Alt+Del to open System Monitor, and watch the CPU usage of nemo-thumbnailer.
A 100 % spike confirms the suspicion.


2. Disable Thumbnails for Removable Media

The simplest fix is to stop Nemo from asking the thumbnailer for any USB device.

2.1 Edit Nemo’s Preferences

# Keep automatic mounting (default)
gsettings set org.cinnamon.desktop.media-handling disable-mounting false

# Disable all thumbnailing
gsettings set org.cinnamon.desktop.media-handling disable-thumbnailing true

That turns off thumbnailing globally.
If you still want thumbnails on internal drives, we’ll get more granular later.

2.2 Mark USB Devices with a udev Rule

Create a rule that tags USB block devices with a custom environment variable:

sudo nano /etc/udev/rules.d/99-no-thumbnail.rules

Add:

ACTION=="add", SUBSYSTEM=="block", ATTRS{idVendor}=="*", ATTRS{idProduct}=="*", ENV{NO_THUMBNAIL}="1"

Reload udev:

sudo udevadm control --reload-rules
sudo udevadm trigger

Now wrap the real thumbnailer so it exits early when that flag is set:

sudo nano /usr/bin/nemo-thumbnailer
#!/usr/bin/env bash
if [ "$NO_THUMBNAIL" = "1" ]; then
    exit 0
fi
# original thumbnailer command follows

Make it executable:

sudo chmod +x /usr/bin/nemo-thumbnailer

With this, internal drives keep generating thumbnails while USB sticks do not.


3. Swap to a Faster Thumbnailer

If you still crave thumbnails but want a snappier experience, replace nemo-thumbnailer with something leaner like ffmpegthumbnailer.

sudo apt install ffmpegthumbnailer

Create a wrapper:

sudo nano /usr/bin/nemo-thumbnailer
#!/usr/bin/env bash
# Use ffmpegthumbnailer for common media types
case "$1" in
    *.jpg|*.png|*.gif|*.mp4|*.mkv|*.avi)
        ffmpegthumbnailer -i "$1" -o "$2" -s 256
        ;;
    *)
        # fallback to the original binary
        /usr/lib/nemo/nemo-thumbnailer "$@"
        ;;
esac

Make it executable:

sudo chmod +x /usr/bin/nemo-thumbnailer

Insert a USB stick with a large video file; the thumbnail should appear almost instantly and the UI stays responsive.


4. Quick‑Mount Script for Power Users

Sometimes you just want the folder open, no thumbnail delay.
Here’s a tiny helper that mounts a device and opens it in Nemo right away.

sudo nano /usr/local/bin/mount-and-open
#!/usr/bin/env bash
DEVICE=$1
if [ -z "$DEVICE" ]; then
    echo "Usage: mount-and-open /dev/sdb1"
    exit 1
fi

# Mount without auto‑thumbnailing
udisksctl mount -b "$DEVICE" --no-auto-thumbnail

# Find the mount point
MOUNTPOINT=$(udisksctl info -b "$DEVICE" | grep "Mount point" | awk '{print $3}')

# Open in Nemo
nemo "$MOUNTPOINT" &

Make it executable:

sudo chmod +x /usr/local/bin/mount-and-open

Now, after plugging in a stick, run:

sudo mount-and-open /dev/sdb1

The stick mounts instantly, and Nemo pops up without generating thumbnails.


5. Security Considerations

USB sticks can carry malware that targets filesystem drivers or thumbnail generators.
Disabling thumbnails reduces that attack surface. If you must keep thumbnails on internal drives:

  • Run the thumbnailer in a sandbox: firejail or apparmor.
  • Use SELinux/AppArmor to limit the daemon’s file access.

Example with firejail:

sudo apt install firejail
firejail --private=/tmp --quiet ffmpegthumbnailer "$1" -o "$2" -s 256

Add that to the wrapper in section 3.


6. Troubleshooting Checklist

Symptom Likely Cause Fix
Nemo freezes >10 s on USB insertion Thumbnailer overloaded Disable thumbnails or swap to ffmpegthumbnailer
No thumbnails on internal drives Global thumbnailing disabled Re‑enable via gsettings
Stick mounts but folder doesn’t open Wrong mount point Use udisksctl info to find the correct path
Thumbnailer crashes on ISO files Unsupported format Add a fallback to isoinfo or skip ISO files
Security alerts on thumbnail generation Untrusted media Run thumbnailer in a sandbox or disable entirely

7. Quick Commands Cheat Sheet

# Check thumbnailing state
gsettings get org.cinnamon.desktop.media-handling disable-thumbnailing

# Disable thumbnails globally
gsettings set org.cinnamon.desktop.media-handling disable-thumbnailing true

# Enable thumbnails globally
gsettings set org.cinnamon.desktop.media-handling disable-thumbnailing false

# Reload udev rules
sudo udevadm control --reload-rules
sudo udevadm trigger

# Mount USB without thumbnails
udisksctl mount -b /dev/sdb1 --no-auto-thumbnail

# Get mount point
udisksctl info -b /dev/sdb1 | grep "Mount point" | awk '{print $3}'

8. When to Keep Thumbnails

If you frequently browse large media libraries, thumbnails can be a real productivity boost.
In that case, consider:

  • Selective disabling: only turn off for external drives.
  • Cache cleanup: rm -rf ~/.cache/thumbnails/* every now and then.
  • Smaller thumbnails: adjust size to reduce CPU load.

9. Bottom Line

A frozen Nemo window is just a symptom of a single, well‑known bottleneck.
By disabling or replacing the thumbnailer, using udev to tag removable media, or adding a quick‑mount script, you can keep your Cinnamon desktop snappy and your workflow smooth.
These tweaks are reversible, safe, and even give you a small security win by trimming the attack surface.

Happy computing, and may your USB sticks stay fast and friendly!

See also