My external HD mounts on different folders everytime I restart

Ever since a major update on many of my software, my external HD created a new address for it to mount on “/mnt/wwn-0x50014ee60917c2cf-part1/” and leaving the old one empty “/mnt/usb-WD_Elements_25A2_57585531453638413338374E-0:0-part1”, however if I restart it might go back to using the old one if i’m lucky. Why is this happening? I can’t delete the folders.

Hello @daedalus :wink:

How do you set it up? Gnome-Disks? Fstab? systemd-mount?

I don’t remember, but I usually use gnome disks. Def not the other 2.

Then I guess it uses udisks in the background for mounting. Sorry I cannot say why the folder name changes, but I guess it because some sort of auto mounting. Note that thunar uses also udisks in the background.

Normally gnome-disks should write a fstab entry for a permanent mount.

Please share the terminal output of:

cat /etc/fstab

Thanks, unless thunar is running in the bg, i don’t use it, i use dolphin.

output:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=AED9-11AC                            /boot/efi      vfat    umask=0077 0 2
UUID=0b905aaa-f47a-433c-9c9b-036e6559c3b4 /              ext4    defaults,noatime 0 1
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0
/dev/disk/by-uuid/40f6c76a-e547-41b1-b34b-2ea459c9eab4 /run/media/manjaro/40f6c76a-e547-41b1-b34b-2ea459c9eab4/Data/ auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-id/usb-WD_Elements_25A2_57585531453638413338374E-0:0-part1 /mnt/usb-WD_Elements_25A2_57585531453638413338374E-0:0-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/run/media/manjaro/40f6c76a-e547-41b1-b34b-2ea459c9eab4/Data/swapfile none swap defaults 0 0


/dev/disk/by-id/wwn-0x50014ee60917c2cf-part1 /mnt/wwn-0x50014ee60917c2cf-part1 auto nosuid,nodev,nofail,x-gvfs-show 0 0

Side note: Don’t mess with formatting just follow this:

Ok well, just note that a partition can be mounted multiple times in parallel in different folders.

So lets say fstab mounts it in /mnt/folder-a and dolphin mounts it in /mnt/folder-b. Both folders have the same content.

This Folder is not mentioned in fstab, therefore it must be a mount of dolphin?

Correction: It is this one:


This must be the one you need. Better use a label or uuid instead of the id.

I am not sure…

All these mounts are the same partition? It is a bit confusing…

This should reveal more info:

lsblk --fs

Second line and fourth line only.

NAME   FSTYPE   FSVER LABEL    UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0  squashfs 4.0                                                       0   100% /var/lib/snapd/snap/bare/5
loop1  squashfs 4.0                                                       0   100% /var/lib/snapd/snap/core/14399
loop2  squashfs 4.0                                                       0   100% /var/lib/snapd/snap/core18/2654
loop3  squashfs 4.0                                                       0   100% /var/lib/snapd/snap/core20/1778
loop4  squashfs 4.0                                                       0   100% /var/lib/snapd/snap/core18/2667
loop5  squashfs 4.0                                                       0   100% /var/lib/snapd/snap/gnome-3-28-1804/161
loop6  squashfs 4.0                                                       0   100% /var/lib/snapd/snap/gtk2-common-themes/13
loop7  squashfs 4.0                                                       0   100% /var/lib/snapd/snap/core20/1738
loop8  squashfs 4.0                                                       0   100% /var/lib/snapd/snap/gtk-common-themes/1534
loop9  squashfs 4.0                                                       0   100% /var/lib/snapd/snap/gtk-common-themes/1535
loop10 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/notepadqq/855
loop11 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/p7zip-desktop/220
loop12 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/riseup-vpn/179
loop13 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/pyqt5-runtime-core20/9
loop14 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/sdlvnc/2
loop15 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/snapd/17883
loop16 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/spek/59
loop17 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/wine-platform-6-stable/19
loop18 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/wine-platform-6-stable/14
loop19 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/wine-platform-runtime/323
loop20 squashfs 4.0                                                       0   100% /var/lib/snapd/snap/wine-platform-runtime/324
sda                                                                                
├─sda1 vfat     FAT32 NO_LABEL AED9-11AC                             299,1M     0% /boot/efi
├─sda2 ext4     1.0            0b905aaa-f47a-433c-9c9b-036e6559c3b4    1,5G    92% /
└─sda3 ext4     1.0            40f6c76a-e547-41b1-b34b-2ea459c9eab4  149,6G     7% /run/media/manjaro/40f6c76a-e547-41b1-b34b-2ea459c9eab4/Data
sdb                                                                                
└─sdb1 ntfs           KAI      32BE9B73BE9B2DFB                       44,3G    95% /mnt/wwn-0x50014ee60917c2cf-part1
sdc                                                                                
sr0  

