Skip to contentSkip to conversation

btrfs balance resume + raid5/6

DISCUSSION Tim Castle 2 participants 2 messages Jun 16, 2013 – Jun 22, 2013 Btrfs file system

lore
Share & tools
lore

Tim Castle

author
#0 lore raw

Greetings!

I'm testing raid6, and recently added two drives.
I haven't been able to properly resume a balance operation: the number of total chunks is always too low.

It seems that the balance starts and pauses properly, but always resumes with ~7 chunks.

Here's an example:

vendikar tim # uname -r
3.10.0-031000rc4-generic
vendikar tim # btrfs fi sho
Label: 'bank' uuid: 682bd1f5-1bd3-479b-8882-867dfe32375f

	Total devices 7 FS bytes used 4.70TB
	devid    4 size 1.82TB used 1.44TB path /dev/dm-9
	devid    1 size 2.73TB used 1.44TB path /dev/dm-8
	devid    5 size 2.73TB used 1.44TB path /dev/dm-7
	devid    6 size 931.51GB used 207.00GB path /dev/dm-6
	devid    2 size 2.73TB used 1.44TB path /dev/dm-5
	devid    3 size 2.73TB used 1.44TB path /dev/dm-4
	devid    7 size 931.51GB used 207.00GB path /dev/dm-3

Btrfs v0.20-rc1-324-g650e656
vendikar tim # btrfs fi df bank/
Data, RAID6: total=4.71TB, used=4.69TB
System, RAID1: total=32.00MB, used=376.00KB
System: total=4.00MB, used=0.00
Metadata, RAID1: total=8.00GB, used=6.54GB

vendikar tim # btrfs balance start bank/
vendikar tim # btrfs balance status bank/
Balance on 'bank/' is running
3 out of about 1479 chunks balanced (4 considered), 100% left

vendikar tim # btrfs balance pause bank/
vendikar tim # btrfs balance status bank/
Balance on 'bank/' is paused
4 out of about 1479 chunks balanced (4 considered), 100% left

vendikar tim # btrfs balance resume bank
vendikar tim # btrfs balance status bank/
Balance on 'bank/' is running
1 out of about 4 chunks balanced (5 considered), 75% left

All the best,
Tim

#1 lore raw
Quoted 8 lines · Tim Castle

Greetings!

I'm testing raid6, and recently added two drives.
I haven't been able to properly resume a balance operation: the number of total chunks is always too low.

It seems that the balance starts and pauses properly, but always resumes with ~7 chunks.

Hi Tim,

This is the expected behaviour. Balance does not actually remember which chunks it had processed before it was paused, instead it uses a heuristic which is based on the amount of space used out of each chunk. As you have an almost full filesystem, all of your chunks, except for those ~7, are fully (or almost fully) used, and balance resume simply skips them. If you really want to balance everything (why?) you would have to run balance to completion, w/o pausing it.

Thanks,

Ilya