Incorrect free space

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
deejay01
Newbie
Newbie
Posts: 9
Joined: September 17th, 2016, 9:29 pm

Incorrect free space

Post by deejay01 »

I have sabnzbd version 2.1.0 running on a raspberry pi. Downloads automatically pause when the size is greater than the free space, which is fair enough, but a problem arises when the calculated free space doesn't match the actual free space. sabnzbd is saying that I have 700MB free space whereas the actual figure is about 60GB. So the question becomes how does it calculate its free space value?

Thanks in advance...
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Incorrect free space

Post by safihre »

It does a basic request to the system service statvfs.
What is the output when you run that command on the command line?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
deejay01
Newbie
Newbie
Posts: 9
Joined: September 17th, 2016, 9:29 pm

Re: Incorrect free space

Post by deejay01 »

Does this help?

Code: Select all

#!/usr/bin/python
import os
print os.statvfs("/media/pi/SANDISK128");

posix.statvfs_result(f_bsize=4096, f_frsize=4096, f_blocks=1278529L, f_bfree=247545L, f_bavail=176838L, f_files=333248L, f_ffree=203806L, f_favail=203806L, f_flag=1024, f_namemax=55)
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Incorrect free space

Post by safihre »

We use f_bavail*f_bsize, where f_bavail=available blocks to the user and f_bsize=block size.
If I do that calculation on the data you provided it comes to 687MB. So maybe it's a permission issue?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
.maxx
Release Testers
Release Testers
Posts: 70
Joined: April 10th, 2008, 6:32 am

Re: Incorrect free space

Post by .maxx »

Same problem here.
  • The 'complete' folder is on my NAS which has 4,xTB of free Space.
  • My Mac shows me 4,xTB of free space.
  • SAB 2.1.0 shows me 196GB of free space.
I've changed the folder to an other one, but still the same.
The permission in SAB is at 777.

Image

Image

Image
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Incorrect free space

Post by safihre »

Unfortunately, nothing we can do. This is what the OS is reporting to us. Maybe it's some permissions issue or some other network related problem that it's getting wrong information.
We just don't have another way to read it than using the system functions..
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Incorrect free space

Post by safihre »

Maybe you can also run on the command line the same commands in python as above, and post what it outputs? (but with the path to your NAS of course)
Maybe we can diagnose!
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
.maxx
Release Testers
Release Testers
Posts: 70
Joined: April 10th, 2008, 6:32 am

Re: Incorrect free space

Post by .maxx »

Sorry but I don't know how to use the statvfs command on macOS.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Incorrect free space

Post by sander »

.maxx wrote: June 27th, 2017, 3:21 am Sorry but I don't know how to use the statvfs command on macOS.
Do you know how to open a terminal / command prompt, and run python?

If so, run this, and post the output here

Code: Select all

python -c "import os; print os.statvfs('/home/me/');"
Example from my Linux:

Code: Select all

$ python -c "import os; print os.statvfs('/home/sander/');"
posix.statvfs_result(f_bsize=4096, f_frsize=4096, f_blocks=3916268L, f_bfree=509852L, f_bavail=305155L, f_files=1003680L, f_ffree=564690L, f_favail=564690L, f_flag=4096, f_namemax=255)
.maxx
Release Testers
Release Testers
Posts: 70
Joined: April 10th, 2008, 6:32 am

Re: Incorrect free space

Post by .maxx »

Do you know how to open a terminal / command prompt, and run python?

If so, run this, and post the output here

Code: Select all

python -c "import os; print os.statvfs('/home/me/');"
Thanks got it:

Code: Select all

posix.statvfs_result(f_bsize=1048576, f_frsize=1024, f_blocks=2332848292, f_bfree=153868548, f_bavail=153868548, f_files=2332848290, f_ffree=153868548, f_favail=153868548, f_flag=2, f_namemax=255)
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Incorrect free space

Post by sander »

Code: Select all

posix.statvfs_result(
f_bsize=1048576, 
f_frsize=1024, 
f_blocks=2332848292, 
f_bfree=153868548, 
f_bavail=153868548, 
f_files=2332848290, 
f_ffree=153868548, 
f_favail=153868548, 
f_flag=2, 
f_namemax=255)
OK, good: no negative or strange values reported.

Can you also post the disk path you used in your command?

This is how sabnzbd calcutates:

Code: Select all

                s = os.statvfs(_dir)
                if s.f_blocks < 0:
                    disk_size = float(sys.maxint) * float(s.f_frsize)
                else:
                    disk_size = float(s.f_blocks) * float(s.f_frsize)
                if s.f_bavail < 0:
                    available = float(sys.maxint) * float(s.f_frsize)
                else:
                    available = float(s.f_bavail) * float(s.f_frsize)
                return disk_size / GIGI, available / GIGI
So
disk_size = float(s.f_blocks) * float(s.f_frsize) = 2332848292 * 1024 = 2224 GigiB

available = float(s.f_bavail) * float(s.f_frsize) = 153868548 * 1024 = 146 GigiB

Hmmm ... does that match what you reported what SAB was telling? Was the python run against the NAS path?
.maxx
Release Testers
Release Testers
Posts: 70
Joined: April 10th, 2008, 6:32 am

Re: Incorrect free space

Post by .maxx »

Hi sander,

I used that command:

Code: Select all

python -c "import os; print os.statvfs('/Volumes/Medien/');"
The macOS Finder (10.12.5) tells me that my Synology NAS got:
  • 28,78TB of capacity
  • 4,65TB of free space
  • I mount it correctly via SMB and it shows up in /Volumes
  • I restarted the NAS and my Mac several times
  • I did a fresh SAB install
  • SAB still tells me that I now only got 235,5GB (deleted some today)
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Incorrect free space

Post by sander »

Strange.

What is the output of:

Code: Select all

df -h

Code: Select all

dh -h /Volumes/Medien/

Code: Select all

df -h /Users
.maxx
Release Testers
Release Testers
Posts: 70
Joined: April 10th, 2008, 6:32 am

Re: Incorrect free space

Post by .maxx »

df -h

Code: Select all

Filesystem                      Size   Used  Avail Capacity     iused      ifree %iused  Mounted on
/dev/disk0s2                   465Gi   40Gi  425Gi     9%     1289380 4293677899    0%   /
devfs                          180Ki  180Ki    0Bi   100%         626          0  100%   /dev
map -hosts                       0Bi    0Bi    0Bi   100%           0          0  100%   /net
map auto_home                    0Bi    0Bi    0Bi   100%           0          0  100%   /home
//[email protected]/Medien      26Ti   22Ti  4.2Ti    84% 23560704746 4541947320   84%   /Volumes/Medien
//[email protected]/Dokumente   26Ti   22Ti  4.2Ti    84% 23560704746 4541947320   84%   /Volumes/Dokumente
df -h /Volumes/Medien/

Code: Select all

Filesystem                   Size   Used  Avail Capacity     iused      ifree %iused  Mounted on
//[email protected]/Medien   26Ti   22Ti  4.2Ti    84% 23560704746 4541947320   84%   /Volumes/Medien
df -h /Users

Code: Select all

Filesystem     Size   Used  Avail Capacity iused      ifree %iused  Mounted on
/dev/disk0s2  465Gi   40Gi  425Gi     9% 1289383 4293677896    0%   /
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Incorrect free space

Post by sander »

Aha. We don't understand what is going on ... is statvfs() wrong (it is depcreceated, after all)? Are we calculating wrong? Is your disk size too big for statvfs()? Do you have quota enabled?

So we have to think about this. The problem is we can't reproduce it.
Post Reply