I just changed the mount point for a 3rd new one, and it only worked once, then it went back to “mnt/wwn-0x50014ee60917c2cf-part1”, I was also getting some logs just as the OS shuts down everytime (also happening before), I’ll see if I can do a screen recording. Usually says something like “failed unmounting mnt/wwn-0x50014ee60917c2cf-part1” or whatever the address is.

No doubt. If it is mounted by fstab (as root), then you cannot umount it, unless you use the user or users option.

Maybe a better option would be systemd-mount … let me explain in short:

systemd-mount --automount=yes --timeout-idle-sec=180 --options="x-gvfs-show" --type="ntfs" --fsck=no --description="WD Elements HDD" /dev/sdb1 /mnt/sdb1
  • automount → It only mounts the device when you access the mountpoint
  • timeout-idle-sec → unmount after x seconds of idle
  • If the devices is not connected, then nothing is there.
  • It uses systemd directly. On systems with systemd fstab is converted into a systemd service anyway.
  • It replaces fstab that way.

List all mountable devices:

systemd-mount --list --no-pager

List units with a specific type:

# Current mounts
systemctl list-units --type=mount --no-pager
# Current automounts which watch for a device and when you enter the folder
systemctl list-units --type=automount --no-pager

Unmount

systemd-boot -u /dev/sdb1

Just note: A mount here is permanent and unmount aswell. It creates systemd units which will last until you unmount it.

says “at most 2 arguments are required”

Upps typo…

type"ntfs"--type="ntfs"

Corrected above.

1 Like

@daedalus

Ah well to add here… forgot to mention it.

In case f a usb device, there is the option --discover.

       --discover
           Enable probing of the mount source. This switch is implied if a
           single argument is specified on the command line. If passed,
           additional metadata is read from the device to enhance the unit to
           create. For example, a descriptive string for the transient units is
           generated from the file system label and device model. Moreover if a
           removable block device (e.g. USB stick) is detected an automount unit
           instead of a regular mount unit is created, with a short idle
           timeout, in order to ensure the file-system is placed in a clean
           state quickly after each access.

So…

systemd-mount --discover /dev/sdb1 /mnt/sdb1

is enough in general.

1 Like

Thanks for your help so far, you’ve been really clear. I’ll try this configuration for a few days and see if it has no issues. :wink:

1 Like

Hello again sorry to bother but I’m having a different issue now. Do you happen to know if there’s a log of all scanned folders in a drive once the device is mounted? I deleted some files by accident and I need to know the names of the folders so i can get it back. (I still haven’t shut down my computer)

That issue is a different topic. Feel free to create a new one.

Just for answering the basic questions:

No idea what you mean here, but in general there is no such log.

In general it is difficult to get files back if even possible. Do always backups! If if you mean your external NTFS Partition on your WD Elements, then sorry. Only Windows can do this. Linux can only read, write and maybe fix simple things on NTFS. But even if it is a linux compatible filesystem it could be rather difficult.

Only tool I know which is actually usable is testdisk.

1 Like

I’ll try using testdisk.
Thankfully I lost only some files, and they’re not all that important anyway. I am recovering some information already. I just need the name of the files.

Thanks again.