# With systemd-automount, Nemo hangs

**URL:** <https://discourse.ubuntubudgie.org/t/with-systemd-automount-nemo-hangs/5061>\
**Category:** General\
**Created:** [June 15, 2021, 7:42am UTC](https://discourse.ubuntubudgie.org/t/with-systemd-automount-nemo-hangs/5061 "2021-06-15T07:42:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zilexa](https://avatars.discourse-cdn.com/v4/letter/z/bbe5ce/32.png) [@zilexa](https://discourse.ubuntubudgie.org/u/zilexa)\
**Post date:** [June 15, 2021, 7:42am UTC](https://discourse.ubuntubudgie.org/t/with-systemd-automount-nemo-hangs/5061/1 "2021-06-15T07:42:32Z")

</div>

My goal: when I connect a certain USB harddisk, mount it and run a bash script.  
To reach this goal, I have this in my fstab for this disk:  
_fstab_:  
`UUID=76c6c02b-231d-4e0b-ac7a-5744175562ae /media/usbarchive btrfs defaults,noatime,noauto,compress-force=zstd:5,x-systemd.automount,x-system.idle-timeout="10min" 0 0 `  
When I do `sudo mount -a`, this disk is not mounted, which is correct since it has `noauto`.

A systemd service file I created:  
_/etc/systemd/system/btrbk-usbarchive.service_

```auto
[Unit]
Description=Run btrbk for usbarchive
Requires=media-usbarchive.mount
After=media-usbarchive.mount

[Service]
ExecStart=/home/asterix/docker/HOST/btrbk/archive-mail.sh
Type=forking

[Install]
WantedBy=media-usbarchive.mount

```

a udev rule I created: _/etc/udev/rules.d/99-btrbk.rules_  
`SUBSYSTEM=="block", ENV{ID_TYPE}=="disk", ENV{ID_FS_UUID}=="76c6c02b-231d-4e0b-ac7a-5744175562ae", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="btrbk-usbarchive.service"`

It works: when I connect the disk via USB, it is mounted to `/media/usbarchive` and the script is launched!

But Nemo File Manager has issues: I can’t launch it, it takes 2 minutes to launch. Syslog shows Nemo is constantly trying to mount `/media/usbarchive` even though the disk is not connected!  
Nemo should not even be triggering the mount in fstab, since I use `noauto`. Note I use `noauto` for 3 other disks: Nemo leaves them alone even though they are unmounted internal SATA disks. Nemo shows these 3 disks under “Devices” but without eject button.

How can I make sure Nemo stays away from this disk, especially when the disk is not connected?

EDIT:  
commenting out the line in fstab + rebooting makes Nemo start normally again. When uncommenting the line + `sudo mount -a`, Nemo still launches normally and I see `usbarchive` under devices without eject button (the disk is not connected). It goes wrong when I reboot. Then I can start Nemo and wait for almost 2 minutes for it to launch and it still behaves slow.

---

<div class="post-metadata">

**Author:** ![fossfreedom](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/fossfreedom/32/1405_2.png) [@fossfreedom](https://discourse.ubuntubudgie.org/u/fossfreedom)\
**Post date:** [June 15, 2021, 8:03am UTC](https://discourse.ubuntubudgie.org/t/with-systemd-automount-nemo-hangs/5061/2 "2021-06-15T08:03:43Z")

</div>

Does disabling media autorun/autostart tick / or ensuring the media automount tickbox isnt ticked in preferences/behaviour help? i.e. press Alt to display the nemo menu.

---

<div class="post-metadata">

**Author:** ![zilexa](https://avatars.discourse-cdn.com/v4/letter/z/bbe5ce/32.png) [@zilexa](https://discourse.ubuntubudgie.org/u/zilexa)\
**Post date:** [June 15, 2021, 10:13am UTC](https://discourse.ubuntubudgie.org/t/with-systemd-automount-nemo-hangs/5061/3 "2021-06-15T10:13:03Z")

</div>

Forgot to mention I did that already for Nemo and also for Nemo with elevated rights. Makes no difference:  
Alt \> Edit \> Preferences \> Behavior \> Media Handling \> unticked _“Automatically mount removable media when inserted and on startup”_ and also _“Automatically open a folder for automounted media”_

Now I also did:  
`gsettings set org.gnome.desktop.media-handling automount false`, going to reboot to test.

edit: also makes no difference

---

<div class="post-metadata">

**Author:** ![zilexa](https://avatars.discourse-cdn.com/v4/letter/z/bbe5ce/32.png) [@zilexa](https://discourse.ubuntubudgie.org/u/zilexa)\
**Post date:** [June 15, 2021, 10:57am UTC](https://discourse.ubuntubudgie.org/t/with-systemd-automount-nemo-hangs/5061/4 "2021-06-15T10:57:55Z")

</div>

Solved:

changed the mountpoint to something else instead of `/media`, apparently, Nemo will try to mount everything in /media regardless the Nemo preferences.

Changed it to /mnt and now Nemo works as expected.

---

<div class="post-metadata">

**Author:** ![fossfreedom](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.ubuntubudgie.org/fossfreedom/32/1405_2.png) [@fossfreedom](https://discourse.ubuntubudgie.org/u/fossfreedom)\
**Post date:** [June 15, 2021, 11:01am UTC](https://discourse.ubuntubudgie.org/t/with-systemd-automount-nemo-hangs/5061/5 "2021-06-15T11:01:53Z")

</div>

That’s a very unusual observation. Think its worth raising on the upstream tracker - even if its just to raise the awareness.

> **[linuxmint/nemo](https://github.com/linuxmint/nemo)**
>
> File browser for Cinnamon. Contribute to linuxmint/nemo development by creating an account on GitHub.
