btrfs 平衡“设备上没有剩余空间”,但任何 -dusage 和 -musage 值均未成功

btrfs 平衡“设备上没有剩余空间”,但任何 -dusage 和 -musage 值均未成功

btrfs balance start /我在具有 4 个物理设备的 140 GB LVM上遇到了以下问题btrfs(如果重要的话):

  • sudo btrfs balance start /失败ERROR: error during balancing '/': No space left on device
  • sudo btrfs balance start / -dusage=83原因Done, had to relocate 0 out of 145 chunks(多个值 < 83(0、20、60、80)导致相同的结果)
  • sudo btrfs balance start / -dusage=84原因ERROR: error during balancing '/': No space left on device(多个值 > 84(90, 95)导致相同结果)
  • sudo btrfs balance start / -musage=1原因ERROR: error during balancing '/': No space left on device
  • sudo btrfs balance start / -musage=0导致Done, had to relocate 1 out of 144 chunksDone, had to relocate 2 out of 145 chunks在多次调用期间没有任何我认识的模式

du -x -h /报告文件大小为 41 GB,这让我相信 btrfs 可以提供比它更多的可用空间。

dmesg包含多个

[1579308.336992] BTRFS info (device dm-0): 1 enospc errors during balance

添加挂载选项后,enospc_debug我看到很多

[1584022.768838] BTRFS: block group 2562951479296 has 1073741824 bytes, 1040130048 used 0 pinned 0 reserved 
[1584022.768840] BTRFS critical (device dm-0): entry offset 2562951479296, bytes 561152, bitmap yes
[1584022.768847] BTRFS critical (device dm-0): entry offset 2563085697024, bytes 425984, bitmap yes
[1584022.768854] BTRFS critical (device dm-0): entry offset 2563219914752, bytes 1355776, bitmap yes
[1584022.768861] BTRFS critical (device dm-0): entry offset 2563354132480, bytes 606208, bitmap yes
[1584022.768867] BTRFS critical (device dm-0): entry offset 2563488350208, bytes 11956224, bitmap yes
[1584022.768874] BTRFS critical (device dm-0): entry offset 2563614498816, bytes 495616, bitmap no
[1584022.768881] BTRFS critical (device dm-0): entry offset 2563616403456, bytes 28672, bitmap no
[1584022.768888] BTRFS critical (device dm-0): entry offset 2563616440320, bytes 40960, bitmap no
[1584022.768895] BTRFS critical (device dm-0): entry offset 2563622567936, bytes 16375808, bitmap yes
[1584022.768902] BTRFS critical (device dm-0): entry offset 2563756785664, bytes 1331200, bitmap yes
[1584022.768909] BTRFS critical (device dm-0): entry offset 2563891003392, bytes 434176, bitmap yes
[1584022.768915] BTRFS info (device dm-0): block group has cluster?: no
[1584022.768917] BTRFS info (device dm-0): 0 blocks of free space at or bigger than bytes is

dmesg

Linux 邮件列表上的一个主题建议使用较新的内核。

我从 Ubuntu 15.10 开始就遇到了这个问题,现在 16.04 带有 Linux 4.4.0-34-generic 和 4.4.6 带有btrfs-progsv4.7.3。

答案1

很简单,尝试删除空间或将其放到驱动器上。如果您插入可移动介质(例如 USB),通常它可以充当额外空间并防止出现错误。

答案2

我遇到了类似的问题。尝试以下命令:

sudo btrfs subvolume list /

如果你看到类似

@apt-snapshot-release-upgrade-zesty-2017-07-27_23:31:45

然后,您可以通过删除所有超过 1 天的 apt-release 快照来获得相当多的可用空间:

sudo apt install apt-btrfs-snapshot
sudo apt-btrfs-snapshot delete-older-than 1d

注意:我的 Linux 驱动器只有 25GB。在升级到 Ubuntu 17.04 之前,我有大约 10GB 的可用空间,但升级后只剩下 1GB,我甚至无法将 10MB 的文件写入磁盘。删除 apt-snapshot 后,我​​又获得了 8GB 的​​可用空间。

相关内容