You are not logged in.

#1 2026-09-21 14:27:31

Beemo
Member
Registered: 2024-12-20
Posts: 152

[SOLVED] No space left on device despite free space

$ sudo btrfs filesystem usage /
Overall:
    Device size:                 237.47GiB
    Device allocated:            237.47GiB
    Device unallocated:            1.00MiB
    Device missing:                  0.00B
    Device slack:                    0.00B
    Used:                        158.76GiB
    Free (estimated):             78.14GiB      (min: 78.14GiB)
    Free (statfs, df):            78.14GiB
    Data ratio:                       1.00
    Metadata ratio:                   2.00
    Global reserve:              411.44MiB      (used: 0.00B)
    Multiple profiles:                  no

Data,single: Size:235.46GiB, Used:157.32GiB (66.81%)
   /dev/nvme0n1p2        235.46GiB

Metadata,DUP: Size:1.00GiB, Used:739.86MiB (72.25%)
   /dev/nvme0n1p2          2.00GiB

System,DUP: Size:8.00MiB, Used:48.00KiB (0.59%)
   /dev/nvme0n1p2         16.00MiB

Unallocated:
   /dev/nvme0n1p2          1.00MiB

BTRFS, no LUKS, no snapshot.
It did run out of space previously and I deleted 100GB of files (through qBittorrent, a bug?). But now nothing works -- pacman, nano error out, the system barely boots with services not starting...

p.s. Not due to bad blocks as the smart data looks fine?

$ sudo nvme log smart -H /dev/nvme0
Smart Log for NVME device:nvme0 namespace-id:ffffffff
critical_warning                        : 0
      Available Spare[0]             : 0
      Temp. Threshold[1]             : 0
      NVM subsystem Reliability[2]   : 0
      Read-only[3]                   : 0
      Volatile mem. backup failed[4] : 0
      Persistent Mem. RO[5]          : 0
      Indeterminate Personality[6]   : 0
temperature                             : 27 °C (300 K, 80 °F)
available_spare                         : 100%
available_spare_threshold               : 50%
percentage_used                         : 3%
endurance group critical warning summary: 0
informative warning                     : 0
      Voltage Log Threshold Warning[0]: 0
Data Units Read                         : 162591466 (83.25 TB)
Data Units Written                      : 64212118 (32.88 TB)
host_read_commands                      : 2280611595
host_write_commands                     : 868106276
controller_busy_time                    : 3892
power_cycles                            : 852
power_on_hours                          : 12198
unsafe_shutdowns                        : 96
media_errors                            : 0
num_err_log_entries                     : 0
Warning Temperature Time                : 0
Critical Composite Temperature Time     : 0
Temperature Sensor 1                    : 27 °C (300 K, 80 °F)
Temperature Sensor 2                    : 31 °C (304 K, 87 °F)
Thermal Management T1 Trans Count       : 0
Thermal Management T2 Trans Count       : 0
Thermal Management T1 Total Time        : 0
Thermal Management T2 Total Time        : 0
Operational Lifetime Energy Consumed    : 0
Interval Power Measurement Type         : NVM subsystem total power
Interval Power Measurement              : -

Last edited by Beemo (2026-09-21 15:55:24)

Offline

#2 2026-09-21 14:34:23

Beemo
Member
Registered: 2024-12-20
Posts: 152

Re: [SOLVED] No space left on device despite free space

As this post suggested, fstrim worked.

$ sudo fstrim -v -a
/boot: 945.4 MiB (991367168 bytes) trimmed on /dev/nvme0n1p1
/: 78.7 GiB (84512489472 bytes) trimmed on /dev/nvme0n1p2

Why did I need a manual fstrim? I've never needed it before...

Offline

#3 2026-09-21 14:41:02

Beemo
Member
Registered: 2024-12-20
Posts: 152

Re: [SOLVED] No space left on device despite free space

Welp still no space after fstrim.

$ sudo pacman -Syu
error: failed to create temporary download directory /var/lib/pacman/sync/download-OYn3Uv: No space left on device
$ journalctl -b -1 | grep space
archlinux kernel: esrt: Reserving ESRT space from 0x000000005d8d8018 to 0x000000005d8d80a0.
archlinux kernel: thermal_sys: Registered thermal governor 'user_space'
archlinux kernel: nvme nvme0: Ignoring bogus Namespace Identifiers
archlinux kernel: BTRFS info (device nvme0n1p2): enabling free space tree
arch kernel: BTRFS info (device sda1): enabling free space tree
arch systemd[1]: Startup finished in 11.431s (firmware) + 785ms (loader) + 776ms (kernel) + 2.748s (initrd) + 10.587s (userspace) = 26.329s.
arch systemd-coredump[7913]: Cannot store coredump of 328 (systemd-journal): No space left on device

Offline

#4 2026-09-21 15:46:41

Beemo
Member
Registered: 2024-12-20
Posts: 152

Re: [SOLVED] No space left on device despite free space

Ok so the problem is: "Device unallocated: 1.00MiB" which means there is no space left to allocate chunks for new files.

The fact that everything is allocated yet there is free space means there are a lot of partially used chunks.
"btrfs balance start -d /" should fix that, but I ran into "No space left on device" for rebalance as well.

And that might be because of "Metadata,DUP: Size:1.00GiB, Used:739.86MiB (72.25%)"

If no data chunk is completely free, you may run into an issue that a new meta data chunk is needed before freeing a data chunk. Thus attaching temporarily an additional device to the pool can help you solve the issue.

So in the end, I had to plug a USB stick in the system to fix the issue. (It's empty so I'm ok with destroying its partition.)

$ sudo btrfs device add /dev/sdb /mnt
ERROR: /dev/sdb appears to contain a partition table (gpt)
ERROR: use the -f option to force overwrite of /dev/sdb

$ sudo btrfs device add /dev/sdb /mnt -f

$ sudo btrfs balance start / --full-balance
Done, had to relocate 240 out of 240 chunks

$ sudo btrfs device remove /dev/sdb /mnt

p.s. I image the reason for partial chunks is because I didn't enable "Pre-allocate disk space for all files" in qBittorrent, causing data for different downloads to be mixed in the same chunks, which means removing downloads does not free up chunks (only 0% used chunks are freed by kernel), unless all downloads are removed.

Further readings:
https://github.com/btrfs/btrfs-todo/iss … 2282915192
https://wiki.archlinux.org/title/Btrfs# … _on_device

Last edited by Beemo (2026-09-21 16:20:39)

Offline

#5 2026-09-21 16:00:50

cryptearth
Member
Registered: 2024-02-03
Posts: 2,340

Re: [SOLVED] No space left on device despite free space

you may could have got at least a few MB by clearing pacman cache:

pacman -Scc

note: the double c is the clear cache even of current versions, regular only -Sc shoukd used as regular system maintenace

Offline

#6 2026-09-21 16:20:17

Beemo
Member
Registered: 2024-12-20
Posts: 152

Re: [SOLVED] No space left on device despite free space

Yeah I should have done that. I never cleared pacman cache.

Offline

Board footer

Powered by FluxBB