ESXi Datastore Unmount Fails due to Persistent Scratch Location
search cancel

ESXi Datastore Unmount Fails due to Persistent Scratch Location

book

Article ID: 435145

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

An ESXi datastore that has been in Maintenance Mode for an extended period cannot be unmounted from the hosts it is mapped to. Attempts to unmount or delete the datastore fail with an error similar to:

  • Device or Resource Busy
  • The resource 'Datastore Name: [Name]' is in use... because 'file system is busy'.

Environment Details:

  • The Syslog.global.logDir advanced system setting has already been verified to point to a different location.
  • No Virtual Machines (VMs) or templates are registered on the datastore.
  • No ISO files are currently mounted from this datastore.

Environment

ESXi all version

Cause

The datastore remains locked because it is still defined as the persistent scratch location (ScratchConfig.ConfiguredScratchLocation) for one or more ESXi hosts.

Unlike syslog configuration changes, updating the scratch location is a static configuration that creates a persistent pointer. The VMkernel maintains an exclusive file lock on the VMFS volume as long as it is the active scratch target. This lock is only released when a new location is initialized during the host boot sequence.

Resolution

To resolve this issue, the scratch location must be reconfigured to a new datastore and the ESXi host must be rebooted to release the lock.

  1. Identify New Location: Create a unique directory for each affected ESXi host on a different shared datastore (e.g., /vmfs/volumes/New_Datastore/HostA_Scratch).
  2. Reconfigure Scratch Path:
    • Log in to the vSphere Client.
    • Navigate to Host > Configure > System > Advanced System Settings.
    • Locate the setting ScratchConfig.ConfiguredScratchLocation.
    • Click Edit and enter the new unique path created in Step 1.
  3. Mandatory Reboot: Perform a rolling reboot of the affected ESXi hosts. The scratch configuration change only takes effect and releases the old datastore lock after a full system reboot.
  4. Verify Configuration: After the reboot, ensure that ScratchConfig.CurrentScratchLocation reflects the new path.
  5. Final Unmount: Once the hosts are back online and the locks are released, proceed with the datastore unmount or detach procedure in vCenter.