All of lore.kernel.org
 help / color / mirror / Atom feed
* btrfs fi usage -T shows unallocated column as total in drive, not total available to btrfs
@ 2018-12-24 17:21 joshua
  2018-12-27  0:36 ` Chris Murphy
  0 siblings, 1 reply; 8+ messages in thread
From: joshua @ 2018-12-24 17:21 UTC (permalink / raw)
  To: Btrfs BTRFS

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-12-28  4:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-24 17:21 btrfs fi usage -T shows unallocated column as total in drive, not total available to btrfs joshua
2018-12-27  0:36 ` Chris Murphy
2018-12-27  7:12   ` Duncan
2018-12-27 20:06     ` Chris Murphy
2018-12-27 20:07       ` Chris Murphy
2018-12-27 20:33     ` joshua
2018-12-27 23:37       ` Chris Murphy
2018-12-28  4:09         ` Duncan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.