Nextcloud Appliance External Disk?

Hi,

I have just installed the Nextcloud appliance on my Nextcloud Box (RPi3 + 1TB WD USB disk)

It is all working, but I am having trouble adding the external 1TB disk to my Nextcloud

I reformatted the disk to ext4

The disk is not automatically mounted (I think) so I mounted it at /mnt via ssh

sudo mount /dev/sda1 /mnt

Then, after enabling the External Storages App, via the admin settings I added a local external storage at location /mnt

This seemed to work, but when I tried to upload to this folder in Nextcloud I get errors:

Uploading a file gives:

Error while copying file to target location (copied bytes: -1, expected filesize: 840614 )

Making a new folder gives:

Could not create folder “New folder”

I also tried mounting to media/usb but with the same result

What am I doing wrong please?

Thanks

Leigh

You chose the right locations (either somewhere in /mnt or somewhere in /media), but you also need to make sure you give the snap permission to access that location (it doesn’t have that by default). You do that by connecting the removable-media interface:

$ sudo snap connect nextcloud:removable-media

@kyrofa
Thanks!
That worked a treat
Where do I find documentation on that sort of thing - is it snap or nextcloud?
I’m trying to avoid having to ask at every step of the way :slight_smile:
Cheers again
Leigh

No problem @leigh. That particular question overlaps a bit-- you should never be afraid to ask. There is some documentation (including this) in the README of the snap if you’d like to check it out.

Cheers
Could you tell me how I make the external disk mount automatic on reboot?
Leigh

You have to edit /etc/fstab to auto mount:

Mounting an external drive

Preparations:

  • Create a mountpoint for the external drive and ncdata
sudo mkdir /media/ncp
  • Find UUID of external drive
ls -lh /dev/disk/by-uuid/

(Mine looks like this)
total 0
lrwxrwxrwx 1 root root 15 Aug 11 09:10 29075e46-f0d4-44e2-a9e7-55ac02d6e6cc -> …/…/mmcblk0p2
lrwxrwxrwx 1 root root 10 Aug 11 09:10 35e98a80-8895-41f4-93e7-39940a1fda70 -> …/…/sda1
lrwxrwxrwx 1 root root 15 Aug 11 09:10 9304-D9FD -> …/…/mmcblk0p1

  • Add a ligne to /etc/fstab
sudo nano /etc/fstab

add line for your drive (copy/paste your drive’s UUID and change ext4 to btrfs if needed):

UUID=YourDrive’sUUID /media/ncp ext4 rw,users 0 0
  • mount the drive
sudo mount -a

Source

1 Like

Thanks,
But /etc/fstab has the first lines:

Auto-generated by /init

DO NOT EDIT THIS FILE BY HAND - YOUR CHANGES WILL BE OVERWRITTEN

(See writable-paths(5) for details)

Dont touch the first lines, just add a line at the end of the file.

Thanks Oliver, but I found a solution using systemd here with more info here

I am using the Ubuntu Nextcloud Appliance which I am pretty sure is the Snap on Ubuntu Core

1 Like