Nextcloud external storage mapping

  • I setup OMV and plugged in a usb hard drive to store my data files on. Shared the folders on the external drive in OMV and can access them from my windows machines. All that works well.


    I installed the omv extras with docker and portainer. Installed Nextcloud and that works well. However, I'm trying now to access the external drive through Nextcloud and I can't seem to get it to work.

    The external drive it mounted at /srv/dev-disk-by-uuid-2A0B-54AD wth various folders inside that I can view in OMV, SSH and windows. I made a volume in portainer to that mount point. But I can't seem to access it in Nextcloud. I placed the /srv/dev-disk-by-uuid-2A0B-54AD in Nextcloud with the same folder name as the one that already exists on the drive and it doesn't show any information and won't let me write to the folder via nextcloud interface. I've done it before with nextcloud installed via snap on ubuntu server, but never in portainer.


    I'm sure I'm missing something simple, but I can't seem to find the answer via google.


    Any help?


    Thank you everyone.


  • I reviewed that information. I was able to make it work with nextcloud installed on ubuntu server, but I wanted the extra functionality of OMV along with Nextcloud so now I'm attempting to run it with OMV. I'm almost complete with setup, except for accessing those folders on the external drive using the Nextcloud interface.

    I tried creating a volume to the external drive in portainer, and pointing it to the mount point OMV created, and now nextcloud will accept the path but isn't pointed at the external location and I can't write to the folder.

  • I run several nextcloud servers both personally and for the office and clients, all on ubuntu vm's with storage managed by OMV.


    Nextcloud requires that any folder it can write to are owned by the web user (in debian and ubuntu the native web user is the www-data user). Judging by the 2A0B-54AD in the mount path, this drive is probably NTFS formatted. NTFS does not handle linux ownership and permissions so therefore nectcloud will not be able to write to it, and if I recall, the external storage option of nextcloud is read only anyway because of those permissions issues.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

  • I believe the drive is exfat. The test setup I did with ubuntu server had a ntfs formatted drive and it worked fine. You're right, it doesn't handle linux ownership, but nextcloud did write to it. The reason I prefer to have it formatted on a file system windows can natively read and write to is worst case scenario and I can just grab the drive and plug it into my laptop.

  • I believe the drive is exfat.

    NTFS mounted on Linux will always have ownership of root recursively.


    You can see this by:

    ls -al /srv/dev-disk-by-uuid-2A0B-54AD/

    In order to read/write to it, your Nextcloud must be launched with UID=0 which kills all the sense for Docker.


    You can do a little test:

    while logged as a standard USER, create a file/folder under /srv/dev-disk-by-uuid-2A0B-54AD/

    mkdir /srv/dev-disk-by-uuid-2A0B-54AD/folderOFuser

    touch /srv/dev-disk-by-uuid-2A0B-54AD/folderOFroot/myUSERfile




  • I believe the drive is exfat. The test setup I did with ubuntu server had a ntfs formatted drive and it worked fine. You're right, it doesn't handle linux ownership, but nextcloud did write to it. The reason I prefer to have it formatted on a file system windows can natively read and write to is worst case scenario and I can just grab the drive and plug it into my laptop.

    Non-linux file systems will always have permission issues.


    I would not use Exfat if I were you. Exfat is non journaled so is actually more prone to data loss.


    As for the desire to be able you plug the drive into windows, there are filesystem drivers for windows to handle ext4 drives.


    extFS for Windows | Paragon Software
    Read-write access to extFS-formatted volumes from Windows OS
    www.paragon-software.com

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

  • Sounds good. I will reformat my test drive to ext4 and retry mounting the drive in portainer for access inside Nextcloud.

    Thank you everyone for the information. I will see if I can make it work.

  • I've changed it to ext4 and I still can't connect to the drive. I'm just trying to get nextcloud to access a usb drive. I'm not sure if I need to mount it separately from omv. Right now it's

    /srv/dev-disk-by-uuid-147b03db-4807-48fb-9250-f0e8e08f35ad/backup

    where /backup is the shared folder.


    Any advice on how to get nextcloud to read and write to that folder?

  • Sorry, I have no advice regarding nextclound in docker. I run it from an ubuntu server vm that is just hosting the web components and fail2ban, with the data NFS shared to the VM, so I can control what gets mounted where in the VM, and the database in a native postgres on OMV and redis from a docker container.


    I did try the docker at one point, years ago, but I found it much more limited and quirkier to deal with from an admin point of view than the type of setup I'm using.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

  • Any advice on how to get nextcloud to read and write to that folder?

    Post the output of the ls -al on the folder.

    The user that runs nextcloud need to have read rights at least on it.


    Also, post the volume bind in use.

    • Official Post

    I reviewed that information. I was able to make it work with nextcloud installed on ubuntu server, but I wanted the extra functionality of OMV along with Nextcloud so now I'm attempting to run it with OMV. I'm almost complete with setup, except for accessing those folders on the external drive using the Nextcloud interface.

    I tried creating a volume to the external drive in portainer, and pointing it to the mount point OMV created, and now nextcloud will accept the path but isn't pointed at the external location and I can't write to the folder.


    Flyingsquid


    Nextcloud can access any samba share you have on your network. And you can read and write that data from the Nextcloud interface as if it were inside the Nextcloud database.


    All you have to do is install the External Storage plugin on Nextcloud, just like you did in that picture I see.

    The only thing you lacked is to configure it well.

    In the Add storage button you have to select samba. Then the interface will change and it will request the data to access the samba resource: Server IP, Shared folder name, User and Password.

    In Available for you have to select the Nextcloud user who will have access to those files. You can even further restrict permissions within Nextcloud to certain folders if you need to.


    No need to move any volumes to the container, Nextcloud will see the shared folders with samba the same as any client accesses.

    The files will work in the same way that the files in the Nextcloud database work.


    I do not use the Nextcloud database, all my data is accessible from Nextcloud through this system. This is how I avoid permission issues for backups etc. The only data that ends up in the database are contacts and calendar appointments.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!