Nextcloud install on external data folder fails Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Markstar
Posts: 15
Joined: Tue Oct 22, 2019 12:15 pm

Nextcloud install on external data folder fails

Post by Markstar »

Hi,
I'm very new to Linux and so my DietPi runs in a VirtualBox environment (on an SSD) and I'm very happy about it, but have trouble getting Nextcloud to work on a shared drive:


  • I have mounted the hard drive for the data via the "Drive_Manager" and appear to be able to read and write from/to it. The drive is mounted as "/mnt/recent/" and I created a subdirectory "dietpi" where everything data-related so supposed to go in the future.
  • I have edited the "/boot/dietpi.txt" entry for Nextcloud:

    Code: Select all

    SOFTWARE_NEXTCLOUD_DATADIR=/mnt/recent/dietpi/nextcloud_data
  • The following error:
    Can't create or write into the data directory
    It does create the folder, but nothing gets written into it. :?
    https://imgur.com/1xOpQp3
  • After more Google, I tried to give access to the mount with these commands:

    Code: Select all

    sudo chown -R www-data:www-data /mnt/recent/dietpi
    sudo chmod -R 775 /mnt/recent/dietpi
    However, that did not change anything and I'm out of my depth there.
I would really appreciate some help on this!

Thank you in advance!
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: Nextcloud install on external data folder fails

Post by Joulinar »

Can you share some more information on this directory? Is this an external disk you have mounted? If yes which file system format you are using?

Can you share following

Code: Select all

ls -la /mnt/recent/dietpi/
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Markstar
Posts: 15
Joined: Tue Oct 22, 2019 12:15 pm

Re: Nextcloud install on external data folder fails

Post by Markstar »

Joulinar wrote: Wed May 12, 2021 2:41 pm Can you share some more information on this directory? Is this an external disk you have mounted? If yes which file system format you are using?
Thank you for your reply! DietPi is running inside Windows and the share is an internal NTFS drive. I'm not sure what else to say, other than that I would also like to use that drive/directory for more than just Nextcloud.
Can you share following

Code: Select all

ls -la /mnt/recent/dietpi/
Here it is:

Code: Select all

dietpi@DietPi:/mnt/recent/dietpi$ ls -la
total 4
drwxrwx--- 2 dietpi dietpi            0 May 12 12:38 .
drwxrwx--- 2 dietpi dietpi         4096 May 12 12:02 ..
drwxrwx--- 2 dietpi dietpi            0 May 12 12:38 nextcloud_data
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: Nextcloud install on external data folder fails

Post by Joulinar »

NTFS might be the issue as it doesn't support unix file system permission. As you can see all folder belong to user dietpi. Better to use a disk formatted with ext4
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Markstar
Posts: 15
Joined: Tue Oct 22, 2019 12:15 pm

Re: Nextcloud install on external data folder fails

Post by Markstar »

Unfortunately that is not really an option, as other parts of the drive are in use by the Windows host. :?

I guess I could add a VHD-based drive that I can mount if things go sideways, but I really would have preferred something that the host can access as well.

Edit: Adding another drive (VHD, in my case) did the trick, though it's not really a satisfactory solution since a corruption of the whole container is much more likely than one of single files.
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: Nextcloud install on external data folder fails

Post by Joulinar »

probably I need to revert my statement from above. I did some test on my RPi4 64bit using a USB stick. Formatted the USB stick using dietpi-drive_manager as NTFS device and I had no issues to install NextCloud

data location set in /boot/dietpi.txt

Code: Select all

SOFTWARE_NEXTCLOUD_DATADIR=/mnt/ntfs
sdb1 is the NTFS drive mounted to /mnt/ntfs

Code: Select all

root@DietPi4:/mnt/ntfs# lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid
NAME   FSTYPE LABEL   SIZE RO TYPE MOUNTPOINT PARTUUID                             UUID
sda                  14.3G  0 disk
├─sda1 vfat   boot    256M  0 part /boot      8f4dbd00-01                          4ADC-240F
└─sda2 ext4   rootfs 14.1G  0 part /          8f4dbd00-02                          89cef7ba-d45a-47e7-8d42-aff18afcec80
sdb                   3.8G  0 disk
└─sdb1 ntfs           3.8G  0 part /mnt/ntfs  60123f76-01                          7CA1A8E7620FB273
root@DietPi4:/mnt/ntfs#
Nextcloud data are located on /mnt/ntfs

Code: Select all

root@DietPi4:/mnt/ntfs# ls -la
total 10
drwxrwx--- 1 www-data www-data 4096 May 12 22:30 .
drwxr-xr-x 8 root     root     4096 May 12 22:14 ..
-rw-r--r-- 1 www-data www-data  542 May 12 22:28 .htaccess
-rw-r--r-- 1 www-data www-data    0 May 12 22:28 .ocdata
drwxr-xr-x 1 www-data www-data  240 May 12 22:32 admin
drwxr-xr-x 1 www-data www-data  520 May 12 22:32 appdata_oco7ao8pebus
-rw-r--r-- 1 www-data www-data    0 May 12 22:28 index.html
-rw-r--r-- 1 www-data www-data    0 May 12 22:28 nextcloud.log
root@DietPi4:/mnt/ntfs#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Markstar
Posts: 15
Joined: Tue Oct 22, 2019 12:15 pm

Re: Nextcloud install on external data folder fails

Post by Markstar »

Thank you so much for your time! I will try it out to see if that works for me.

I still wonder why using an existing NTFS partition doesn't work. Oh well. :D
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: Nextcloud install on external data folder fails

Post by Joulinar »

maybe it's the way how it is mounted? can you share cat /etc/fstab
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Markstar
Posts: 15
Joined: Tue Oct 22, 2019 12:15 pm

Re: Nextcloud install on external data folder fails

Post by Markstar »

Here it is:

Code: Select all

dietpi@DietPi:~$ cat /etc/fstab
# You can use "dietpi-drive_manager" to setup mounts.
# NB: It overwrites and re-creates physical drive mount entries on use.
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------
//192.168.1.3/Recent /mnt/recent cifs cred=/var/lib/dietpi/dietpi-drive_manager/mnt-recent.cred,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=3.1.1,nofail,noauto,x-systemd.automount

#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1024M,noatime,lazytime,nodev,nosuid,mode=1777
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf (VirtualBox shared folder), gluster, bind mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAPFILE
#----------------------------------------------------------------
/var/swap none swap sw 0 0

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
UUID=e04e1f9c-91a4-431d-a963-bda660e6d1b6 / ext4 noatime,lazytime,rw 0 1
UUID=55e956cd-0118-47ce-9454-91c053ab781a /mnt/vhd ext4 noatime,lazytime,rw,nofail,noauto,x-systemd.automount
User avatar
Joulinar
Posts: 4783
Joined: Sat Nov 16, 2019 12:49 am

Re: Nextcloud install on external data folder fails

Post by Joulinar »

Ah I see, /mnt/recent is a CIFS/Samba mount and not a real NTFS drive. This is changing the picture completely. And for sure you will be not able to install Nextcloud on a CIFS mount as all permission will be changed to user duetpi. CIFS did not support unix permission at all. Itwould need to be a real NTFS drive or a vhd as you did now.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply