Page 1 of 1
How to change pluggable device's mount point name
Posted: Wed Sep 27, 2023 2:40 am
by Dictador
By default every usb drive I plug into a usb port is mounted at (toshiba external 2.5inch drive in this case):
'/media/username/TOSHIBA EXT'
The space in the path is causing a problem for me. How do I change the mount point, path name, etc?
/etc/fstab says it handled by udev, but I do not know what to do.
/etc/fstab
Code: Select all
# Pluggable devices are handled by uDev, they are not in fstab
UUID=7d09aa43-985d-42f7-8ad5-67c491c6d7a1 / ext4 discard,noatime 1 1
UUID=3826-7875 /boot/efi vfat noatime,dmask=0002,fmask=0113 0 0
UUID=270610a4-4ac4-4ad7-aa32-e83aca85d64c swap swap discard
Edit1: Disk manager allows me to change the name of the mount point but it is temporary only. I want the change to be permanent (e.g. '/media/username/TOSHIBA_EXT').
Options in disk manager:
Code: Select all
defaults,nodev,nosuid,uid=1000,gid=1000,windows_names,uhelper=udisks2
Edit2: I figured it out that "TOSHIBA EXT" is actually the disk label (ntfs) of the external drive. So renaming the disk should actually fix the problem with space in the path.
But how to avoid this problem on a system level without having to worry about the disk label I plug into usb port? I still would like to get the answer to the original question: How do I change the mount point, path name, etc? And how to avoid spaces in the mount path?
Edit3: A related question. I have partitioned my internal drive to three ext4 partitions. MX23 installed on one of them. MX23 automatically mounts one of the free ext4 partitions as '/media/username/Data2'. Where is that defined and how to customize it?
There is the third ext4 partition (nvme0n1p4) which does not get mounted automatically. Again, why and how to customize it?
Code: Select all
nvme0n1 238.5G
├─nvme0n1p1 /boot/efi EFI-SYSTEM 128M 3826-7875
├─nvme0n1p2 / rootMX23 127G 7d09aa43-985d-42f7-8ad5-67c491c6d7a1
├─nvme0n1p3 [SWAP] swapMX 15.6G 270610a4-4ac4-4ad7-aa32-e83aca85d64c
├─nvme0n1p4 Data1 63.5G 53d5a250-a33b-42ea-aa7a-e8476778eada
└─nvme0n1p5 /media/username/Data2 Data2 32.3G a57a5e7e-1aa0-4e9e-bfe9-aab02ea25a63
Linux MX23
Re: How to change pluggable device's mount point name
Posted: Wed Sep 27, 2023 4:34 am
by BitterTruth
Dolphin_Oracle explained it to someone on reddit a few weeks ago. You can try it:
https://www.reddit.com/r/MXLinux/commen ... e_at_boot/
I think you will need to create a folder and then use /etc/fstab to mount it to THAT FOLDER. He recommends the folder not be under your user.
Re: How to change pluggable device's mount point name
Posted: Wed Sep 27, 2023 12:00 pm
by CharlesV
Please post your QSI. ( MX Menu, Quick System Info, Copy for Forum, Paste here )
And yes, I believe the proper method is to create your mount point (I use what ever name in /mnt so .. /mnt/NAS or /mnt/ThumbDrive etc)
But not sure that you want to use fstab for this, I think it would be better to just setup a script to mount it and then run that script at login. I have had some seriously long pauses and a few issues with network and removable media mounting at the fstab level. ( Example: an 8tb removable drive - slowing machine reboots, and some times causing a 3 minute hang on startup. )
And bottom line for me - spaces are bad in ANY media name ;=/
Re: How to change pluggable device's mount point name
Posted: Wed Sep 27, 2023 1:43 pm
by BitterTruth
Good catch @CharlesV. It could also become a problem say, for example, if you forget to plug it in, fstab will keep looking for it.
Re: How to change pluggable device's mount point name
Posted: Wed Sep 27, 2023 2:56 pm
by CharlesV
Re: How to change pluggable device's mount point name
Posted: Wed Sep 27, 2023 3:18 pm
by MXRobo
Possibly implied by others, some over my head, but /media displays in file manger, /mnt does not.
++EDIT++ Also, possibly show output of cat /etc/fstab Sorry
https://www.pathname.com/fhs/pub/fhs-2. ... MOUNTPOINT
Don't know udev.
Good Luck
Re: How to change pluggable device's mount point name
Posted: Wed Sep 27, 2023 3:27 pm
by CharlesV
Excellent point! mounting to /media/NAS does show the mount point in devices.
The only drawback I see to that is that the user may be misled about 'eject'. To my knowledge, Eject will not work on a mount. I will to test this to see if there are other drawbacks.
Re: How to change pluggable device's mount point name
Posted: Thu Sep 28, 2023 3:42 am
by Dictador
What program mounts usb drives and where is the config file that controls its behavior?
The same about mounting internal drive partitions, where is a config file that controls this behavior?
nvme0n1p5 is mounted at /media/username/Data2 automatically by the system, but the entry is not in /etc/fstab. Where is a config file that controls this behavior?
Code: Select all
System:
Kernel: 6.1.0-12-amd64 [6.1.52-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0 clocksource: tsc
available: acpi_pm parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-12-amd64 root=UUID=<filter> ro
acpi_osi=linux quiet splash
Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel wm: xfwm v: 4.18.0 vt: 7
dm: LightDM v: 1.26.0 Distro: MX-23_x64 Libretto July 31 2023 base: Debian GNU/Linux 12
(bookworm)
Machine:
Type: Laptop System: Dell product: Latitude 5500 v: N/A serial: <superuser required> Chassis:
type: 10 serial: <superuser required>
Mobo: Dell model: 0M14W7 v: A01 serial: <superuser required> UEFI: Dell v: 1.23.0
date: 12/19/2022
Battery:
ID-1: BAT0 charge: 50.3 Wh (100.0%) condition: 50.3/68.0 Wh (73.9%) volts: 8.3 min: 7.6
model: LGC-LGC8.948 DELL X77XY06 type: Li-ion serial: <filter> status: full
CPU:
Info: model: Intel Core i5-8365U bits: 64 type: MT MCP arch: Comet/Whiskey Lake note: check
gen: core 8 level: v3 note: check built: 2018 process: Intel 14nm family: 6 model-id: 0x8E (142)
stepping: 0xC (12) microcode: 0xF8
Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache: L1: 256 KiB
desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB L3: 6 MiB desc: 1x6 MiB
Speed (MHz): avg: 850 high: 1900 min/max: 400/4100 scaling: driver: intel_pstate
governor: powersave cores: 1: 700 2: 700 3: 700 4: 700 5: 700 6: 1900 7: 700 8: 700
bogomips: 30399
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities:
Type: gather_data_sampling mitigation: Microcode
Type: itlb_multihit status: KVM: VMX disabled
Type: l1tf status: Not affected
Type: mds status: Not affected
Type: meltdown status: Not affected
Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
Type: retbleed mitigation: Enhanced IBRS
Type: spec_rstack_overflow status: Not affected
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB filling, PBRSB-eIBRS: SW
sequence
Type: srbds mitigation: Microcode
Type: tsx_async_abort mitigation: TSX disabled
Graphics:
Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] vendor: Dell driver: i915 v: kernel
arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: eDP-1
empty: DP-1,HDMI-A-1,HDMI-A-2 bus-ID: 00:02.0 chip-ID: 8086:3ea0 class-ID: 0300
Device-2: Realtek Integrated_Webcam_HD driver: uvcvideo type: USB rev: 2.0 speed: 480 Mb/s
lanes: 1 mode: 2.0 bus-ID: 1-6:3 chip-ID: 0bda:5676 class-ID: 0e02 serial: <filter>
Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.18.0 driver: X:
loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915 display-ID: :0.0 screens: 1
Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.21x7.99") s-diag: 414mm (16.31")
Monitor-1: eDP-1 model: ChiMei InnoLux 0x1500 built: 2018 res: 1366x768 hz: 60 dpi: 101
gamma: 1.2 size: 344x193mm (13.54x7.6") diag: 394mm (15.5") ratio: 16:9 modes: 1366x768
API: OpenGL v: 4.6 Mesa 22.3.6 renderer: Mesa Intel UHD Graphics 620 (WHL GT2)
direct-render: Yes
Audio:
Device-1: Intel Cannon Point-LP High Definition Audio vendor: Dell driver: snd_hda_intel
v: kernel alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3 chip-ID: 8086:9dc8
class-ID: 0403
API: ALSA v: k6.1.0-12-amd64 status: kernel-api with: aoss type: oss-emulator
tools: alsactl,alsamixer,alsamixergui,amixer
Server-1: PulseAudio v: 16.1 status: active tools: pacat,pactl,pavucontrol
Network:
Device-1: Intel Ethernet I219-LM vendor: Dell driver: e1000e v: kernel port: N/A bus-ID: 00:1f.6
chip-ID: 8086:15bd class-ID: 0200
IF: eth0 state: down mac: <filter>
Device-2: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter vendor: Dell
driver: ath10k_pci v: kernel modules: wl pcie: gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 02:00.0
chip-ID: 168c:003e class-ID: 0280 temp: 51.0 C
IF: wlan0 state: up mac: <filter>
Bluetooth:
Device-1: Qualcomm Atheros driver: btusb v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1
mode: 1.1 bus-ID: 1-10:4 chip-ID: 0cf3:e007 class-ID: e001
Report: hciconfig ID: hci0 rfk-id: 3 state: down bt-service: N/A rfk-block: hardware: no
software: yes address: <filter>
Info: acl-mtu: 1024:8 sco-mtu: 50:8 link-policy: rswitch hold sniff
link-mode: peripheral accept
Drives:
Local Storage: total: 2.05 TiB used: 254.6 GiB (12.1%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: PM991 NVMe 256GB size: 238.47 GiB
block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
fw-rev: 25311039 temp: 42.9 C scheme: GPT
ID-2: /dev/sda maj-min: 8:0 vendor: Toshiba model: MQ04UBD200 size: 1.82 TiB block-size:
physical: 512 B logical: 512 B type: USB rev: 3.0 spd: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1
tech: HDD rpm: 5400 serial: <filter> scheme: MBR
Partition:
ID-1: / raw-size: 126.95 GiB size: 124.4 GiB (97.99%) used: 98.93 GiB (79.5%) fs: ext4
dev: /dev/nvme0n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 128 MiB size: 126 MiB (98.45%) used: 274 KiB (0.2%) fs: vfat
dev: /dev/nvme0n1p1 maj-min: 259:1
Swap:
Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) zswap: no
ID-1: swap-1 type: partition size: 15.62 GiB used: 304 MiB (1.9%) priority: -2
dev: /dev/nvme0n1p3 maj-min: 259:3
Sensors:
System Temperatures: cpu: 47.0 C pch: 42.0 C mobo: 38.0 C
Fan Speeds (rpm): cpu: 0
Repos:
Packages: pm: dpkg pkgs: 2619 libs: 1240 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
pkgs: 0 pm: flatpak pkgs: 0
No active apt repos in: /etc/apt/sources.list
Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
1: deb http://deb.debian.org/debian/ bookworm-updates non-free-firmware non-free contrib main
Active apt repos in: /etc/apt/sources.list.d/debian.list
1: deb http://deb.debian.org/debian/ bookworm non-free-firmware non-free contrib main
2: deb http://security.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
Info:
Processes: 297 Uptime: 3d 23h 52m wakeups: 25339 Memory: total: 16 GiB available: 15.44 GiB
used: 4.66 GiB (30.2%) Init: SysVinit v: 3.06 runlevel: 5 default: graphical tool: systemctl
Compilers: gcc: 12.2.0 alt: 12 Client: shell wrapper v: 5.2.15-release inxi: 3.3.29
Boot Mode: UEFI
Re: How to change pluggable device's mount point name
Posted: Thu Sep 28, 2023 4:26 am
by BitterTruth
You can control automounting removable drives/devices through thunar.
Thunar-->Edit--->Preferences--->Advanced -------> Make sure Enable Volume Management is ticked then click on the 'configure' link under it. In the dialog box that comes up you will be able to untick automount etc.
Enable_Volume_Management.png
Removable_Drives_Media.png
Re: How to change pluggable device's mount point name
Posted: Thu Sep 28, 2023 5:47 am
by Dictador
Thank you, that helps a bit.
Still, where is a config file that controls that behavior? Where do I define the mount point for automatically mounted devices?
/etc/fstab says that portable devices are handled by udev rules. There is a file /etc/udev/rules.d/90-usb-semiauto.rules but it is empty.
Re: How to change pluggable device's mount point name
Posted: Thu Sep 28, 2023 8:33 am
by fehlix
Dictador wrote: Thu Sep 28, 2023 5:47 am
Still, where is a config file that controls that behavior?
Where do I define the mount point for automatically mounted devices?
Automounting as done by Thunar, is handled by udisks, which get triggered by udev-events.
Path is by default either /media/[username]/[mountpoint]
mointpoint name is hardcoded within udisks to be in that order this:
* label of the file system if not empty
** if mountpoint already exists a number is added like label1
* UUID of the file system if not empty
* "disk" otherwise
Other system may have udisks default to /run/media/[username] instead of /media/[username]
To adjust mounting from /media/[username]/[mountpoint] to /media/[mountpoint]
can be adjusted with udev rules like this one:
Code: Select all
# udisks2 rule to mount filesystems under /media
#
# /etc/udev/rules.d/99-udisks2-mount-at-media.rules
#
SUBSYSTEM!="block", GOTO="udisks_mount_media_end"
ENV{ID_FS_USAGE}=="filesystem", ENV{UDISKS_FILESYSTEM_SHARED}="1"
LABEL="udisks_mount_media_end"
Re: How to change pluggable device's mount point name
Posted: Thu Sep 28, 2023 9:52 am
by BitterTruth
@fehlix Doesn't doing it this way mean you are opening yourself up to potential security issues? Udisks2 mounts the drives to /media/$USER/mydrive for a reason because that way the drive can be accessed by $USER only. If you mount them somewhere else then won't they in fact be shares and accessible by other users?
Also will the drives be auto-unmounted as normal on shutdown? is there a possibility this could lead to file system errors when the system is shutdown of the drivers do not get auto unmounted?
EDIT: Don't know anything about udisks. Just curious if there are any negatives to doing this.
Re: How to change pluggable device's mount point name
Posted: Sat Sep 30, 2023 4:41 pm
by BitterTruth
I think Disk Manager is the answer. I found a video which you might be able to use to configure permanent automounting. I know you tried before but I think the options you chose were not correct. Have a look here staring 33 mins 33 secs:
https://www.youtube.com/watch?v=6gW_MVl9A_8
The guy is doing it on antix but it's should work on MX.