Adding a new device to a btrfs volume, but the available size is hardly growing
11,451
Thanks for your answers. I am computing the answer from the various responses I got here and on the btrfs mailing-list.
- My new 500G aren't showing because they cannot be used initially.
- I need to balance the data on the three partitions:
btrfs filesystem balance /samples
- Using two partitions on the same disk (/dev/sdc1 and /dev/sdc6) is not optimal at all because they will spend time seeking between the two partitions. In that case, a better option is to use 'single', where the partitions are filled one after the other (no striping). With new btrfs tools, this is possible using this command:
btrfs balance start -dconvert=single,soft /samples
- On Debian/Ubuntu hosts, the newest btrfs tools which support balance conversion are usually not available in packaged format and need to be compiled from source.
Thanks again for your answers.
Related videos on Youtube
Author by
user1381
Updated on September 15, 2022Comments
-
user1381 almost 2 years
I have a btrfs volume which already consists of two different devices and which is mounted on /samples. Its total size is 194GB as reported by
df
.$ df -h Filesystem Size Used Avail Use% Mounted on ... /dev/sdc1 194G 165G 20G 90% /samples
Now, I would like to add another 500GB to that volume, from another device. I did
$ sudo mkfs.btrfs -m raid0 -d raid0 /dev/sdb $ sudo btrfs device add /dev/sdb /samples
My filesystem now correctly reports:
$ sudo btrfs filesystem show Label: none uuid: 545e95c6-d347-4a8c-8a49-38b9f9cb9add Total devices 3 FS bytes used 161.98GB devid 3 size 465.76GB used 0.00 path /dev/sdb devid 2 size 93.13GB used 84.51GB path /dev/sdc1 devid 1 size 100.61GB used 84.53GB path /dev/sdc6
But I miss some space when I do:
$ df -h Filesystem Size Used Avail Use% Mounted on ... /dev/sdc1 660G 165G 43G 80% /samples
I added 500GB! Why haven't I got more available??
To debug, I ran this command:
$ sudo btrfs filesystem df /samples Data, RAID0: total=162.00GB, used=159.79GB Data: total=8.00MB, used=7.48MB System, RAID1: total=8.00MB, used=24.00KB System: total=4.00MB, used=0.00 Metadata, RAID1: total=3.50GB, used=2.19GB Metadata: total=8.00MB, used=0.00
My data is in RAID0, that's ok. So where have my 500GB gone, and how can I fix this?
Thanks
-
user1381To my understanding, balance will spread the data evenly on the 3 devices. But my issue here is not really spreading the data, but rather the amount of available size df -h reports. I added 465.76G, but I only see 43G available (though I haven't added any data yet). Where are the 465G gone?
-
konrad.kruczynskiYou can balance the filesystem using btrfs filesystem balance /samples. Btw, there was no reason to issue sudo mkfs.btrfs -m raid0 -d raid0 /dev/sdb on the to-be-added device.
-