I generally use this command to check my drive usage: `btrfs fi usage -T /mnt/data` But this time
it didn't give me useful information:
I decided to begin replacing a few of my drives with larger drives, so I could remove a lot of my
smaller drives. I ran this command:
Overall:
Device size: 67.31TiB
Device allocated: 41.73TiB
Device unallocated: 25.58TiB
Device missing: 0.00B
Used: 41.69TiB
Free (estimated): 12.81TiB (min: 12.81TiB)
Data ratio: 2.00
Metadata ratio: 2.00
Global reserve: 512.00MiB (used: 0.00B)
Data Metadata System
Id Path RAID1 RAID1 RAID1 Unallocated
-- -------- -------- -------- -------- -----------
4 /dev/sda 2.57TiB 3.00GiB - 164.52GiB
{-snip-}
I then started the replace with this command: `btrfs replace start 4 /dev/sdu /mnt/data`
Everything went well, so I checked again:
root@CENTAUR:~# btrfs fi usage -T /mnt/data
Overall:
Device size: 67.31TiB
Device allocated: 41.73TiB
Device unallocated: 25.58TiB
Device missing: 0.00B
Used: 41.69TiB
Free (estimated): 12.81TiB (min: 12.81TiB)
Data ratio: 2.00
Metadata ratio: 2.00
Global reserve: 512.00MiB (used: 0.00B)
Data Metadata System
Id Path RAID1 RAID1 RAID1 Unallocated
-- -------- -------- -------- -------- -----------
4 /dev/sdu 2.57TiB 3.00GiB - 6.53TiB
{-snip-}
For a brief moment I was confused, and ran this command to double-check:
root@CENTAUR:~# btrfs fi sh
Label: 'DATA' uuid: ddafe51b-e1e8-4f4b-bcca-057f53b59a8d
Total devices 17 FS bytes used 20.84TiB
{-snip-}
devid 4 size 2.73TiB used 2.57TiB path /dev/sdu
{-snip-}
Oh right, I have to run resize! So I run resize, and everything works exactly as expected.
However, shouldn't `btrfs fi usage -T` only report the usable space in the unallocated column?
`btrfs fi sh` only reports the available space correctly.
Perhaps there is a reason for this behavior? If not, it's a little confusing, and should really be
brought into line with `btrfs fi sh` IMO.
For reference, here is what I ran afterwards:
root@CENTAUR:~# btrfs fi resize 4:max /mnt/data
Resize '/mnt/data' of '4:max'
root@CENTAUR:~# btrfs fi sh
Label: 'DATA' uuid: ddafe51b-e1e8-4f4b-bcca-057f53b59a8d
Total devices 17 FS bytes used 20.84TiB
{-snip-}
devid 4 size 9.10TiB used 2.57TiB path /dev/sdu
{-snip-}
root@CENTAUR:~# btrfs fi usage -T /mnt/data
Overall:
Device size: 73.68TiB
Device allocated: 41.73TiB
Device unallocated: 31.95TiB
Device missing: 0.00B
Used: 41.69TiB
Free (estimated): 15.99TiB (min: 15.99TiB)
Data ratio: 2.00
Metadata ratio: 2.00
Global reserve: 512.00MiB (used: 0.00B)
Data Metadata System
Id Path RAID1 RAID1 RAID1 Unallocated
-- -------- -------- -------- -------- -----------
4 /dev/sdu 2.57TiB 3.00GiB - 6.53TiB
{-snip-}
So everything is as I expect it to be afterwards- All ready to begin removing multiple drives.