How to free space on server disk through deleting files when owncloud cannot run due to lack of space


I'm running owncloud server on Ubuntu 16.04.2 LTS. I have come to a situation where I only have 16MB of free space and cannot access the web interface of owncloud due to lack of space for proper webserver and database operation. I have deleted extra versions using occ versions:cleanup and emptied trashbin with trashbin:cleanup. Still that space was immediately used again when I tried to login via the web interface. Currently I cannot login into the web interface, in order to delete some files and free up space, because the database doesn't have enough space to work, so it seems I'm stuck. Also the database is taking 1.5GB which I find quite strange, specifically a single file is taking 1.3GB:

1,3G /var/lib/mysql/owncloud/oc_authtoken.ibd

From what I read I shouldn't manually delete files from the data directory.

So my two questions are:
1 - How can I delete files stored with owncloud without access to the web interface in order to be able to finally use the web interface ?
2 - What could be the reason for a single database file to take so much space ?

Miguel Negrão

  1. Access your owncloud/data folder via shell and delete the files manually.

  2. I am not sure about the database maybe somebody else can step in @kljhlkhglklfgh ?

But then won't the database be out of sync with the data folder ? Would running occ files:scan -all be enough to resync the database ?

yupp you are correct!

Deleted some files and ran files:scan, at that point I had 1,7G free. When I try go log in the web interface, I see a rotating circle on the login page, and I can see the file /var/lib/mysql/owncloud/oc_authtoken.ibd continuously growing. For 1 login attempt it went from 1.7GB to 2.5GB, then I stopped the page. There seems to be some issue with owncloud. Could this be a bug ? How to troubleshoot this issue ?

The increase in file size of the database could also be due to an android calendar app communicating with the server.

Could you please provide a full issue template like here: (and remember to remove your secrets?)

Should I post it here or in github ?

github preferably, then a broader audience can take a look. Feel free to link it here!

Here is the issue:

In the mean time what are my options to recover from this ? I don't mind losing everything except the calendar data...

You could try clearing trash first: occ trashbin:cleanup and then all versions: occ versions:cleanup.

It only works if the PHP code of OC is still able to boot up though.

Then you could temporarily disable the trashbin: occ app:disable files_trashbin and do some major cleanup of your files in the web UI or other (deleting is direct, no trashbin). Then enable trashbin again.

1 Like