Unable to delete files on Windows Server 2022 cluster volume formatted with ReFS

Anonymous
2024-07-17T14:43:52+00:00

I have a 2 node Windows 2022 Server with a cluster volume on Storage Spaces, formated with ReFS.

When I try to delete a file, I get a wierd error messages and the file is not deleted.

Using powershell:

PS C:\Users\administrator.SALESMAN> cd C:\ClusterStorage\Volume1\

PS C:\ClusterStorage\Volume1> dir 1.txt

Directory: C:\ClusterStorage\Volume1 

Mode LastWriteTime Length Name


-a---- 26-4-2023 10:32 4194816 1.txt

PS C:\ClusterStorage\Volume1> remove-item 1.txt

remove-item : Cannot remove item C:\ClusterStorage\Volume1\1.txt: The parameter is incorrect.

At line:1 char:1

  • remove-item 1.txt
  • 
        + CategoryInfo          : WriteError: (C:\ClusterStorage\Volume1\1.txt:FileInfo) [Remove-Item], IOException 
    
        + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand 
    
    

PS C:\ClusterStorage\Volume1> remove-item 1.txt -Force

remove-item : Cannot remove item C:\ClusterStorage\Volume1\1.txt: The parameter is incorrect.

At line:1 char:1

  • remove-item 1.txt -Force
  • 
        + CategoryInfo          : WriteError: (C:\ClusterStorage\Volume1\1.txt:FileInfo) [Remove-Item], IOException 
    
        + FullyQualifiedErrorId : RemoveFileSystemItemIOError,Microsoft.PowerShell.Commands.RemoveItemCommand 
    
    

PS C:\ClusterStorage\Volume1>

Since this is a ReFS volume, the integrity for the volume should always be correct and running chkdsk is not possible.

What does the error message 'The paramter is incorrect' mean and how can I delete the file.

I get the same error message for any file I try to delete on the volume.

Windows Server High availability Clustering and high availability

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Anonymous
    2024-07-18T01:56:09+00:00

    Hi Adri,

    Hope you're doing well.

    The error message "The parameter is incorrect" typically indicates that there is an issue with the file or the file system that is preventing the operation from being completed successfully. In the context of a ReFS volume, this could be related to metadata or file system corruption, even though ReFS is designed for high resiliency.

    Here are some steps you can try to resolve the issue:

    1. Try using the '\?' prefix in your PowerShell command to bypass the normal path parsing and allow for longer paths:

    Remove-Item \?\C:\ClusterStorage\Volume1\1.txt

    1. Ensure that the file is not in use or locked by another process. You can use tools like 'Process Explorer' to check for any open handles to the file.
    2. Although 'chkdsk' is not available for ReFS, Windows has a built-in 'Repair-Volume' cmdlet that can be used to repair issues on ReFS volumes. Run the following command:

    Repair-Volume -DriveLetter C -Scan -Repair

    1. In addition, CSV is only used to store virtual machines. It is not recommended to put other files in CSV.

    Best Regards

    0 comments No comments
  2. Anonymous
    2024-07-18T09:14:17+00:00

    Hi Adri,

    Hope you're doing well.

    The error message "The parameter is incorrect" typically indicates that there is an issue with the file or the file system that is preventing the operation from being completed successfully. In the context of a ReFS volume, this could be related to metadata or file system corruption, even though ReFS is designed for high resiliency.

    Here are some steps you can try to resolve the issue:

    1. Try using the '\?' prefix in your PowerShell command to bypass the normal path parsing and allow for longer paths:

    Remove-Item \?\C:\ClusterStorage\Volume1\1.txt

    1. Ensure that the file is not in use or locked by another process. You can use tools like 'Process Explorer' to check for any open handles to the file.
    2. Although 'chkdsk' is not available for ReFS, Windows has a built-in 'Repair-Volume' cmdlet that can be used to repair issues on ReFS volumes. Run the following command:

    Repair-Volume -DriveLetter C -Scan -Repair

    1. In addition, CSV is only used to store virtual machines. It is not recommended to put other files in CSV.

    Best Regards

    Hi Xu,

    Thank you for your answer.

    1, Attempting to remove the file using the '\?' prefix doesn't gibe an error message, but the file is not removed.

    1. The file is not locked or used by another process.
    2. Running 'Repair-Volume -DriveLetter C -Scan' results in the message 'NoErrorsFound'. I did run this, while 'Redirected access' was enabled for the CSV.
    3. I know, the CSV is used for storing Virtual Machines and Virtual Disks. This was just a little test file, I created to ensure it would be unused and not locked.

    The error message occurs on all files and all CSV volumns, not just a single file.

    Best regards,

    Adri.

    0 comments No comments
  3. Anonymous
    2024-07-18T15:17:00+00:00
    0 comments No comments
  4. Anonymous
    2024-07-18T15:38:21+00:00

    check this it might help you https://youtu.be/2VfGz7eSzDU?si=Wex5PBN_czEKZ5Eh

    I fail to see how this helps to solve my problem.

    I already have CSV volumes created, formatted with ReFS.

    I can create files, read files, write files, change attributes etc. without problems.

    I just can't delete any files.

    0 comments No comments