advise sought on running out of space on btrfs

Having been previously traumatised by running out of free space even whilst Dolphin has quoted greater than 5GB free. I would be grateful if anyone could give some advice. Im not looking for an exact figure on free space which i understand to be difficult, but danger points for running out of free space. Concretely, can i expect to run out of space when the unallocated space goes to zero (2.65GiB in listing) or when free space goes to zero (9.78Gib in listing)?

sudo btrfs filesystem usage -h /

Overall:
Device size: 23.43GiB
Device allocated: 20.78GiB
Device unallocated: 2.65GiB
Device missing: 0.00B
Used: 13.36GiB
Free (estimated): 9.78GiB (min: 9.78GiB)
Data ratio: 1.00
Metadata ratio: 1.00
Global reserve: 176.00MiB (used: 0.00B)

Data,single: Size:20.00GiB, Used:12.87GiB
/dev/sda6 20.00GiB

Metadata,single: Size:768.00MiB, Used:502.14MiB
/dev/sda6 768.00MiB

System,single: Size:32.00MiB, Used:16.00KiB
/dev/sda6 32.00MiB

Unallocated:
/dev/sda6 2.65GiB

Hi
Just configure snapshots and run the snapper cleanup and btrfs balance cron jobs manually…?

Edit /etc/snapper/configs/root to something lower than the defaults in NUMBER, I use;


# limit for number cleanup
NUMBER_MIN_AGE="1800"
NUMBER_LIMIT="2-3"
NUMBER_LIMIT_IMPORTANT="4-5

Then manually run;


/etc/cron.daily/suse.de-snapper
/etc/cron.weekly/btrfs-balance

But in answer to your question, Device Unallocated AFAIK would be the tipping point, that being said, reduce snapper requirements or disable and run the cron jobs and things should balance out for you.

23 gig is a bit slim for snapper to work. The recommended size is 40 gig. Seriously reduce the number and frequency of snapshots or disable snapper

Hi
It is workable with tumbleweed, I would however recommend the OP cleans up before a zypper dup, but having snapper present for at least a few snapshots are worth it to rollback (I’ve used it a couple of times lately when I broke things :wink: ) if needed.

Yes but it is tight for TW since there are so many large updates you have a constant maintenance problem. Either give it room or turn it off. Yes roll back is great for TW but running on the edge of memory usage is not good either.

Thanks for the advice on snapper (which i keep an eye on), but in this case it is not the major problem.
The problem appears to be the cron weekly job for btrfs balance is not running, there are no journal entries.
I suspect the job is being missed on laptop due to sleep etc? but do not know enough about cron scheduling logic.

I placed the job link in cron hourly to check, and it did in fact run.


# sudo journalctl | egrep "btrfs-balance"

Aug 24 08:15:01 asus run-crons[25864]: **btrfs-balance** returned 1

(before checking the above cron job) i had performed a manual balance, my unallocated space is now close to free space.


# sudo btrfs balance start -dusage=90 / 
# sudo btrfs filesystem usage -h /         
Overall: 
   Device size:                  23.43GiB 
   Device allocated:             13.78GiB 
   **Device unallocated:            9.65GiB **
   Device missing:                  0.00B 
   Used:                         12.51GiB 
   **Free (estimated):             10.57GiB**      (min: 10.57GiB)  

snapper mods it initial behaviour based on the size of the root partition. 23 gig is truly marginal. At some where around 10 gig it is not used at all. But adding more snapshots will not help your out of space problems at all.

On Wed 24 Aug 2016 07:06:01 AM CDT, ndc33 wrote:

Thanks for the advice on snapper (which i keep an eye on), but in this
case it is not the major problem.
The problem appears to be the cron weekly job for btrfs balance is not
running, there are no journal entries.
I suspect the job is being missed on laptop due to sleep etc? but do not
know enough about cron scheduling logic.

<snip>

Hi
Then look at setting a daily time when the laptop is likely to be in
use and perhaps reduce the max days period. Fire up YaST -> System
-> /etc/sysconfig Editor and under Other -> etc -> sysconfig -> cron
are the options, see the comments.

There are also options to tweak the btrfs maintenance under System ->
File systems -> btrfs which you may wish to tweak for your setup.

Bit like a car manufacturer flashing the warning light to get an oil
change, it’s up to you when to decide to take it for the oil
change… :wink:

It is meant to run the cron jobs after 15 minutes of booting, but I
suspect it’s the max days settings, or you snapshots not being cleaned
out.


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.1|GNOME 3.16.2|4.1.27-27-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!