NTFS-3G mount / unexplained change

I do mount a ntfs disk form time to time as a user and today, it does not work anymore.

Mounting with “mount /mnt/Disk” returns “Unprivileged user can not mount NTFS block devices using the external FUSElibrary. Either mount the volume as root, or rebuild NTFS-3G with integrated FUSE support and make it setuid root.”

I did manage to open as root (with the “disks” applicaion") but this is not the idea.

/etc/fstab contains a line with… “UUID=xxx /mnt/Disk ntfs rw,noauto 0 2”

“ntfs-3g -v” returns “…ntfs-3g 2021.8.22 external FUSE 29…” and all the possible ntfs official packages are correctly updated.

What can I do???

There is nothing unusual there - mounting a device has always required root. If you are used to something different it is due to a local configuration.

The exception to the rule is removable devices.

Having an entry in fstab like you showed has no meaning if the device is removable - which I deduct because you have the noauto option - and that is usually only used if the device is not available at boot time.

I suggest you comment the line and reboot your system.

Then connect your removable ntfs formatted disk and you will probably be able to access it using a GUI file manager - suffice you have the gvfs package installed.

1 Like

Thank you for your proposal.

It is a fixed ssd disk (partition) that I want to mount only when needed and where needed. That’s the reason why I have it shown in fstab and with the noauto option. Is that a strange setup? Sometimes I
use it with w7 and this is the reason for ntfs.

With the time and some trial/errors I did find it acceptable for me and it did work fine for months. Now, something has changed, possibily with an update?

The ntfs-3g package was last changed more than a month ago - but I doubt it has something to do with your issue.

I suggest you create a mount unit and an supplement automount for the device and then enable the automount unit. Doing so will only mount the device when you specifically access the mountpoint.

1 Like

Thank you, this is completely new for me and I have to explore a bit.
I have no practice of systemctl and did not know that fstab could be replaced (I have worked for years with Debian and adopted Manjaro a since 2 or 3 months only)

It does not work yet but maybe I did try it too quickly.

A quick suggestion using your info from OP (for anyone reading this - other than OP please read the topics linked above).

I assume you already have the folder /mnt/Disk

So proceed to create a file mnt-Disk.mount

/etc/systemd/system/mnt-Disk.mount

with content (use lsblk -o PATH,UUID to get UUID) and replace $UUID with the actual UUID

[Unit]
Description=Windows data (ntfs)

[Mount]
What=/dev/disk/by-uuid/$UUID
Where=/mnt/Disk
Type=ntfs
Options=rw,noatime

[Install]
WantedBy=multi-user.target

And an automount unit named mnt-Disk.automount

/etc/systemd/system/mnt-Disk.automount

with content

[Unit]
Description=Windows data (ntfs)
ConditionPathExists=/mnt/Disk

[Automount]
Where=/mnt/Disk
TimeoutIdleSec=10

[Install]
WantedBy=multi-user.target

Then enable and start the automount

sudo systemctl enable --now mnt-Disk.automount

That is all. You can now navigate to the path and it will mount when you access it.

1 Like

A post was split to a new topic: Mount partition using systemd

Sorry, have been too quick, did partially work

You are right about the typo - I have fixed it.

The mount unit is mnt-Disk.mount and your automount is mnt-Disk.automount

ONLY one can be started and enabled

If you want to only mount on access then disable the mount unit and enable the automount.

sudo systemctl disable --now mnt-Disk.mount

then enable the automount

sudo systemctl enable --now mnt-Disk.automount

It works this way - the automount unit activates the mount unit when you access the path - so you need both for this to work - and I assume you already have the mountpoint /mnt/Disk defined.

2 Likes

Thank you, it is interesting but a bit more complex than fstab? I should study a bit more about systemctl?

Apparently I understand and it works but I did comment the corresponding line in fstab and the unit is now automatically mounted on /run/media at boot. I have to unmount and when I enter again it works. Do I have such a special setup?

That doesn’t make sense… Please provide:

  • full contents of:
    • fstab,
    • mnt-Disk.mount,
    • mnt-Disk.automount,
  • output of:
    • systemctl list-units *mount*

please?

:thinking:

OK, thanks for your interest!
I will further investigate and reply with a complete information if I do not find. l will be unable to do it right now.
I am not really surprised though, automount is enabled but when booting, the system identifies /dev/sdb1 as an external drive that is already connected with no specific indications in fstab… Hence it mounts on /run/media
Do I have a very strange, unusual set up when I do not want to mount a connected disk at boot but only when needed?

Unable to answer without:

:man_shrugging:

My mistake as I forgot to mention you must comment the entry in fstab for the automount to work.

I my opinion it is not more complex than fstab - the options part in fstab - becomes horrible when you try add systemd automount options.

When you are used to fstab - as with anything you are acustomed to - it requires a synaptic reboot :slight_smile: if you get the idea.

The fact that that systemd parses the fstab and converts it to mount units speaks for creating mount units to replace fstab lines - unless you have every root folder on separate partitions.

I see your approach as unique - in the sense you are treating the device as removable - despite not being removable - you want it to behave like removable as you don’t want it mounted unless you are using it.

The way I see it you get exactly what you want with these systemd units.

The devices is mounted when accessed and it quietly dismounts after a period of inactivity.

I had commented the line in fstab indeed, I did well understand that we were considering a complete replacement with systemctl.
I am very interested to discover the option and agree that there is a learning curve.
Therefore, I would like to see it working.

In order to respond to both Fabby and you, I did prepare a more complete information, output of systemctl list-units -all mount #I added “all” to check wether mnt-Fly.mount was effectively inactive

  UNIT                                                  LOAD   ACTIVE   SUB     DESCRIPTION                                    
  mnt-Fly.automount                                     loaded active   waiting Automount Fly Disk                             
  mnt-Fly.mount                                         loaded inactive dead    Mount Fly ntfs disk (/mnt/Fly)
  var-lib-snapd-snap-bare-5.mount                       loaded active   mounted Mount unit for bare, revision 5
  var-lib-snapd-snap-core18-2074.mount                  loaded active   mounted Mount unit for core18, revision 2074
  var-lib-snapd-snap-core18-2128.mount                  loaded active   mounted Mount unit for core18, revision 2128
  var-lib-snapd-snap-gnome\x2d3\x2d28\x2d1804-145.mount loaded active   mounted Mount unit for gnome-3-28-1804, revision 145
  var-lib-snapd-snap-gnome\x2d3\x2d28\x2d1804-161.mount loaded active   mounted Mount unit for gnome-3-28-1804, revision 161
  var-lib-snapd-snap-gtk\x2dcommon\x2dthemes-1515.mount loaded active   mounted Mount unit for gtk-common-themes, revision 1515
  var-lib-snapd-snap-gtk\x2dcommon\x2dthemes-1519.mount loaded active   mounted Mount unit for gtk-common-themes, revision 1519
  var-lib-snapd-snap-snapd-12883.mount                  loaded active   mounted Mount unit for snapd, revision 12883
  var-lib-snapd-snap-snapd-13170.mount                  loaded active   mounted Mount unit for snapd, revision 13170

The complete mnt-Fly.* and a line frrom fstab

>>> /etc/fstab (part)
# UUID=xxxx                  /mnt/Fly         ntfs     rw,noauto             0  2

>>> /etc/systemd/system/mnt-Fly.mount
[Unit]
Description=Mount Fly ntfs disk (/mnt/Fly)

[Mount]
What=/dev/disk/by-uuid/xxxx
Where=/mnt/Fly
Type=ntfs
Options=rw,noatime
#TimeoutSec=seconds

[Install]
WantedBy=multi-user.target

>>> /etc/systemd/system/mnt-Fly.automount
[Unit]
Description=Automount Fly Disk
ConditionPathExists=/mnt/Fly

[Automount]
Where=/mnt/Fly
TimeoutIdleSec=10

[Install]
WantedBy=multi-user.target

Sorry, I was unable to join text files…

I had a question/doubt with Options=rw,noatime as in my formerly working fstab I had a noauto option??

With partition mounts - the Type and Options are optional as systemd can mount it using the correct filesystem anyway.

You can test it by commenting the lines in your mount unit. Remember to reload systemd

sudo systemd --daemon-reload

The noauto you used has been made obsolete by the automount unit which watches the filesystem and when you access the mountpoint the device is mounted.

In fact, I do so for the windows’ C: and D: that I do not want to mount in a day-to-day operation but have to be mounted on a known point when needed

That is entirely OK :slight_smile: I am not by any measure against what you do - in fact I understand. I do the same thing with specific USB devices which must be on specific path when I need it - backup device.

I have always had trouble with my fstab and my network mounts - which at some point lead me to systemd mount units and it was the turning point for me.

My mounts became logic - what, where, when, how … which is why I recommend them - probably to a point of annoyance to some :slight_smile:

I expanded to my partitions and where I had to tediously edit fstab everytime - now I just run a script from my backup partition - this takes care of various tasks related to my preferred filesystem layout.

And I am up in the few seconds it takes me to execute the scripts.

1 Like

I also consider this might become interesting for me, to prorgressively reduce fstab…
I would like to say that this topic is closed because I did learn something new and I may have to work a bit more on my personal setup. How do I close it???

with the comment which provided you with the necessary information → click the three dots next to the Reply button then click the Solution checkbox