How does EOS handle auto mounting temporary flash drives?

In this example I have two usb flash drives inserted. Drives are sda, and sdb.

$ lsblk
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part /run/media/g/d3e966dc-7012-499d-9be0-691b7b072a44
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 931.5G 0 part /run/media/g/148da85e-cadb-4cf3-be57-b4909e923bc3
sr0 11:0 1 1024M 0 rom
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 1000M 0 part /boot/efi
├─nvme0n1p2 259:2 0 944.1G 0 part
│ └─luks-cfd8d4b2-ce6c-4f41-97f8-4c4d5d32e1da 254:1 0 944.1G 0 crypt /
└─nvme0n1p3 259:3 0 8.8G 0 part
└─luks-36cb994f-accb-4571-8b54-a3a47c5cae05 254:0 0 8.8G 0 crypt [SWAP]

The mount point for both is /run/media/g/“UUID”. How is this happening? I try to change mount point for temp drives in etc/fstab, but I need to disable the automount so I can mount three different flash drives manually, and I don t see any mention of auto mounting temp drives in fstab. This video explains what my goal is. In my case I have 3 identical drives that will be mounted and unmounted manually when needed. I was thinking if I identify them by UUID it s my hope that the identified drives be mounted/unmounted manually, and I can still have all other usb drives be auto mounted

1 Like

Auto-mounting drives is a feature typically implemented by your desktop environment. What desktop environment did you install? You can most likely find it easily enough in the GUI settings menu and turn it off from there.

1 Like

I m running gnome

1 Like

Ah, Gnome is a tricky case because I believe they actually do not expose the setting to disable auto-mounting in the GUI anymore.

I actually have this in my notes from the last time I set up a Gnome install (I also find the auto-mount feature to be a nuisance). Paste these two gsettings commands into the terminal to disable auto-mount:

# Disable automount
gsettings set automount false
gsettings set automount-open false 
1 Like
# Disable automount
gsettings set automount false
gsettings set automount-open false 

I m thinking that will disable all auto mounts will it not? This may be wishfull thinking, but my goal was/is to define drives in fstab by their UUID, and make them noauto, and retain auto mount for all other usb drives. I can use the dconf editor to disable automount, but I think that s system wide.

1 Like

Oh gotcha. Yes, that will disable the feature altogether. If you want to preserve auto-mounting, I think the suggestion you just outlined is your best bet:

1 Like

In /etc/fstab you could set them e.g. like this:

UUID="your-long-uuid-1"  /your/mount/point-1  ext4  noatime,nofail,x-systemd.device-timeout=3s,x-systemd.automount,x-systemd.idle-timeout=10min

As seen here, there are many possible options to use. Just play with them to get what you want.
And change the filesystem if it is not ext4. :wink:

Note that if the drives have the partition with a LABEL, you can use them instead of UUIDs.
Syntax is:


Both timeout flage are confusing to me, but I don t understand the use of the, x-systemd.automount (trap), and x-systemd.idle-timeout together. What is it timing out? Wouldn t I need the trap indefinitely? (potentially).

I could be wrong but I think @manuel was showing you a couple of ways in one command.

1 Like

The only mount option you specifically need is the one you already mentioned:

Set the fstab entry for the disk with the desired mount point, filesystem, and whatever mount options you wish to use and add the noauto mount option as well. You don’t need timers or anything for the goal you have described.

I mean…right? They keep removing features, then someone from the community has to write an extension to restore the feature (like the GUI dconf editor pictured above), then the extension usually breaks on the next point release, and the Gnome devs hold up their hands and say "Yeah but we don’t support extensions :man_shrugging: ".

It’s just dizzying! :face_with_spiral_eyes:

Some notes about the timeouts:

As @thefrog said, I just added some options you can consider. Use only the ones you see useful for your purposes, if any.

1 Like

I see. Thx for clarifying.

Success. This does what I wanted.

LABEL=disk_x1 /media/disk_x1 ext4 defaults,noatime,errors=remount-ro,noauto 0 0

It s probably old hat to many here, but I never mess with the terminal when I can point and click. I guess that s part of being an old windows monkey. The only thing I can t understand is I still have to sudo mount, and umount. I prepared drive in gparted, and I was already under sudo, yet it still makes root the owner of the drive. I never remember it doing that in other distro s. Is that an EOS thing?

1 Like

Not sure what you mean by having to sudo always.
What if you remove some option, like noauto? Or replace it with nofail or the options I showed earlier?

I ended up having to change permissions for the drive. Gparted made root owner no matter how I did it. After I changed owner to me the line in fstab worked just fine.

I suspected changing the ownership could help.
Great that you have it working now. :sweat_smile: