Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Incorrect used/available through df #1636

Open
rsclarke opened this issue Jun 23, 2018 · 2 comments
Open

Incorrect used/available through df #1636

rsclarke opened this issue Jun 23, 2018 · 2 comments

Comments

@rsclarke
Copy link

I have been experimenting with @borgbackup on kbfs. Previously I have been able to initialise a repository in my private folder:

borg init --encryption=keyfile-blake2 --storage-quota=200G /keybase/private/rsclarke/backup

create an archive:

function create_backup(){
    borg create -v --progress --stats ${@:2}    \
    $1::'{hostname}-{now:%Y-%m-%d}'             \
    /home/rc                                    \
    --exclude 're:^/home/rc/\.\w+\b(?<!\bssh)'  \
    --exclude '/home/rc/Downloads'              \
    --exclude '/home/rc/rpmbuild'               
}

prune:

function prune_backup(){
    borg prune -v --list ${@:2} $1 --prefix '{hostname}-' \
        --keep-daily=7 --keep-weekly=4 --keep-monthly=6
}

and subsequently delete the repository with borg delete /keybase/private/rsclarke/backup.

When performing a df -h on the KBFS mount it incorrectly reports the used and available sizes:

[rc@xps ~]$ df -h /run/user/1000/keybase/kbfs
Filesystem      Size  Used Avail Use% Mounted on
/dev/fuse       250G -8.0Z  -16E 100% /run/user/1000/keybase/kbfs

Previously I have seen the correct used/available reported.

An extract of .kbfs_status is below which shows a negative UsageBytes and RemoteUsedBytes, whether this has a relation to the output of df above? Should it be negative?

[rc@xps ~]$ cat /run/user/1000/keybase/kbfs/.kbfs_status
{
  "CurrentUser": "rsclarke",
  "IsConnected": true,
  "UsageBytes": -149711195,
  "LimitBytes": 268435456000,
...
   "DiskLimiterStatus": {
      "Type": "BackpressureDiskLimiter",
      "CurrentDelaySec": 0,
      "JournalTrackerStatus": {
        "ByteStatus": {
          "UsedFrac": 0,
          "DelayScale": 0,
          "MinThreshold": 0.5,
          "MaxThreshold": 0.95,
          "LimitFrac": 0.85,
          "Limit": 182536110080,
          "Used": 0,
          "Free": 401472647168,
          "Max": 182536110080,
          "Count": 182536110080
        },
        "FileStatus": {
          "UsedFrac": 0,
          "DelayScale": 0,
          "MinThreshold": 0.5,
          "MaxThreshold": 0.95,
          "LimitFrac": 0.85,
          "Limit": 5100000,
          "Used": 0,
          "Free": 27304834,
          "Max": 5100000,
          "Count": 5100000
        },
        "QuotaStatus": {
          "UsedFrac": -0.0005577176623046398,
          "DelayScale": 0,
          "MinThreshold": 1,
          "MaxThreshold": 1.2,
          "UnflushedBytes": 0,
          "RemoteUsedBytes": -149711195,
          "QuotaBytes": 268435456000
        }
      },
      "DiskCacheByteStatus": {
        "UsedFrac": 0.0003422304056584835,
        "DelayScale": 0,
        "MinThreshold": 1,
        "MaxThreshold": 1,
        "LimitFrac": 0.1,
        "Limit": 21474836480,
        "Used": 7349342,
        "Free": 401472647168,
        "Max": 21474836480,
        "Count": 21467487138
      },
      "SyncCacheByteStatus": {
        "UsedFrac": 0,
        "DelayScale": 0,
        "MinThreshold": 1,
        "MaxThreshold": 1,
        "LimitFrac": 0.1,
        "Limit": 21474836480,
        "Used": 0,
        "Free": 401472647168,
        "Max": 21474836480,
        "Count": 21474836480
      }
    }
  },
...

An attempt to create a repository again with borg will report insufficient free space:

[rc@xps ~]$ borg init --encryption=keyfile-blake2 --storage-quota=200G /keybase/private/rsclarke/backup
Enter new passphrase: 
Enter same passphrase again: 
Do you want your passphrase to be displayed for verification? [yN]: n
Not enough free space to initialize repository at this location.
Insufficient free space to complete transaction (required: 169.14 kB, available: -18.45 EB).

I am able to still able write files to the private folder.

@strib
Copy link
Contributor

strib commented Jun 23, 2018

Sorry about this, I've seen bugs with negative quotas before, probably some bug on our servers we haven't worked out yet.

Have you tried putting 150 MB into the folder (so you get back above 0) and see if that fixes things for borg? Some day we'll figure out the quota bug but probably won't get to it soon.

@rsclarke
Copy link
Author

Can confirm, dropping files in the folder to take the usage >0 has allowed for borg to create the repository again.

[rc@xps ~]$ cat /run/user/1000/keybase/kbfs/.kbfs_status
{
  "CurrentUser": "rsclarke",
  "IsConnected": true,
  "UsageBytes": 76305549,
  "LimitBytes": 268435456000,

Additionally, df is reporting the correct values also.

[rc@xps ~]$ df -h /run/user/1000/keybase/kbfs
Filesystem      Size  Used Avail Use% Mounted on
/dev/fuse       250G   71M  250G   1% /run/user/1000/keybase/kbfs

Thanks @strib

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants