unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* (no subject)
@ 2021-10-08 15:24 Théo Tyburn
  2021-10-08 16:24 ` Mounting ntfs-3g file systems at Guix System boot time Tobias Geerinckx-Rice
  0 siblings, 1 reply; 3+ messages in thread
From: Théo Tyburn @ 2021-10-08 15:24 UTC (permalink / raw)
  To: help-guix

Hi :)

I'm trying to mount an internal hard drive with ntfs partition
automatically when I boot. So I added this to
file-systems in my operating-system definition :

(file-system
    (device "/dev/sdb1")
    (mount-point "/mnt/ihd")
    (type "ntfs")
    (check? #f))

By doing so the filesystem is owned by root and other users don't have
any permissions on it.

So based on what I found running "man mount" I tried adding one after
the other these options
(options "rw"), (options "defaults"), (options "guid=users,umask=000")

so for example I tried
(file-system
    (device "/dev/sdb1")
    (mount-point "/mnt/ihd")
    (type "ntfs")
    (options "rw")
    (check? #f))

but I always get the same error when I reboot after reconfiguring:
'ntfs: (device sdb1): parse_options(): Unrecognized mount option rw'

From what I found here
https://wiki.archlinux.org/title/Udisks#NTFS_mount_failing
the problem might come from the fact that the ntfs used is that from the kernel
and not the version from ntfs-3g.
The first doens't seem to recognize mount options.

This might also be linked to another problem : notice I add the field
(check? #f).
Without it I got the error :
"ntfsfix : no such file or directory"
I guess ntfsfix also comes bundled with ntfs-3g
so it would make sense that these two bugs have the same origin.

So the question is : how do I make make guix use the ntfs-3g package
in my operating system definition ?
Of course the package is available in the package list of the
operating system definition.

I looked a bit at the source but couldn't figure out how the command
(mount.ntfs or mount.ntfs-3g)
is selected depending on the fs type.
The decisive steps seem to happen in the "mount-file-system" define*
at the end of gnu/build/file-system.scm.
What I don't understand there is what "(mount source target type flags
options)" does,
because I don't find where (mount) is defined.
This is as far as my guile/geiser hacking level can take me for now.
If sommeone can explain me, I'd be gratefull !

Théo Tyburn


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Mounting ntfs-3g file systems at Guix System boot time
  2021-10-08 15:24 Théo Tyburn
@ 2021-10-08 16:24 ` Tobias Geerinckx-Rice
  2021-10-08 17:55   ` Théo Tyburn
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-10-08 16:24 UTC (permalink / raw)
  To: Théo Tyburn; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 2699 bytes --]

Théo,

Théo Tyburn 写道:
> Hi :)

Welcome!

> From what I found here
> https://wiki.archlinux.org/title/Udisks#NTFS_mount_failing
> the problem might come from the fact that the ntfs used is that 
> from the kernel
> and not the version from ntfs-3g.

They are correct.

Guix System doesn't currently support auto-mounting anything with 
ntfs-3g from the initrd (and maybe at all?  I didn't check).

> This might also be linked to another problem : notice I add the 
> field
> (check? #f).
> Without it I got the error :
> "ntfsfix : no such file or directory"

Oops, that's a bug.  I have a static ntfsfix in my local tree but 
it needs to be cleaned up before I can push it.  I'll try to do so 
this weekend but it's a busy one.  Until then, (check? #f) for 
NTFS is perfectly fine.  Maybe it should even become the default.

> I guess ntfsfix also comes bundled with ntfs-3g
> so it would make sense that these two bugs have the same origin.

Kind of, in the abstract, but also not really.  For ntfsfix we can 
simply add it to the existing per-file-system logic in (gnu system 
initrd).

For actually mounting ntfs-3g file systems, things aren't so 
simple, because we call the mount syscall directly.  This works 
fine for ‘real’ file systems supported by the kernel, but it cuts 
out the ‘mount helper’ workflow that things like ntfs-3g and FUSE 
in general like to use.

We'd have to add a quick hack for ntfs-3g or a general interface 
for calling mount helper binaries, which will take a bit more 
thought and time…

> So the question is : how do I make make guix use the ntfs-3g 
> package
> in my operating system definition ?

So for ‘use == mounting at boot time’, I don't think this is 
currently possible.

> I looked a bit at the source but couldn't figure out how the 
> command
> (mount.ntfs or mount.ntfs-3g)
> is selected depending on the fs type.

So, nowhere.  We never call the mount binary and it's not 
available in the initrd.

> The decisive steps seem to happen in the "mount-file-system" 
> define*
> at the end of gnu/build/file-system.scm.
> What I don't understand there is what "(mount source target type 
> flags
> options)" does,
> because I don't find where (mount) is defined.

Check out (guix build syscalls) :-)

Aside: the coming ntfs3 (no relation despite the similar name) 
driver promises to replace the old & slow ntfs-3g entirely, and 
wouldn't suffer from this trouble.  Of course a general plan to 
mount other FUSE file systems at Guix boot would still be nice.

Kind regards,

T G-R

[0]: http://lkml.iu.edu/hypermail/linux/kernel/2109.0/03094.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Mounting ntfs-3g file systems at Guix System boot time
  2021-10-08 16:24 ` Mounting ntfs-3g file systems at Guix System boot time Tobias Geerinckx-Rice
