How is this drive being mounted?

Ubuntu Version

Ubuntu 26.04 LTS

Desktop Environment (if applicable)

GNOME

Problem Description

Have an external 4TB HDD, and using it for media/backups etc.
Drive is partitioned into 2, with one being NTFS, other EXT4.
On boot, the EXT4 partition is mounted through fstab, at /home/media, but…
have just checked the drive, and the NTFS part (which I believed wasn’t being mounted, is also being mounted at /run/media/john/Seagate4T??
Don’t believe I have ever created a script/whatever that does this?
Yes, they have “similar” data on them, but thinking back, I believe I initially was using the NTFS partition, but then created/moved to the ext4 partition, and… The data on the NTFS partition is ‘almost’ up to date…

mount gives:
john@media:~/docker/immich-app$ mount | grep dev/sd
/dev/sda3 on /home/media type ext4 (rw,relatime)
/dev/sda2 on /run/media/john/Seagate4T type ntfs3 (rw,nosuid,nodev,relatime,uid=1000,gid=1000,acl,iocharset=utf8,prealloc,uhelper=udisks2)
Where would this be coming from? Using DejaDup, but it is backing up to /home/backup…
Thanks.
(probably is something I have done, but what? If I had mounted it manually, it wouldn’t remount, on reboot?)

Relevant System Information

Lenovo M920S / 16GB RAM / Gnome - Recently updated (actually blew away and recreated) to 26.04.
All is up-to-date
Headless server, running docker

The clue is “uhelper=udisks2” in your mount output :wink:
GNOME automounts any external partition not listed in /etc/fstab.
To stop it, add it to /etc/fstab with “noauto”, or toggle off automount in GNOME Disks.

2 Likes

It is done by your Desktop Environment. By default most DEs will mount (filesystems on) removable drives when they are plugged in unless it is explicitly turned off. The definition of “removable” is a bit blurry, but USB connected drives are normally considered removable.

You can disable automount with

gsettings set org.gnome.desktop.media-handling automount false

Technically mounting is handled by the UDisks2 system service which monitors for and announces new devices and performs privileged operations on behalf of non-privileged users. See man udisks.

2 Likes

I recommend you have a mount specification in /etc/mount for any USB-attached drive and, more importantly, I recommend you choose a mount root different from “expected” system defaults. That way, built-in system logic will never have the opportunity to interfere with your mount process preferences.

For me, my non-system drives (internal or USB-attached) are all mounted under /site.

(Script available here)

Devices__ReportDiskParts.sh

	 NOTE:  Expected mount point parent for all partitions not on root device => '/site' ...

	 ALL recognized DISK partitions:

/dev/sdb3    ext4     DB001_F1   5dcf1a96-fa2e-42f5-9a08-37fcce0f0878   Mounted       /                              block:scsi:pci
/dev/sdb7    ext4     DB001_F2   7e9a663e-ff1d-4730-8544-c37519056b6f   Mounted       /DB001_F2                      block:scsi:pci
/dev/sdb8    ext4     DB001_F3   4f7d4192-b136-4a94-b06b-736f76155816   Mounted       /DB001_F3                      block:scsi:pci
/dev/sdb9    ext4     DB001_F4   7f37ffd4-779a-46c6-b440-f384fb75eb98   Mounted       /DB001_F4                      block:scsi:pci
/dev/sdb12   ext4     DB001_F5   14e15125-6c47-499e-b1a9-734a0f928b5e   Mounted       /DB001_F5                      block:scsi:pci
/dev/sdb13   ext4     DB001_F6   0d416936-e091-49a7-9133-b8137d327ce0   Mounted       /DB001_F6                      block:scsi:pci
/dev/sdb14   ext4     DB001_F7   c2ff9e15-b50e-4c56-9c03-918bf81e0ab5   Mounted       /DB001_F7                      block:scsi:pci
/dev/sdb4    ext4     DB001_F8   46fcb33d-5f0d-423b-b6a7-512c58c76aba   Mounted       /DB001_F8                      block:scsi:pci
/dev/sdb2    swap     DB001_S1   266efd3e-f04d-4ea3-89e6-45e6ac227fa1   Not_Enabled   [SWAP_OFFLINE]                 block:scsi:pci
/dev/sdb10   swap     DB001_S2   3b9a2c7a-67d4-4de7-ae66-214937dc47f4   Not_Enabled   [SWAP_OFFLINE]                 block:scsi:pci
/dev/sdb11   swap     DB001_S3   78b04c8c-8ace-4b46-817d-7059aa1668b7   Not_Enabled   [SWAP_OFFLINE]                 block:scsi:pci
/dev/sdc3    ext4     DB005_F1   11c8fbcc-c1e1-424d-9ffe-ad0ccf480128   Mounted       /site/DB005_F1                 block:scsi:usb:pci
/dev/sdc4    ext4     DB005_F2   a48c6161-986f-4fd9-b127-7d070d86d68f   Mounted       /site/DB005_F2                 block:scsi:usb:pci
/dev/sdc5    ext4     DB005_F3   965ad4c7-2f2c-4d8d-8790-0ffb8e18dd1b   Mounted       /site/DB005_F3                 block:scsi:usb:pci
/dev/sdc6    ext4     DB005_F4   62026971-3ab4-48c9-bc5b-2b40aa3cc70a   Mounted       /site/DB005_F4                 block:scsi:usb:pci
/dev/sdc7    ext4     DB005_F5   c76adc01-99d2-42f9-acba-d0678ee87e8f   Mounted       /site/DB005_F5                 block:scsi:usb:pci
/dev/sdc8    ext4     DB005_F6   4feee7f0-b285-40dc-88de-aafc61433b21   Mounted       /site/DB005_F6                 block:scsi:usb:pci
/dev/sdc9    ext4     DB005_F7   0267ec5e-e71b-4eac-b1fa-ec1d92b10400   Mounted       /site/DB005_F7                 block:scsi:usb:pci
/dev/sdc10   ext4     DB005_F8   5b1980b2-df9a-47c6-bedb-df140fbbe8f0   Mounted       /site/DB005_F8                 block:scsi:usb:pci
/dev/sdc2    swap     DB005_S1   a668c722-b4db-4d4a-a91b-a01b4faa0fc6   Not_Enabled   [SWAP_OFFLINE]                 block:scsi:usb:pci
/dev/sdc11   ext4     DB006_F1   d827a05e-e151-4ce9-8be4-6f8515a71eab   Mounted       /site/DB006_F1                 block:scsi:usb:pci
/dev/sdc12   ext4     DB006_F2   ef36596a-8566-4a03-8015-2d4f6f8ec7a0   Mounted       /site/DB006_F2                 block:scsi:usb:pci
/dev/sdc13   ext4     DB006_F3   7e9d1316-f988-458d-bd6a-caa8f0ae861a   Mounted       /site/DB006_F3                 block:scsi:usb:pci
/dev/sdc14   ext4     DB006_F4   14b29e8c-2955-496e-84ca-2f2ef002c070   Mounted       /site/DB006_F4                 block:scsi:usb:pci
/dev/sdc15   ext4     DB006_F5   965e626b-5f45-48b4-b296-efd964307067   Mounted       /site/DB006_F5                 block:scsi:usb:pci
/dev/sdc16   ext4     DB006_F6   04fb8fc0-df53-4767-848f-4fbe9d03d79a   Mounted       /site/DB006_F6                 block:scsi:usb:pci
/dev/sdc17   ext4     DB006_F7   a5f6f5c2-1588-4a8d-b135-9d29f8ae7436   Mounted       /site/DB006_F7                 block:scsi:usb:pci
/dev/sdc18   ext4     DB006_F8   9ed33f4b-76e0-4bab-bf8d-0be444febd17   Mounted       /site/DB006_F8                 block:scsi:usb:pci
/dev/sdb5    swap     HIBERNATE  d6818877-fcce-4e10-b45c-17d5bf4670b8   Enabled       [SWAP]                         block:scsi:pci
/dev/sda2    ext4     null       29d3d257-b45a-4782-9e66-0a80e4468216   Not_Mounted   /site/null                     block:scsi:pci
/dev/sda3    swap     null       76e2dc68-b44a-415d-b353-3a97c56c31f7   Not_Enabled   [SWAP_OFFLINE]                 block:scsi:pci
/dev/sda5    ext4     null       8833df3f-cde3-492a-89e9-a73e9c776195   Mounted       /site/DB008_F2                 block:scsi:pci
/dev/sda4    ext4     null       fd5594b7-4686-421e-8bec-0fb222f1d404   Mounted       /site/DB008_F1                 block:scsi:pci
/dev/sda1    null     null       null                                   Not_Mounted   /site/null                     block:scsi:pci

	 Done.  [Devices__ReportDiskParts.sh]


Should have added this to my original post …

USB-attached 4TB Backup Disk:
(from inxi -Fxxx)

  ID-3: /dev/sdc type: USB vendor: Western Digital model: WD My Book 25EE
    size: 3.64 TiB type: N/A serial: 57583332443630455559524A rev: 4009
    scheme: GPT

Sample entry for non-primary disk:
(with default no-mount at boot)

#
###############################################################################################################
#	EXTERNAL DEVICE
#

# /dev/sdc3    ext4     DB005_F1   11c8fbcc-c1e1-424d-9ffe-ad0ccf480128   100G          /site/DB005_F1 USB_EXTERNAL
UUID=11c8fbcc-c1e1-424d-9ffe-ad0ccf480128 	/site/DB005_F1 	ext4 	defaults,nofail,journal_checksum,journal_async_commit,commit=15,errors=remount-ro,journal_ioprio=2,data_err=ignore,nodiscard,noauto	0	0
2 Likes

Thanks a heap, gents.

Solved and happy!

1 Like

This topic was automatically closed 18 hours after the last reply. New replies are no longer allowed.