SUSE Support

Here When You Need Us

btrfs - No space left on device

This document (7018362) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12

Situation

The device shows less space used on total while on device all space is used:
btrfs fi show /
Label: none  uuid: 57c03625-0299-4173-8cf0-c30338e89798
        Total devices 1 FS bytes used 5.46GiB
        devid    1 size 7.03GiB used 7.03GiB path /dev/<btrfs-device>
Also, the command df shows free space available.

Resolution

--Normal scenario--

Boot into rescue system from DVD/iso, mount the full btrfs filesystem and start the balance:

mount /dev/<btrfs-device> /mnt
btrfs balance start /mnt
If it finishes without errors you have fixed the situation.

--In case of complications--

If you see

ERROR: error during balancing '/mnt' - No space left on device

you need to add more space to be able to run balance. You have two options.

If you want to add drive space permanently
you should resize the disc on the SAN instead of adding more drives. (Typically problems happen on SAP default btrfs over lvm over disc when you add another pv to the root lv.)
Unmount the /mnt, resize the drive on SAN, rescan discs for the new size and follow this by partition/lvm VG and LV/btrfs resize depending on your setup.
(some useful commands - please study man pages if you do not know them:
  rescan-scsi-bus -s
  fdisk /dev/<rootdisc>
  pvresize /dev/<rootdisc-partition>
  vgs
  lvextend -l +100%FREE /dev/mapper/system-root
  btrfs fs resize max /mnt
)
 
For just temporary space expansion add an empty disk to btrfs and start balance again:
btrfs device add /dev/<empty-disk> /mnt
btrfs balance start /mnt
Once it is finished you should remove the added device again:
btrfs device remove /dev/<empty-disk> /mnt
If the btrfs filesystem is RAID-based you may get an error.
error removing the device '/dev/<empty-device>' - unable to go below two devices on raid1
You can solve this with:
btrfs balance start -f -dconvert=single -mconvert=single /mnt
btrfs device remove /dev/<empty-disk> /mnt

--Once finished--

the btrfs filesystem should show free disk space again and 'Total devices 1':
btrfs fi show /
Label: none  uuid: 57c03625-0299-4173-8cf0-c30338e89798
        Total devices 1 FS bytes used 5.46GiB
        devid    1 size 7.03GiB used 6.34GiB path /dev/<btrfs-device>

Cause

Btrfs meta data has exhausted available space.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7018362
  • Creation Date: 06-Dec-2016
  • Modified Date:29-Jul-2024
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.