OCFS2 showing "No space left on device" on a device with free space

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

Environment

SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Server 11

Situation

When trying to create a file on an OCFS2 file system, for example using the dd command (i.e.: "dd if=/dev/zero of=filename.iso bs=1G count=10"), the following error message appears. However, there is plenty of free space on the device according to the df command.

dd: writing `filename.iso': No space left on device
1+0 records in
0+0 records out
2064384 bytes (2.1 MB) copied, 2.37237 seconds, 870 kB/s

Resolution

Starting with SLES 11 SP2 a new feature has been introduced to avoid this issue. This is called discontig-bg (Discontiguos Block Groups). Further info and steps to enabled this feature are documented in the mkfs.ocfs2 and tunefs.ocfs2 manpages. For example (we will always use the device OCFS2 /dev/sdc1 as example here):

# tunefs.ocfs2 --fs-features=discontig-bg /dev/sdc1


In case the solution described here above is not applicable, an alternative possible solution which might be helpful is to recreate the file system with a higher data cluster size directive [i.e.: 64K (16 bits) or bigger, see man page for mkfs.ocfs2]. There is no way to change a block size to another value without recreating the file system.

The following command will show the Cluster Size value of the file system:

# debugfs.ocfs2 -n -R "stats" /dev/sdc1 | grep -i "Cluster Size"
    Block Size Bits: 12   Cluster Size Bits: 12

You could format it with a 64Kb block size as follows:

# mkfs.ocfs2 -C 64K /dev/sdc1 -F


Another help which may be worth to try to mitigate the issue, is about freeing contiguous space decreasing the number of node-slots (maximum number of nodes that can concurrently mount the partition) when possible. This space is always consumed by the journals for those slots, even if the nodes is not actually used.
In this way it is not necessary to recreate the file system. However, this is possible only if there are node-slots which are not actually needed.

For example, to know the current number of node-slots:

# debugfs.ocfs2 -n -R "stats" /dev/sdc1 | grep -i "Max Node Slots"
p, li { white-space: pre-wrap; }

Max Node Slots: 8


To change it:

# tunefs.ocfs2 -N 3 /dev/sdc1

Cause

This is due to OCFS2 fragmentation, where there is free space but not contiguous.

Additional Information

OCFS2 file system was created using a small Cluster Size, for example 4KB (12 bit). This is the default value when not passing a different size through the parameters.
4Kb block size is a good recommendation for a large number of small files. If 4kb block size is used for large files it uses a lot a extent_alloc blocks and soon they run low. In conjunction with fragmentation, the filesystem may run out of a contiguous block to alloc for extent_alloc blocks leading to "out of space" errors. This is an OCFS2 limitation, and the problem happens only when creating large files on file system with small Cluster Size.

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:7008696
  • Creation Date: 02-Jun-2011
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback@suse.com

SUSE Support Forums

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

Join Our Community

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.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

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

Go to Customer Center