Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Do I have to balance periodically for single-ssd cache?

Featured Replies

My understanding from the help text is that balance is only required for multi-disk cache.

However, I read some other threads on the forum that (I think) suggest that balance should be run periodically in addition to trim, as a generic recommendation.

It appears to solve problem of having a false error of running out of space when there are still plenty of free space available.

 

  • Community Expert

If you only have a single drive in the cache then XFS is likely to be more stable and performance file system to use.   If you use XFS then balance operations are not applicable.

  • Author
5 hours ago, itimpi said:

If you only have a single drive in the cache then XFS is likely to be more stable and performance file system to use.   If you use XFS then balance operations are not applicable.

 

I used btrfs, remnant from the time when I wanted RAID1 for cache. :$

 

So for btrfs, do I still have to balance if only 1 disk?

  • Community Expert

It's a good idea to run a weekly balance, at least until we get to kernel 4.14, which is expected to fix this issue, it doesn't need to be a full balance, something like this:

 

btrfs balance start -dusage=75 /mnt/cache

 

I take it we just do this manually - this command isn't baked into the scheduler > SSD TRIM function?  Not a big deal, took less than 5 minutes.

 

This is the first time I'd done balance since building my machine over six weeks ago - reported relocating 64 out of 105 chunks.

 

B.

 

  • Community Expert
35 minutes ago, bbbilly05 said:

I take it we just do this manually

 

You can use the user scripts plugin to schedule it.

Great - thank you @johnnie.black.  That plug in makes it easy.  

 

Much appreciated.

  • 2 weeks later...
On 11/13/2017 at 10:26 AM, johnnie.black said:

 

You can use the user scripts plugin to schedule it.

I'm just running my first balance - it looks like I should have been doing frequently as so far it's balanced 24 out of 27 considered (469 in total).  I'm going to setup a script job as suggested - what commands do you recommend for a weekly job?

 

Has the only impact been the loss of space on my cache pool as a result of not balancing, or have I had a speed impact?  I'm guessing there's been a potential speed impact as I believe unRAID alternates which cache drive it reads from, so if a file only exists on one, I will have been a 'bit' slower??

 

Should I also setup a regular scrub job?

Edited by DZMM

  • Community Expert
1 minute ago, DZMM said:

what commands do you recommend for a weekly job?

 

btrfs balance start -dusage=75 /mnt/cache

 

2 minutes ago, DZMM said:

Has the only impact been the loss of space on my cache pool as a result of not balancing, or have I had a speed impact?

 

It doesn't cause loss of space, it can cause ENOSPC errors if the file system gets to be fully allocated.

It does have a speed impact since there's currently a bug where most or all allocated but free space is not trimmed.

 

4 minutes ago, DZMM said:

Should I also setup a regular scrub job?

If all is working well it's not really needed, but running say a monthly scrub can be good practice.

7 minutes ago, johnnie.black said:

 


btrfs balance start -dusage=75 /mnt/cache

 

Thanks - setup weekly job.  Is this in a FAQ somewhere as I haven't come across this before?

 

8 minutes ago, johnnie.black said:

It doesn't cause loss of space, it can cause ENOSPC errors if the file system gets to be fully allocated.

 

I run mover automatically at 80%, so I don't think my cache has ever been full luckily

 

9 minutes ago, johnnie.black said:

If all is working well it's not really needed, but running say a monthly scrub can be good practice.

Will do this.  I''m guessing the code is:

 

btrfs scrub start

I've been doing this manually now and then (not balancing though!), so no errors but will do a job so can forget about this.

  • Community Expert
2 minutes ago, DZMM said:

Thanks - setup weekly job.  Is this in a FAQ somewhere as I haven't come across this before?

No, this is supposed to be fixed on kernel 4.14, if it's not I'll add a FAQ entry.

Thanks - was I right with

btrfs scrub start

 

  • Community Expert
22 minutes ago, DZMM said:

Thanks - was I right with


btrfs scrub start

 

btrfs scrub start /mnt/cache

 

36 minutes ago, johnnie.black said:

btrfs scrub start /mnt/cache

 

thanks

ok balance over.  Should I be concerned by:

 

No balance found on '/mnt/cache'

or is that ok?

  • Community Expert
ok balance over.  Should I be concerned by:
 
No balance found on '/mnt/cache'

or is that ok?



That's normal, it just means that there's no balance running at the moment.
6 minutes ago, johnnie.black said:

 


That's normal, it just means that there's no balance running at the moment.

 

Thanks - the wording could be a bit better!

  • 10 months later...
On 11/13/2017 at 3:32 AM, johnnie.black said:

It's a good idea to run a weekly balance, at least until we get to kernel 4.14, which is expected to fix this issue, it doesn't need to be a full balance, something like this:

 


btrfs balance start -dusage=75 /mnt/cache

 

Resurrecting an old thread because I'm interested as to whether this issue has gone away now we are on kernel 4.18.10? I just ran balance and it did return a lot of space to my cache drive. Could that have been lingering since before the kernel change?  I've never run balance before, so perhaps it's built up over the last year or so.

 

Just wondering if I need to add balance to my maintenance schedule  with V6.6.1 and kernel 4.18.10?

  • Community Expert
1 minute ago, Lignumaqua said:

I just ran balance and it did return a lot of space to my cache drive. Could that have been lingering since before the kernel change?  I've never run balance before, so perhaps it's built up over the last year or so. 

If you never ran one it's good to run it on the newer kernel, and anyone coming from an earlier kernel, IIRC <4.16 should run a balance, after that there's no need to run regular balance to avoid the out of space errors, though it won't hurt to run one once in a while as regular maintenance.

Thank you, that’s very helpful. 

I just thought - I have 3 ssds in a 2nd 'pool' using ud.  Should I be balancing these as well?

  • Community Expert
3 hours ago, DZMM said:

I just thought - I have 3 ssds in a 2nd 'pool' using ud.  Should I be balancing these as well?

Like mentioned above with newer kernels no need for regular balances.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.