Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 583214 - sys-fs/ntfs3g: please add 'symlink' USE to control /usr/sbin/mount.ntfs symlink creation
Summary: sys-fs/ntfs3g: please add 'symlink' USE to control /usr/sbin/mount.ntfs symli...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-16 16:58 UTC by Dmitry Petrov
Modified: 2021-11-06 23:58 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
symlink USE patch for ntfs3g ebuilds (ntfs3g-symlink.patch,2.33 KB, patch)
2016-05-16 16:58 UTC, Dmitry Petrov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Petrov 2016-05-16 16:58:20 UTC
Created attachment 434450 [details, diff]
symlink USE patch for ntfs3g ebuilds

Problem: I want to have read-only access to NTFS partitions and automatically mount them during boot process. Typical solution is to add
/dev/sdXY /mnt/win_c ntfs defaults 0 0
to /etc/fstab.

But https://bugs.gentoo.org/show_bug.cgi?id=374197, ntfs-3g is always used for this operation if installed (via mount.ntfs helper, which is symlink introduced in that bugreport).

Please make this symlink optional via USE symlink as it was initially suggested in #374197.

I've attached simple patch for all 3 versions of ntfs3g ebuild for convenience.

P. S. ofc I know about local overlays, but I feel like this symlink have such a great impact on mount behaviour (when it invoked as part of automatic mounting process) that is definitely deserves a separate USE-flag for ebuild in the main portage tree.
Comment 1 Coacher 2016-05-18 11:39:35 UTC
Sorry, status change was a misclick.
Comment 2 SpanKY gentoo-dev 2016-05-18 13:59:10 UTC
your problem statement doesn't make sense.  if you want read-only access, then use the "ro" flag to the options.  the symlink makes no difference here.
Comment 3 Dmitry Petrov 2016-05-18 14:30:21 UTC
It's kernel read-only ntfs driver versus fuse-driven ntfs-3g. They aren't the same in terms of performance and resource usage.
Comment 4 SpanKY gentoo-dev 2016-05-18 15:42:51 UTC
(In reply to Dmitry Petrov from comment #3)

i know what drivers you're talking about.  my point is, you're doing it wrong:
(1) if you want read-only, then you use "ro"
(2) the kernel driver, while defaulting to read-only, has read-write support

so if your only reason for wanting to drop this symlink is to be lazy and get read-only by default, the answer is "no".
Comment 5 Dmitry Petrov 2016-05-18 22:35:04 UTC
(In reply to SpanKY from comment #4)
I want to use kernel ntfs driver because:
1) it should be faster
2) it allows mounting of NTFS filesystems by regular users without sudo/suid helpers

That's what happen when /usr/sbin/mount.ntfs points to mount.ntfs-3g:
$ mount /mnt/win_d/
Unprivileged user can not mount NTFS block devices using the external FUSE
library. Either mount the volume as root, or rebuild NTFS-3G with integrated
FUSE support and make it setuid root. Please see more information at
http://tuxera.com/community/ntfs-3g-faq/#unprivileged

And as soon as /usr/sbin/mount.ntfs is removed, everything is fine. This symlink has great impact on mount behaviour (especially for unprivileged users). It should be optional in my opinion.

>so if your only reason for wanting to drop this symlink is to be lazy and get read-only by default, the answer is "no".

By the way, this symlink initially added because of someone being too lazy to use "ntfs-3g" filesystem type explicitly.

Also there was a question in original bug: https://bugs.gentoo.org/show_bug.cgi?id=374197#c2
- "Would making the mount.ntfs symlink break anything?"
It seems like the answer is: "yes, it is".
Comment 6 SpanKY gentoo-dev 2016-05-18 23:07:08 UTC
(In reply to Dmitry Petrov from comment #5)

if you want to mount things by hand, that's already trivial to do -- use the -i option.  thus there is no real impact for users if they want to force ntfs.

as for sudo/suid, you do realize mount is already suid right ?

as for ntfs-vs-ntfs-3g, ntfs-3g is a superior implementation of the ntfs filesystem, so making it the default even for ntfs entries makes sense.
Comment 7 Dmitry Petrov 2016-05-19 10:49:58 UTC
(In reply to SpanKY from comment #6)
> if you want to mount things by hand, that's already trivial to do -- use the
> -i option.  thus there is no real impact for users if they want to force
> ntfs.
And automatic ntfs mounting from fstab will always use ntfs-3g. There's no way to specify "-i" for fstab.

> as for sudo/suid, you do realize mount is already suid right ?
Sure it is. But mount.nfst-3g is not.

> as for ntfs-vs-ntfs-3g, ntfs-3g is a superior implementation of the ntfs
> filesystem, so making it the default even for ntfs entries makes sense.
ntfs-3g is a different implementation, which has its own advantages (write support) and disadvantages (may be slower/consume more resources because of fuse).

Let me summarize:
- my case (manual ntfs mount) is covered by adding "-i" option for mount
- manual mounting with ntfs-3g would require suid USE-flag
- automatic ntfs-3g should work without any problems
- automatic mounting using kernel ntfs driver is not possible (I don't know of any methods to emulate "-i" option from fstab)

The latter case is broken by unconditional creation of mount.ntfs symlink. Why don't place this functionality under USE-flag which can even be enabled by default if you think it's appropriate?
Comment 8 Mike Gilbert gentoo-dev 2017-10-29 15:48:04 UTC
This seems like a reasonable request to me.

As a workaround until this USE flag is added, you could add /usr/sbin/mount.ntfs to INSTALL_MASK.
Comment 9 Larry the Git Cow gentoo-dev 2021-11-05 23:12:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e88a6eb57790b8e05fa7b11c22f0b0855016fc22

commit e88a6eb57790b8e05fa7b11c22f0b0855016fc22
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-11-05 23:10:45 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-11-05 23:10:45 +0000

    sys-fs/ntfs3g: add 'mount-ntfs' USE flag
    
    Closes: https://bugs.gentoo.org/583214
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-fs/ntfs3g/metadata.xml            | 1 +
 sys-fs/ntfs3g/ntfs3g-2021.8.22.ebuild | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
Comment 10 jospezial 2021-11-06 22:35:18 UTC
[ebuild     U  ] sys-fs/ntfs3g-2021.8.22-r1:0/89::gentoo [2021.8.22:0/89::gentoo] USE="acl mount-ntfs%* ntfsprogs xattr -debug -ntfsdecrypt -static-libs -suid" 0 KiB

I wanted to disable the flag, but I don't see it in ufed. Why? When?
So I have to do it by hand.
Comment 11 jospezial 2021-11-06 22:54:55 UTC
after adding it for sys-fs/ntfs3g to /etc/portage/package.use/package.use
I see in ufed:
mount-ntfs (sys-fs/ntfs3g) (Unknown)
Comment 12 Mike Gilbert gentoo-dev 2021-11-06 23:58:59 UTC
(In reply to jospezial from comment #10)
> I wanted to disable the flag, but I don't see it in ufed. Why? When?
> So I have to do it by hand.

ufed is probably buggy and has no maintainer.

Regardless, this is not a bug in the ntfs3g ebuild. File a separate bug report if you wish.