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 12
Situation
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 /mntIf 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 permanentlyyou 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
)
btrfs device add /dev/<empty-disk> /mnt btrfs balance start /mnt
btrfs device remove /dev/<empty-disk> /mntIf 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 raid1You 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
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
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com