大网数据广告活动
服务器运维问答

"rm: can not remove xxx: No Space left on device" on BTRFS

· 52CE 我爱测

Running OpenSuse 12.2. Suddenly the root parition seems to be full (99%) but I can no longer remove files manually. "rm: can not remove xxx: No Space left on device" although 450mb are still free according to df. The filesystem i…

问题原文

原帖链接 · Andreas Jung · CC BY-SA 3.0

Running OpenSuse 12.2.

Suddenly the root parition seems to be full (99%) but I can no longer remove files manually.

"rm: can not remove xxx: No Space left on device" although 450mb are still free according to df. The filesystem is BTRFS.

I tried checking the FS using btrfsck but it did not help.

What to do?

社区高分解答

原帖链接 · tylerl · CC BY-SA 3.0

Most likely, you're running into a problem where BTRFS has to allocate a bit of metadata before it can remove the file. One of BTRFS's weak spots is its handling of the out-of-space condition; improving behavior in this area is one of the project's priorities.

One suggestion on the btrfs wiki is to clobber the file instead of removing it.

#instead of this
rm -f ./some_file

# do this
true >| ./some_file

That'll remove the file's contents without changing the directory entry. Once you've worked your way out of the corner you're in, you can then delete files like normal. If that gives you trouble, you may want to temporarily remount with the nodatacow option, which turns off the copy-on-write behavior. But... not sure for certain if that will help or not.

In general, though: don't run a BTRFS filesystem dry. It's still pre-production software, and the corner cases are a little rough.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-02-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。