On Sat, Oct 27, 2018 at 02:12:02PM -0400, Remi Gauvin wrote:
> On 2018-10-27 01:42 PM, Marc MERLIN wrote:
>
> >
> > I've been using btrfs for a long time now but I've never had a
> > filesystem where I had 15GB apparently unusable (7%) after a balance.
> >
>
> The space isn't unusable. It's just allocated.. (It's used in the sense
> that it's reserved for data chunks.). Start writing data to the drive,
> and the data will fill that space before more gets allocated.. (Unless
> you are using an older kernel and the filesystem gets mounted with ssd
> option, in which case, you'll want to add nossd option to prevent that
> behaviour.)
>
> You can use btrfs fi usage to display that more clearly.
Got it. I have disk space free alerts based on df, which I know doesn't
mean that much on btrfs. Maybe I'll just need to change that alert code
to make it btrfs aware.
> > I can try a defrag next, but since I have COW for snapshots, it's not
> > going to help much, correct?
>
> The defrag will end up using more space, as the fragmented parts of
> files will get duplicated. That being said, if you have the luxury to
> defrag *before* taking new snapshots, that would be the time to do it.
Thanks for confirming. Because I always have snapshots for btrfs
send/receive, defrag will duplicate as you say, but once the older
snapshots get freed up, the duplicate blocks should go away, correct?
Back to usage, thanks for pointing out that command:
saruman:/mnt/btrfs_pool1# btrfs fi usage .
Overall:
Device size: 228.67GiB
Device allocated: 203.54GiB
Device unallocated: 25.13GiB
Device missing: 0.00B
Used: 192.01GiB
Free (estimated): 32.44GiB (min: 19.88GiB)
Data ratio: 1.00
Metadata ratio: 2.00
Global reserve: 512.00MiB (used: 0.00B)
Data,single: Size:192.48GiB, Used:185.16GiB
/dev/mapper/pool1 192.48GiB
Metadata,DUP: Size:5.50GiB, Used:3.42GiB
/dev/mapper/pool1 11.00GiB
System,DUP: Size:32.00MiB, Used:48.00KiB
/dev/mapper/pool1 64.00MiB
Unallocated:
/dev/mapper/pool1 25.13GiB
I'm still seing that I'm using 192GB, but 203GB allocated.
Do I have 25GB usable:
Device unallocated: 25.13GiB
Or 35GB usable?
Device size: 228.67GiB
-
Used: 192.01GiB
= 36GB ?
Yes I know that I shouldn't get close to filling up the device, just
trying to clear up if I should stay below 25GB or below 35GB
Thanks,
Marc
--
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
.... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/ | PGP 7F55D5F27AAF9D08