@ 2021-10-08 17:55   ` Théo Tyburn
  0 siblings, 0 replies; 3+ messages in thread
From: Théo Tyburn @ 2021-10-08 17:55 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: help-guix

Thank you for the swift and kind reply Tobias,

> Welcome!

Thanks!

> > This might also be linked to another problem : notice I add the
> > field
> > (check? #f).
> > Without it I got the error :
> > "ntfsfix : no such file or directory"
>
> Oops, that's a bug.  I have a static ntfsfix in my local tree but
> it needs to be cleaned up before I can push it.  I'll try to do so
> this weekend but it's a busy one.  Until then, (check? #f) for
> NTFS is perfectly fine.  Maybe it should even become the default.

Oh I see. Happy I could find one. Anyway there is no hurry.

> > I guess ntfsfix also comes bundled with ntfs-3g
> > so it would make sense that these two bugs have the same origin.
>
> Kind of, in the abstract, but also not really.  For ntfsfix we can
> simply add it to the existing per-file-system logic in (gnu system
> initrd).
>
> For actually mounting ntfs-3g file systems, things aren't so
> simple, because we call the mount syscall directly.  This works
> fine for ‘real’ file systems supported by the kernel, but it cuts
> out the ‘mount helper’ workflow that things like ntfs-3g and FUSE
> in general like to use.
>
> We'd have to add a quick hack for ntfs-3g or a general interface
> for calling mount helper binaries, which will take a bit more
> thought and time…

I see. I was thinking about something like that, but was not sure it
was possible.
I'll have a look at initrd source to try to follow along when this
interface gets put together. If this is not too advanced I could also
give a hand depending on my progress.

> > So the question is : how do I make make guix use the ntfs-3g
> > package
> > in my operating system definition ?
>
> So for ‘use == mounting at boot time’, I don't think this is
> currently possible.
>
> > I looked a bit at the source but couldn't figure out how the
> > command
> > (mount.ntfs or mount.ntfs-3g)
> > is selected depending on the fs type.
>
> So, nowhere.  We never call the mount binary and it's not
> available in the initrd.
>
> > The decisive steps seem to happen in the "mount-file-system"
> > define*
> > at the end of gnu/build/file-system.scm.
> > What I don't understand there is what "(mount source target type
> > flags
> > options)" does,
> > because I don't find where (mount) is defined.
>
> Check out (guix build syscalls) :-)

I'll study that!

> Aside: the coming ntfs3 (no relation despite the similar name)
> driver promises to replace the old & slow ntfs-3g entirely, and
> wouldn't suffer from this trouble.

That sounds promissing !

> Of course a general plan to
> mount other FUSE file systems at Guix boot would still be nice.

Yes that would still be really good to have. It was also difficult on
Debian to do this.

Kind regards,

TT


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-08 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 15:24 Théo Tyburn
2021-10-08 16:24 ` Mounting ntfs-3g file systems at Guix System boot time Tobias Geerinckx-Rice
2021-10-08 17:55   ` Théo Tyburn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).