all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* mounting NTFS read-write
@ 2018-02-04 21:59 Marco van Hulten
  2018-02-05 13:34 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Marco van Hulten @ 2018-02-04 21:59 UTC (permalink / raw)
  To: help-guix

Hello—

I have this in my Guix configuration:

    (file-system
      (device "my-scratch")
      (title 'label)
      (mount-point "/scratch")
      (type "ntfs")
      (flags '(read-write user)))

There are two problems with it.

1. The file system with label 'my-scratch' is not found.  Of course, I
can use (device "/dev/sda6") instead.  But why can it not use the
label?  It does turn up in cfdisk(8), just like for the root file
system /dev/sda1.

2. The flags are ignored.  At least the first one, read-write, is
likely ignored because Linux does not support write access to NTFS
file systems.  Then I looked in the manual [1], and found out that the
flags read-write and user do not exist.  The former is maybe redundant
because it is default (in case there is support for writable mount of
the respective filesystem!), but the second could be useful, at least
for removable media (though for that might exist other solutions).

[1]: https://www.gnu.org/software/guix/manual/html_node/File-Systems.html

Instead, NTFS file systems can be mounted with write access through
fuse, using ntfs-3g.  So I installed ntfs-3g, and added a cron job to
my /etc/config.scm; excerpt here:


(use-modules (gnu services mcron))
...
(define mount-ntfs-job
  #~(job "@reboot"
         "/root/.guix-profile/sbin/mount.ntfs-3g -o
         rw /dev/sda6 /scratch"))
(operating-system
  ...
  (services (cons* (mcron-service (list mount-ntfs-job))))


This does not work.  And I think it is ugly in that I do not provide
the ntfs-3g package in config.scm, and that I am solving this at all
through a root cronjob @reboot.  But I'm not versed well enough in Guix
yet to know how to do it properly!


Finally, why the heck do I have an NTFS partition on my drive?  Well, I
am dual booting between OpenBSD and GuixSD, and want to share one
partition.  OpenBSD does not support so many filesystems, but it does
provide the ntfs-3g package, and my guess is that NTFS is quite robust,
especially considering I'm using it exclusively with the ntfs-3g
package (making it effectively an open spec.).

I am open for all kind of alternatives.

—Marco

P.S. I had to type over all code because I am not able to copy things
from the terminal with select then middle-click.  Is this a GuixSD bug?

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

* Re: mounting NTFS read-write
  2018-02-04 21:59 mounting NTFS read-write Marco van Hulten
@ 2018-02-05 13:34 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2018-02-05 13:34 UTC (permalink / raw)
  To: Marco van Hulten; +Cc: help-guix

Hi Marco,

Marco van Hulten <marco@hulten.org> skribis:

> I have this in my Guix configuration:
>
>     (file-system
>       (device "my-scratch")
>       (title 'label)
>       (mount-point "/scratch")
>       (type "ntfs")
>       (flags '(read-write user)))
>
> There are two problems with it.
>
> 1. The file system with label 'my-scratch' is not found.  Of course, I
> can use (device "/dev/sda6") instead.  But why can it not use the
> label?  It does turn up in cfdisk(8), just like for the root file
> system /dev/sda1.

The code in (gnu build file-systems) currently supports labels for
ext2/3/4, Btrfs, LUKS, FAT, and ISO9660.  It does not support NTFS.

Two options:

  1. Implement the missing bits in (gnu build file-systems).  :-)
     It’s really not that hard, there are examples you can use as a
     starting point.

  2. Stick to /dev/foo.

> 2. The flags are ignored.  At least the first one, read-write, is
> likely ignored because Linux does not support write access to NTFS
> file systems.  Then I looked in the manual [1], and found out that the
> flags read-write and user do not exist.  The former is maybe redundant
> because it is default (in case there is support for writable mount of
> the respective filesystem!), but the second could be useful, at least
> for removable media (though for that might exist other solutions).

OK.

I think ‘file-system’ declarations don’t work with FUSE file systems,
though.  Currently we just call mount(2) with the given system type,
whereas for NTFS it would need to invoke the mount.ntfs-3g program.

This is what would need to be fixed.

> Instead, NTFS file systems can be mounted with write access through
> fuse, using ntfs-3g.  So I installed ntfs-3g, and added a cron job to
> my /etc/config.scm; excerpt here:
>
>
> (use-modules (gnu services mcron))
> ...
> (define mount-ntfs-job
>   #~(job "@reboot"
>          "/root/.guix-profile/sbin/mount.ntfs-3g -o
>          rw /dev/sda6 /scratch"))

You could follow the Findutils example in
<https://www.gnu.org/software/guix/manual/html_node/Scheduled-Job-Execution.html>
instead of use /root/.guix-profile.

However I don’t think “@reboot” is supposed by mcron.

HTH,
Ludo’.

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

end of thread, other threads:[~2018-02-05 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-04 21:59 mounting NTFS read-write Marco van Hulten
2018-02-05 13:34 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.