How to recover from system going read-only after "no space left"?
Edit: It appears I was stuck because every time I tried to mount a balance that I had tried restarted which locked the drive because it didn't have enough room to proceed. I solved this by unmounting, then remounting with -o skip_balance. From there I deleted a file and then added a device and rebalanced to get some breathing room.
Just created a new BTRFS volume comprised of a 1TB and 2TB drive in RAID1 for both metadata and data. It has no snapshots and 7 subvolumes, some directories are compressed but not most.
From what I can tell it went read-only because I filled it. I don't know how to actually fix that though because when it's read-only I can't free up space on it.
sudo dmesg | grep -i btrfs:
[102895.930974] BTRFS: error (device sdi1 state A) in btrfs_run_delayed_refs:2247: errno=-28 No space left
[102895.930978] BTRFS info (device sdi1 state EA): forced readonly
[102895.931491] BTRFS info (device sdi1 state EA): 2 enospc errors during balance
[102895.931495] BTRFS info (device sdi1 state EA): balance: ended with status: -30
sudo btrfs fi show /mnt/betterStorage/:
Label: 'BetterStorage' uuid: 79f9a7ca-e97b-461c-9123-c62b39b52661
Total devices 2 FS bytes used 930.59GiB
devid 1 size 1.82TiB used 931.51GiB path /dev/sdi1
devid 2 size 931.51GiB used 931.51GiB path /dev/sda1
sudo btrfs device stats /mnt/betterStorage/:
[/dev/sdi1].write_io_errs 0
[/dev/sdi1].read_io_errs 0
[/dev/sdi1].flush_io_errs 0
[/dev/sdi1].corruption_errs 0
[/dev/sdi1].generation_errs 0
[/dev/sda1].write_io_errs 0
[/dev/sda1].read_io_errs 0
[/dev/sda1].flush_io_errs 0
[/dev/sda1].corruption_errs 0
[/dev/sda1].generation_errs 0
So, how do I resolve this issue?
Second Question
The above commands seem to indicate that it's full, but in Btrfs Assistant it says:
Filesystem Size: 2.73TiB
Allocated: 1.82TiB (66.67%)
Used: 1.82TiB (66.60%)
Free (Estimated): 466.30 GiB (16.69%)
Free (Minimum): 466.30 GiB (16.69%)
You have lots of free space, did you overbuy?
Is Btrfs Assistant just wrong or are these numbers saying something different than I think? Because it's presented as though I have free space which is why I didn't realize I filled it up at first.
It looks like that's pulling from the following from the command line:
sudo btrfs fi us -T /mnt/betterStorage:
Overall:
Device size: 2.73TiB
Device allocated: 1.82TiB
Device unallocated: 931.51GiB
Device missing: 0.00B
Device slack: 6.00KiB
Used: 1.82TiB
Free (estimated): 466.30GiB (min: 466.30GiB)
Free (statfs, df): 557.80MiB
Data ratio: 2.00
Metadata ratio: 2.00
Global reserve: 512.00MiB (used: 0.00B)
Multiple profiles: no
Data Metadata System
Id Path RAID1 RAID1 RAID1 Unallocated Total Slack
-- --------- --------- -------- --------- ----------- --------- -------
1 /dev/sdi1 929.48GiB 2.00GiB 32.00MiB 931.50GiB 1.82TiB 3.00KiB
2 /dev/sda1 929.48GiB 2.00GiB 32.00MiB 1.04MiB 931.51GiB 3.00KiB
-- --------- --------- -------- --------- ----------- --------- -------
Total 929.48GiB 2.00GiB 32.00MiB 931.51GiB 2.73TiB 6.00KiB
Used 928.94GiB 1.66GiB 144.00KiB