Tutorial External drives formatted as ext(x) don't automatically mount when plugged in, how to fix it

ron.alan

Well-Known Member
Joined
Dec 24, 2023
Messages
568
Reaction score
479
Credits
3,985
So starting with Debian Trixie, any USB drive that is formatted as ext(x) will not automatically mount when plugged in. This problem is also in Devuan 6 which is based on Trixie, and I'd presume it exists on any other OS based on Trixie. The fix to once again get an ext-formatted external drive to automatically mount when plugged in is this:

Create a text file named 65-ext4.rules and place it in /etc/udev/rules.d/. Place the following in that file:

Code:
# extX-Dateisysteme automatisch mounten
SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="ext2|ext3|ext4|ext4dev|jbd", ENV{UDISKS_AUTO}="1"

I rebooted after doing this, so I can't say for sure if that was a necessary step or not. If you don't reboot and it doesn't work, reboot.

[Mods, should this have been put in tutorials? I put it here because I think it's peculiar to Debian, although I could be wrong about this.]
 
Last edited:


[Mods, should this have been put in tutorials? I put it here because I think it's peculiar to Debian, although I could be wrong about this.]
You can just use the prefix "Tutorial" for this post, it should be selectable if you edit the post, no problem to keep it here. By searching on the prefix "Tutorial" people will be able to find it.
 
Correct me if I'm wrong, but I always understood that where Whinedoze auto-mounts everything it can find, Linux does the exact opposite. Nothing gets mounted - with the sole exception of the boot drive itself - unless you specifically tell your system to do so...

Is this not part of the UNIX / Linux "core" security model?


Mike. :confused:
 
Correct me if I'm wrong, but I always understood that where Whinedoze auto-mounts everything it can find, Linux does the exact opposite. Nothing gets mounted -
I have gvfs and it auto-mounts my formatted usb-drives automatically as my user. So it depends on how you configure it or how it's configured out of the box. I'll have to test it out what happens on my laptop with Debian 13 with Gnome where I haven't configured it specifically.
 
I don't remember ever having an OS that didn't automatically mount externals. I started with Linux Mint 17, then 18, then Devuan 2, 3, 5 and 6. Only Devuan 6, based on Debian Trixie, didn't automount externals formatted as ext(x). Maybe part of the reason is that for Devuan 2, 3, and 5 I used a derivative of Devuan, with version 6 I am running straight Devuan.

For more context, the offending file is /usr/lib/udev/rules.d/64-ext4.rules.
 
Last edited:
Don't let udisks automount ext4 filesystems without even asking a user.<br># This doesn't eliminate filesystems as an attack surface; it only prevents<br># evil maid attacks when all sessions are locked.<br>#

 
I wish I had a maid.

the wiki articel does, however, make sense in certain scenarios. Usually 'business' related....not so much for the day to day user.

""The name refers to the scenario where a maid could subvert a device left unattended in a hotel room – but the concept itself also applies to situations such as a device being intercepted while in transit, or taken away temporarily by airport or law enforcement personnel.""

I guess this is Debian living up to its reputation for Security.

For a household user it is a bummer when he/she gets home with their new pc, plugs in an external and nothing happens !
 
Ron, may I check with you that your are using Devuan 6 'Excalibur' Desktop, with the default DE of Xfce? Or are you using the Net Install version, with its choice of 5-6 desktop environments, and if so, which one? Thanks.

I have an 'Excalibur' already in my stable of Linux, but it is Expirion, by our own Member @GatorsFan , , which may fall under the category of "derivative" as you mentioned above.

I have downloaded and can install Devuan on my tomorrow and run a couple of tests, but if you are using Xfce, then I would ask have you taken a look at Settings - Hardware - Removable Drives and Media, and what are your settings there?

I also have a couple of tips for you -
  1. Dateisysteme automatisch mounten
    ...better for the English speaking folk to use "File System Automatic Mount", and
  2. Devuan 5 'Daedalus' is based on Debian 12 'Bookworm', not Debian 13 'Trixie'.

HTH

Chris
 
I don't remember ever having an OS that didn't automatically mount externals.
Same.

Correct me if I'm wrong,
I'll have to test it out what happens on my laptop with Debian 13 with Gnome where I haven't configured it specifically.
I just tested it out and my usb drive is automatically mounted in user space so my user can access it. If I remember correctly KDE Plasma use KIO for that, so it will probably depend on your DE if works out of the box.
 
Ron, may I check with you that your are using Devuan 6 'Excalibur' Desktop, with the default DE of Xfce?

No, I'm using Mate. I downloaded the iso from the person who also makes the derivative Vuu-do > here <, under the Devuan folder. It's not Vuu-do nor an official Devuan, just a user respin of Devuan with Mate (to use his own words). So I guess what I wrote above, "I am running straight Devuan" is not 100% correct.

...better for the English speaking folk to use

Yeah, I got this second-hand from the German Debian forums. But what counts is what's below it, unless my computer also understands German. :)

Devuan 5 'Daedalus' is based on Debian 12 'Bookworm', not Debian 13 'Trixie'.

Thanks, I fixed it.
 
Last edited:
I wish I had a maid.

First, it's good to see more recognition for the evil maid attacks. They don't all require maids, but it's a principle of attack surfaces.

As for a maid, I have a cleaning lady who comes in twice a week. I find myself going through the house to make sure the place is relatively clean before they get here. It ends up with me not being so sure that I really need to pay someone for this service.

Also, for a (seemingly) fairly long spell, I had a registered nurse in the house 24x7. I was still on IV opiates and wanted to be at home, as opposed to some assisted living situation. This meant there was an additional person in my house all the time. While I appreciated their services (I was limited in capacity to the point where taking care of myself was an ordeal) but it was really awkward to have someone in the house all of the time.

Anyhow, to get back on target...

If you ever leave your PC unattended while there are other people around, you're opening yourself up to the Evil Maid attacks. There are a number of steps you can use to take care of this.

However... Generally speaking, if I have physical access to your computer, I own your computer. If you're not using disk encryption (something not everbody needs), I just need to boot to a live instance of Linux.

If you haven't locked your BIOS, I can tell it to boot to USB. If I can tell it to boot to USB, there's that live USB instance that I just mentioned. Once I'm there, I can do anything I want. I can change your user password. I can use chroot. It's usually going to mount all of your storage devices, and nothing will stop me from accessing that data.

If I don't have much time, there are tools that let me clone your drive to an external drive. We use those tools to back up our data, but those tools can also be used nefariously.

The evil maid attack is one of the greatest attack surfaces there are. They have physical access to your computer. Again, if I have physical access to your computer (and enough time), I own your computer. You can prevent this, but you first have to be aware of this. You also need to decide how much you value your data, and which data you value the most.
 
Feren is an Ubuntu based Distro that doesn't auto-mount a Flash Drive or external Drive.

You have to click the arrow bottom right...then click USB icon then select mount and open.

1762416158791.gif
 
Just a heads up, I have installed Devuan 6 'Excalibur' MATE, and I have used the method listed by the OP in #1 and it works, but I have some more input to provide on my tomorrow which some may find useful.

Read - there is more than one way to skin a cat.

BTW @bob466 Bob Feren only comes in KDE Plasma and Cinnamon, am I right in guessing you are talking about the Cinnamon version?

Nite

Wizard
 
Read - there is more than one way to skin a cat
There are also other ways to kill a cat, other than choking it with butter...... (just sayin')
 
....but I have some more input to provide on my tomorrow which some may find useful.

I have chosen not to use the Debian-sourced /etc/udev/rules.d/65-ext4.rules , which while it works, does not suit my working environment.

Why?

As a part of housing my extensive stable of Linux distros, I have an external, mains-powered, USB3.0 connected, Western Digital drive holding maybe 30+ Linux.

If I use the method suggested, then I get 30+ distros mounting, as well as a USB stick, all appearing as icons on my desktop. Bedlam.

In Devuan 6 'Excalibur' MATE, we have Control Centre, where we can effect some changes to how media are treated, opened and so on.

What I can do as an alternative is to use Control Centre - Personal - File Management, like so

1764749755521.png


and I have checked the box for not prompting or starting programs on media insertion. And I don't check the one for browsing media when inserted.

This then mitigates the Evil Maid effect, as well as keeping my desktop clearer.

Later

Wizard
 


Follow Linux.org

Staff online

Members online


Top