Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Asked
Modified 4 days ago
Viewed 32 times
2

when I am trying to delete large files on btrfs, it takes several minutes, and disk is completely locked during this time: other processes are locked on FS API calls.

This makes btrfs unusable on prod system. Anyone knows any workarounds?

Base on research I tried disabling quota, and using following mount options, but it doesn't help: rw,noatime,compress-force=zstd:1,ssd,discard=async,space_cache=v2,commit=120

Thank you!

New contributor
Riku Iki is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
7
  • This isn't completely on point for btrfs, so I'm writing it in a comment. I experienced a similar bottleneck with ext4 filesystems, and switching them to xfs removed the bottleneck. I believe there must be a btrfs config that will remove this bottleneck, but if you can't find one, give xfs a try for these filesystems.
    Sotto Voce
    –  Sotto Voce
    2025-10-13 00:08:14 +00:00
    Commented Oct 13 at 0:08
  • If you need snapshots and error detection & correction and transparent compression and other "advanced fs features", try zfs instead of btrfs. Depending on your distro, you'll almost certainly have to install it yourself as a dkms module but that's a trivially easy operation and you end up with an advanced modern fs that actually works reliably.
    cas
    –  cas
    2025-10-13 03:55:41 +00:00
    Commented Oct 13 at 3:55
  • I need transparent compression so xfs is not an options. I think I will need to move to zfs, but just hoped there is some easy fix for btrfs..
    Riku Iki
    –  Riku Iki
    2025-10-13 03:59:10 +00:00
    Commented Oct 13 at 3:59
  • Likely workaround: you could maybe substitute the file removal with a series of truncate operations. (truncate command in shell). It would probably prevent the locking, although ugly.
    peterh
    –  peterh
    2025-10-14 00:49:21 +00:00
    Commented Oct 14 at 0:49
  • I use some databases, and need to delete large tables, so its not up to me how files are deleted.
    Riku Iki
    –  Riku Iki
    2025-10-14 01:17:06 +00:00
    Commented Oct 14 at 1:17

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.