How to reclaim space in a thin provisioned LUN using fstrim?

Solution Verified - Updated -

Issue

  • A thin-provisioned LUN or LVM volume reports a critical space allocation error in the system logs, even though the guest filesystem (e.g., XFS or EXT4) indicates that there is sufficient free space available:

    kernel: blk_update_request: critical space allocation error, dev sdb, sector 426379264
    kernel: sd 12:0:2:1: [sdh] tag#0 Sense Key : Data Protect [current]
    kernel: sd 12:0:2:1: [sdh] tag#0 Add. Sense: Space allocation failed write protect
    kernel: sd 12:0:2:1: [sdh] tag#0 CDB: Write(10) 2a 00 16 9d a1 90 00 00 08 00
    

Environment

  • Red Hat Enterprise Linux 10
  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 7
  • Thin-provisioned Storage Arrays (SAN/NAS)
  • Virtual Machines (VMDK/QCOW2)
    • LVM2
    • XFS or Ext4 Filesystems

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content