Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Synology "My volume is running out of available space for metadata": the volume looks free but cannot write

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

A Synology volume can show free space in Storage Manager and still fail to save a file or install a package. Synology's page for this notice explains why: a Btrfs volume keeps a separate reserve for metadata, and in rare cases the metadata uses up that reserve and even the unallocated space. Free space for data is no help once the space for metadata has gone.

The sections below explain the notice, the two causes Synology names, how to check without changing anything, and the three fixes, each with a record and a warning before it.

What the error means

Synology's page gives the symptom as "The system will notify you when a volume is running out of available space for metadata." Metadata, in Synology's words, "stores information such as file names, sizes, and locations, which the file system uses to manage and locate files."

The page explains the mechanism: "Btrfs volumes reserve up to 4% of the space for metadata to prevent data from using up all the available space. However, in some rare cases, metadata may consume the reserved space and even use the unallocated space." The result: "Even though the volume may appear to have available space, you will no longer be able to perform operations associated with metadata, such as writing or modifying files and packages."

So a volume can appear to have available space while writing and modifying files and packages fails. The page applies to DSM 7.0.1 and above and DSM Enterprise (PAS).

This is not a storage pool problem. A degraded pool has its own guide: Synology storage pool degraded: replace the drive and repair.

Likely causes

Synology names two situations that can use up the metadata space of a volume:

Cause Synology's wording
Compression "Enabling file compression for shared folders."
Many tiny files "Storing large amounts of small files, each of which has a file size smaller than 512 bytes."

The checks below show which one is present.

Prove the cause before changing anything

All of these steps only read.

  1. Confirm the notice names the volume you think it does. Open Storage Manager > Storage and find that volume.

  2. Check the DSM version. The volume optimisation fix below needs DSM 7.1 or above; the notice itself applies from DSM 7.0.1.

  3. Look at the Suggestion for the affected volume in Storage Manager > Storage. Synology says to check it. On DSM 7.1 or above, it may carry the volume optimisation link used in the Fix section.

  4. Note the volume usage as a percentage. Synology says volume optimisation is only available if the volume usage is below 80%.

  5. Find out whether file compression is enabled on the shared folders on this volume. Synology names it as a cause. Write down which shared folders have it.

  6. Find out whether the volume holds large numbers of files smaller than 512 bytes. Note where they sit.

  7. Check how much room the storage pool has. Synology's expansion page says a volume can only be expanded when its pool has enough available space, and that the pool has a maximum number of drives and the volume a maximum size.

Keep the results together. Our own reading of how they map to the three options below, which Synology's page does not state: a pool with spare space points at expanding the volume, a volume under 80% usage on DSM 7.1 or above points at optimisation, and a full pool with no way to add drives points at removing small files you no longer need.

Fix

Synology says to do one of the following. Pick by what the proof showed, and do one option at a time so that you can tell which one cleared the notice. Each option is a change to a production volume, so choose a quiet period and tell the people who use the NAS first.

Option 1: expand the volume or the storage pool

Synology says: "If the storage pool or dual pool of the volume has sufficient space, expand the volume." If the pool does not have sufficient space, "expand the storage pool and then the volume."

Synology's page refers to separate help articles for DSM and DSM Enterprise (PAS) for the screens. Expanding the volume gives it more of the pool's space, and the volume size has a maximum. Expanding a pool by adding or replacing drives is a larger change and depends on the RAID type.

For the pool, Synology's page on expanding storage describes these routes: add drives to an empty slot (only for JBOD, RAID 5, RAID 6, RAID TP, RAID F1, SHR-1 and SHR-2), replace drives with larger ones (RAID 1, RAID 5, RAID 6, RAID TP, RAID 10, RAID F1, SHR-1 and SHR-2), or change the RAID type (Basic to RAID 5 or RAID 1 to RAID 5). Each of these changes the storage pool and its drives and has its own help article. Our own advice: treat each as a separate planned change with its own backup.

Synology's expansion page also lists what to confirm before starting. For a pool, the maximum number of drives must not already have been reached; if it has, Synology says to create a new pool or add a new RAID array to the existing RAID Group. For a volume, the maximum single volume size must not have been reached; if it has, Synology says to create a new volume. The page points to a RAID calculator for estimating the capacity after expansion. For RAID types that do not support expansion or when the drive slots are full, it lists other methods: pair the system with one or more expansion units, migrate the system and data to a model with more drive bays, create another storage pool and volume, or reset the system and restore all the backed-up data to a new pool created with larger drives.

Option 2: optimise the volume (DSM 7.1 and above)

Write down the time, the volume usage, the shared folders, packages and services on the volume, and tell users that the volume will be unavailable.

Disruptive step: the next step makes the volume unavailable. Synology says that before the system optimises the volume, "it will unmount the volume and stop all the packages and services on that volume. During this time, you cannot access the volume or packages and services installed on the volume." Other volumes and DSM stay usable. The process may take from several minutes to several hours depending on the size and usage of the volume.

In Storage Manager > Storage, click the volume optimisation link in the Suggestion of the affected volume. This is only available if the volume usage is below 80%.

To undo it: there is no setting to put back; wait for the process to finish.

Risk: starting a package on a volume that is still being optimised can fail. If a package you listed does not start once the process has finished, start it from Package Center, and check each against the list you wrote down.

Option 3: delete small files you no longer need

Synology's last option, if you cannot expand the storage pool, the dual pool or the volume, is to "delete files you no longer need that are smaller than 512 bytes."

Write down the paths of the files you plan to delete and keep a copy of anything you might need again, on another volume or device.

Risk: the next step deletes files, and a deletion cannot be undone from the NAS unless you have a copy or a backup. Delete only files you are sure are no longer needed.

Delete the files you identified in the proof section.

To undo it: copy the files back to the paths you wrote down from the copy or backup you made.

Confirm the fix

  • The volume shows its normal state in Storage Manager > Storage, and, our own reading, the Suggestion for the volume no longer shows the notice.
  • Writing, modifying and saving files works, and packages on the volume start and update.
  • The metadata notice does not return.
  • After an optimisation, every package and service that was on the volume is running again.

What to watch afterwards

  • A repeat of the notice. Synology names compression and very small files as the causes, so check whether new shared folders have compression enabled or whether an application is writing many tiny files.
  • Volume usage. Volume optimisation is only offered below 80%, so a volume that fills up loses that option.
  • Pool capacity. If expansion is needed, Synology's expansion page says the pool must have space first, and warns that expansion has limits (maximum drives per pool, maximum volume size).

Risks and limits

Synology's page covers DSM 7.0.1 and above and DSM Enterprise (PAS), and the optimisation option applies from DSM 7.1. Volume optimisation takes the volume offline for minutes to hours, so schedule it. Expanding a pool by changing drives or RAID type is a larger operation than the metadata notice suggests and has its own risks. Deleting files is the last resort because it cannot be undone.

Sources