Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OC7&8] Wrong disk quota in OwnCloud (LVM) #14732

Closed
jlrag opened this issue Mar 6, 2015 · 8 comments
Closed

[OC7&8] Wrong disk quota in OwnCloud (LVM) #14732

jlrag opened this issue Mar 6, 2015 · 8 comments

Comments

@jlrag
Copy link

jlrag commented Mar 6, 2015

Hey there,

I've got multiple OwnCloud instances on my Server. The Server is partitioned with LVM.

For every new user/instance I do create a new logical volume which is mounted to the new owncloud /var/www/user folder. On every owncloud instance I do get the wrong disk quota. For example I do create a 10 GB logical volume for a new user, mount it, install new owncloud instance, but when I want to see how much free space is left I always get the maximum of the root paritition (here 32.7 GB) not the 10GB I did create with LVM.

So every one of my users do get the 32.7 GB as maximum space, not their set up 10 GB or 100 GB...

How can I change this? I want everyone to see his own maximum space.

@MorrisJobke
Copy link
Contributor

Is this related to #14298?

@jlrag
Copy link
Author

jlrag commented Mar 6, 2015

Not really, in my topic I do get the wrong maximum quota. The actual used quota is not the problem.

OwnCloud takes the maximum quota size from the root partition not from the actual partition where OC is installed on.

@MorrisJobke
Copy link
Contributor

Ah. Now I got it. Thanks for clarification.

@PVince81
Copy link
Contributor

PVince81 commented Mar 6, 2015

Yes. I believe someone asked the same question on IRC and it was the same conclusion.

However I just had a quick test.
Here is the line of code that reads the free space from disk: https://github.com/owncloud/core/blob/master/lib/private/files/storage/local.php#L224

I tried this on OC 8 and I see that the path used is in the format "$datadir/$user", for example: "/srv/www/htdocs/owncloud/data/myuser".
If your FS mount point is mounted there for the user, I'd expect PHP's disk_free_space() to return the correct value.

You could have a quick test with a separate PHP script:

<?php
   echo disk_free_space('/srv/www/htdocs/owncloud/data/myuser');

and see whether it returns the correct value.

@PVince81 PVince81 changed the title [OC7&8] Wrong disk quota in OwnCloud [OC7&8] Wrong disk quota in OwnCloud (LVM) Mar 6, 2015
@shoeper
Copy link

shoeper commented Mar 9, 2015

In my case (similiar setup)
php -r "echo disk_free_space('/srv/www/htdocs/owncloud/data/myuser')/1024/1024/1024;"
shows correct value (in GiB).

@jlrag
Copy link
Author

jlrag commented Mar 9, 2015

For me it shows the 32.7 GB, not the 10 GB from my LV.

@PVince81
Copy link
Contributor

PVince81 commented Mar 9, 2015

@jlrag so either it's a bug in PHP or the way you configured LVM (note: I'm not familiar with LVM at all) doesn't work the same as regular partitions.
What does "df -h" give in the user's folders ?

@jlrag
Copy link
Author

jlrag commented Mar 9, 2015

OK, it was my fault. A noob fault from my part. It now works, the LVM was mounted on the wrong directory. Now it shows the right disk quota, a bit less than it is, but almost the exact quota.

Thanks for your help.

@jlrag jlrag closed this as completed Mar 9, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants