Automatic mounting of USB HDD FLASH Pen
-
- Posts: 14
- Joined: 2024-10-25 13:17
Automatic mounting of USB HDD FLASH Pen
Does anyone in simplest possible terms know how to automatically mount USB HDD's, FLASH Pen's etc?
I'm on Debian server and would like the mounting to be autonomous. Thank you.
I'm on Debian server and would like the mounting to be autonomous. Thank you.
Re: Automatic mounting of USB HDD FLASH Pen
For me works out of the box, Debian 12.7 Xfce, when I insert for examply an usb stick, it gets mounted to /media/$USER/nnn, and I can see it in thunar (Xfce's file manager) also in the terminal.
- pbear
- Posts: 505
- Joined: 2023-08-27 15:05
- Location: San Francisco
- Has thanked: 2 times
- Been thanked: 81 times
Re: Automatic mounting of USB HDD FLASH Pen
Does "Debian server" mean no desktop is installed? If so, the simplest answer would be to install one. XFCE is a good choice. Relatively low overhead and, as arzgi says, will mount removable devices hot-plugged at boot. If you don't want a desktop (or have no way to interface with one), you're looking at reproducing what XFCE does with a script. udisks is the tool actually doing the mount, by the way.
From how you wrote the question, I infer you want the system to mount any-and-all devices which might be attached. If you have specific devices in mind, you also can mount with fstab. Be sure to include a nofail parameter.
From how you wrote the question, I infer you want the system to mount any-and-all devices which might be attached. If you have specific devices in mind, you also can mount with fstab. Be sure to include a nofail parameter.
- dilberts_left_nut
- Administrator
- Posts: 5441
- Joined: 2009-10-05 07:54
- Location: enzed
- Has thanked: 20 times
- Been thanked: 87 times
Re: Automatic mounting of USB HDD FLASH Pen
I do it with my backup drives on a headless machine with udev rules triggering a mounting script.
AdrianTM wrote:There's no hacker in my grandma...
-
- Posts: 14
- Joined: 2024-10-25 13:17
- pbear
- Posts: 505
- Joined: 2023-08-27 15:05
- Location: San Francisco
- Has thanked: 2 times
- Been thanked: 81 times
Re: Automatic mounting of USB HDD FLASH Pen
In between. Scripting is neither simple nor brain surgery. It's learnable. You weren't born knowing how to drive a car either. A quick internet search turns up a bunch of hits.
Re: Automatic mounting of USB HDD FLASH Pen
It is not, I have done a lot this before. This is a good guide I have used http://reactivated.net/writing_udev_rules.html
Re: Automatic mounting of USB HDD FLASH Pen
I ran across this today, hope it helps...
Code: Select all
$ man systemd-mount | grep -A3 EXAMPLE
EXAMPLE
Use a udev rule like the following to automatically mount all USB
storage plugged in:
resigned by AI ChatGPT
- pbear
- Posts: 505
- Joined: 2023-08-27 15:05
- Location: San Francisco
- Has thanked: 2 times
- Been thanked: 81 times
Re: Automatic mounting of USB HDD FLASH Pen
Interesting, I've not heard of that before. OTOH, (a) I have a desktop and (b) one of the first things I do after installation is disable automount of USB drives.
Anyhoo, the output got truncated somehow. Here's the whole thing:
Next question is, where does the OP put that udev rule? Frankly, I don't know.
Anyhoo, the output got truncated somehow. Here's the whole thing:
Code: Select all
~$ man systemd-mount | grep -A3 EXAMPLE
EXAMPLE
Use a udev rule like the following to automatically mount all USB storage plugged in:
ACTION=="add", SUBSYSTEMS=="usb", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem", \
-
- Global Moderator
- Posts: 3059
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 63 times
- Been thanked: 253 times
Re: Automatic mounting of USB HDD FLASH Pen
/etc/udev/rules.d/99-automounts.rules, or similar.
Mottainai
- sunrat
- Site admin
- Posts: 7336
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 130 times
- Been thanked: 642 times
Re: Automatic mounting of USB HDD FLASH Pen
There's another line:
Code: Select all
$ man systemd-mount | grep -A4 EXAMPLE
EXAMPLE
Use a udev rule like the following to automatically mount all USB storage plugged in:
ACTION=="add", SUBSYSTEMS=="usb", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem", \
RUN{program}+="/usr/bin/systemd-mount --no-block --automount=yes --collect $devnode"
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
- dilberts_left_nut
- Administrator
- Posts: 5441
- Joined: 2009-10-05 07:54
- Location: enzed
- Has thanked: 20 times
- Been thanked: 87 times
Re: Automatic mounting of USB HDD FLASH Pen
Won't work for me ... my backup server is still running squeeze!
AdrianTM wrote:There's no hacker in my grandma...