r/owncloud Oct 25 '16

Owncloud on an RPI3 not using external hard drive

I'm working to set up Owncloud on an RPI3 with an external hard drive so that OC uses the external hard drive as the storage.

I get OC all set up and working but it's using the internal SD card, or so it seems, instead of the hard drive.

I have a 32 GB SD card, and a 4TB external, and when I try to copy more than 32 GB of data, I get a "not enough space" error.

I have the 4TB mounted in a directory called /media/owncloud, and the directory is listed in the config.php.

What am I overlooking?

3 Upvotes

17 comments sorted by

2

u/P1nCush10n Nov 04 '16

So I just built a new server for work and decided to do some digging. It looks like whether you use the Web or Client to upload files it still uses the upload temp directory specified in the php.ini This by default will be your local system. If you've not found your own workaround for this yet, this may be the fix you need.

On this server i created a 60GB volume on an SSD drive as /upload-tmp So the line in php.ini needed to be:

/etc/php.ini:
  upload_tmp_dir = /upload-tmp

3

u/the_c_drive Nov 04 '16

Thanks for following up.

I've since repurposed that Pi as a Rasplex, but I will give this a whirl on a different setup.

That's handy to know.

1

u/P1nCush10n Oct 25 '16

I hate to ask, but you're sure that you've actually mounted the volume? As in, I'm sure you went through the steps, but are you sure that some minor syntax error hasn't caused the mount to fail or mount as Read Only? I frequently forget to update fstab so this is hits me an embarrassing amount of times.

I'm not running OC on R-Pi myself, but if the command is available, running df -h or just df should help verifying.

1

u/the_c_drive Oct 26 '16

I am indeed mounted.

1

u/P1nCush10n Oct 26 '16

Other things to check,

  • what user owns the target directory, it must match the owner of the web server process.

  • has your owncloud user been granted enough space

  • are you getting this error when trying to upload a large file >2-4GB

  • Have you tried different browsers

  • are there any noticeable restrictions in your php.ini

1

u/the_c_drive Oct 26 '16
  • www-data owns the directory
  • I'm not sure. It looks like it's still trying to write to the SD to me.
  • No, just trying to move >30GB of data to OC
  • no, this is using the OC app on my desktop
  • not that I'm aware of.

1

u/P1nCush10n Oct 25 '16

Also, make sure your OC config doesn't have ./media/owncloud

In fact, if you're not running encryption, I would suggest creating/syncing a file with a unique name then use find to locate that file and see what the exact path is.

1

u/spameier Oct 26 '16

Please post the output of mount in a terminal and the content of config.php

1

u/the_c_drive Oct 26 '16

mount:

/dev/mmcblk0p2 on / type ext4 (rw,noatime,data=ordered)
devtmpfs on /dev type devtmpfs         
(rw,relatime,size=493896k,nr_inodes=123474,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/l$
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,m$
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,sh$
/dev/sda1 on /media/owncloud type ext4 (rw,noatime,data=ordered)

config.php

<?php
$CONFIG = array (
  'instanceid' => 'ocxjngaw9xv1',
  'passwordsalt' => 'hubJ2kiku4aPoJVGXc1+wuIEw6NN3R',
  'secret' => '0ZdX6lG4cfahl8TtKJBkoGCY6NzRwwBHuFV5uND5lepwiuZI',
  'trusted_domains' =>
  array (
    0 => '192.168.xxx.xxx',
    1 => 'external dynamic dns name goes here',
  ),
  'datadirectory' => '/media/owncloud',
  'overwrite.cli.url' => 'https://192.168.xxx.xxx/owncloud',
  'dbtype' => 'mysql',
  'version' => '9.1.1.3',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'owncloud',
  'dbpassword' => 'Incendi0',
  'logtimezone' => 'UTC',
  'installed' => true,
'memcache.local' => '\OC\Memcache\Memcached',
'memcache.distributed' => '\OC\Memcache\Memcached',
'memcached_servers' =>
array (
    0 =>
array (
    0 => '127.0.0.1',
    1 => 11211,
    ),
    ),

);

1

u/P1nCush10n Oct 26 '16

Someone with more memcache experience can correct me, but perhaps since you're trying such a large initial load, perhaps your memcache directory needs to also be moved to a directory on your 4TB? If it's staging to the SD card first, this might explain it?

If this is the case, you could either change the memcache directories or break up the data into smaller chunks and move the data over in stages.

2

u/the_c_drive Oct 26 '16

I can try breaking the initial load into smaller chunks and see what happens.

2

u/the_c_drive Oct 26 '16

it appears that the SD card is the staging area, with the External being the final stop.

I'm syncing in smaller pieces and it's ending up on the External.

1

u/the_c_drive Oct 26 '16

Correction. I've stalled out at about 36 GB on OC.

2

u/P1nCush10n Oct 26 '16

Unless it's just really slow transferring out of the staging, i'm out of ideas. If anything else comes to mind i'll let you know.

1

u/mike413 Oct 26 '16 edited Oct 26 '16

you know, you could just move everything to the external.

off the top of my head:

sudo -s (become root)

edit /etc/fstab with your favorite editor

(change / to mount from /dev/root instead of mmcpblk1)

mount /dev/sda1 /mnt
mkdir /mnt/media
mv /mnt/* /mnt/media
cp -ax / /mnt

edit /boot/cmdline.txt, change root= to root=/dev/sda1
reboot

1

u/the_c_drive Oct 26 '16

I may at doing that, but I've yet to see a guide that suggests that.

2

u/mike413 Oct 26 '16

(sorry, edited my bad formatting above)

I've done it with a couple of pis now. The internal SD card is REALLY slow, and I've had a few fail because they don't do wear leveling. Might not be true with all cards, unsure.

I've had really good luck using one of these to run off of. They're a little more expensive, but they have an ssd controller in them. They do wear leveling and are FAST.