SD card automatically mounted

I’ve reformatted the SD card to ext4 and after a reboot it is automatically mounted as /media/e8ce39c2-3d66-48cf-bd84-894b29bdef55.

Hmm, there’s no /etc/auto.master and I haven’t named the sd card either. Also, I don’t want it to be mounted automatically.
Also, there’s no entry for it in /etc/fstab.

So why is the card mounted automatically and why does it have that name?

The name is the UUID of the partition. I think if you gave the partition a label then it would mount using the label name instead.

The magic is done in /etc/udisks-glue.conf

Do you not want the card mounted at all, or in a different place?

I don’t know how to do that. It’s ext4. Since when can I name an ext4 partition?

Ah, I see.

Yes, I want it mounted, but with an entry in my /etc/fstab. Definitely not under /media nor with the UUID as part of the mount point.

So basically I need to deactivate automount for that specific card and/or that UUID.

I don’t do it from command line, but with gparted you can label a partition. I don’t remember off the top of my head how to, but you can change the label on an EXT4 partition. That’s not really important since you can just mount the card using fstab.

Something like:

UUID=e8ce39c2-3d66-48cf-bd84-894b29bdef55 /mnt/MyMovies ext4 x-systemd.automount 0 0

should do the trick.

1 Like

Thanks a bunch.

NP. Let us know if that works out for you.

I’m sure it will. I was just a bit puzzled by no auto.master file. The /etc/udisks-glue.conf pretty much explains it all. I originally thought I’d have to deactivate auto mount, but with your command I can just override it.

BTW, just checked and this is how to add a label to the partition:

mke2fs -L DATA /dev/???

I haven’t tested this myself, and if using fstab and the UUID works for you then I’d suggest you leave things as they are.

If you do give the partition a label, instead of UUID= in fstab you can use LABEL=

If you prefer to use autofs over fstab you can still use the same idea.

I’m fine with the UUID, so I won’t label the card. I’m also ok with adding it to fstab. My point was that I didn’t know to look at udisk-glue.conf instead. I’ve never used any auto mount systems, so my knowledge in that area is limited.

mke2fs actually creates a filesystem, so it overwrites anything that is there. In this case, it’s fine to use it to “add” a label, but the correct way is to use:

tune2fs -L your_label /dev/???

This does nothing but add/change the label, leaving the existing data intact.

Thanks for pointing that out for me.