2

I have recently installed Ubuntu Core on a Raspberry Pi 3 using the official images provided by Canonical. I have a USB hard drive connected to the Raspberry Pi. This drive is formatted as NTFS. In order to mount the external drive in Ubuntu Core during the boot process I have created the file /etc/systemd/system/media-data.mount with the content below:

[Unit]
Description=Mount unit for data

[Mount]
What=/dev/disk/by-uuid/4E1AEA7B1AEA6007
Where=/media/data
Type=ntfs
Options=rw

[Install]
WantedBy=multi-user.target

I can see the data contained in the external drive, but can't create new files or modify existing ones even with the root user. Is it possible that NTFS write support in not enabled by default in Ubuntu Core?

I have tried to mount the NTFS disk using:

sudo mount -t ntfs-3g /dev/disk/by-uuid/4E1AEA7B1AEA6007 /mnt

But this returns:

mount: unknown filesystem type 'ntfs-3g'

It seems that ntfs-3g is not installed and I don't know how to install it without 'apt install'. I have used Linux for a long time, but I'm new to snaps and ubuntu-core, so I'm trying to understand the best way to deal with problems like this. Any help would be useful.

1
  • what is the output of "ls -l" on /media ?
    – V Bota
    Jun 14, 2017 at 21:30

2 Answers 2

0

You have a few different options here:

  1. If ntfs-3g is installed, then you can just use the following instead of mount:

    $ ntfs-3g /dev/disk/by-uuid/4E1AEA7B1AEA6007 /mnt
    

    You can check if it installed with dpkg -l | grep ntfs-3g or sudo snap list | grep ntfs-3g

  2. If ntfs-3g isn't installed, then you can install it with sudo snap install ntfs-3g

  3. Finally, I know on at least Arch or Redhat that you don't have to explicitly run mount with the ntfs-3g type option as it looks in /usr/bin/mount.ntfs, which is just symlinked to /usr/bin/ntfs-3g if ntfs-3g is installed. So you can just run:

    $ sudo mount /dev/disk/by-uuid/4E1AEA7B1AEA6007 /mnt
    

Good luck!

1
  • Thanks for your help. I suppose the solution should be nearer. I have tried to install the ntfs-3g snap, but I can't find a stable snap with that name. The command sudo snap install ntfs-3g returns error: cannot install "ntfs-3g": snap not found. Is it an stable snap? How can I find it if is not in the stable channel?
    – sergio.s
    Jun 11, 2017 at 22:29
0

This worked for me on Ubuntu Core:

Options=umask=0007

For more details you can check: http://manpages.ubuntu.com/manpages/zesty/man5/systemd.mount.5.html and https://linux.die.net/man/8/mount

Also for someone reading this thread it is worth mentioning that for auto mount to work you need to execute:

sudo systemctl daemon-reload

sudo systemctl start media-data.mount

sudo systemctl enable media-data.mount

after creating the

/etc/systemd/system/media-data.mount

For details checkout this thread: https://flexion.org/posts/2016-12-raspberry-pi-3-powered-nextcloud-box-on-ubuntu-core/

1
  • The option umask=0111 didn't work for me. I don't think this is a permissions problem, because I can't write to the partition even with the root user. I already knew the link about nextcloud on ubuntu core because it's just what I want to do, but notice that in your link the hard drive is formatted as ext4 and the problem is with NTFS. I still haven't found the nfts-3g snap proposed by @grayson-kent.
    – sergio.s
    Jun 16, 2017 at 20:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .