Hey Checkyourlogs Fans,

When rebuilding or upgrading a Windows Server 2022 operating system, several unexpected challenges related to legacy configurations can arise, especially when dealing with Storage Spaces. One such issue is encountering an old Storage Spaces pool left behind, which may now be stuck in a read-only mode. This scenario can complicate your ability to wipe and reuse the pool, as you cannot modify or delete the existing configuration.

In this blog post, we will walk you through resolving the read-only mode on a Storage Spaces pool, allowing you to clean up the pool and its drives for future use.

A screenshot of a computer error Description automatically generated

Understanding the Problem: Storage Pool in Read-Only Mode

When a Storage Spaces pool is marked as read-only, it is typically due to one of the following reasons:

  • A previous OS rebuild or migration didn’t clear the old Storage Spaces configurations.
  • The system might have been improperly shut down or experienced a failure that caused the pool to enter a protected state.
  • The system detected an error or inconsistency, marking the pool as read-only to prevent data corruption.

While this read-only status helps protect data integrity, it also prevents you from modifying the pool or performing specific management tasks, such as wiping the pool or reformatting the drives. To proceed with cleanup and reuse, we must change the pool’s state from read-only to write mode.

Steps to Resolve the Issue

Follow the steps below to change the Storage Spaces pool from read-only mode to write mode, and then wipe it for reuse:

1. Launch PowerShell with Administrator Privileges

Open PowerShell as an administrator. Right-click the Start menu, select Windows PowerShell (Admin), and proceed.

2. Check the Current Storage Pools

Before making any changes, reviewing the existing storage pools on the system is a good idea. Run the following command to list all Storage Pools:


Get-StoragePool

This will return a list of all pools on your system, including their status (online, read-only, etc.).

3. Identify the Read-Only Pool

Identify the pool that is currently in read-only mode. Based on your output from the Get-StoragePool command, look for the IsReadOnly property, which should show True for the read-only pool.

4. Change the Pool to Write Mode

Now, we must switch the pool from read-only to write mode. To do this, use the following PowerShell command:


Set-StoragePool -FriendlyName "Storage Pool 1" -IsReadOnly $False

Replace “Storage Pool 1” with the actual friendly name of your pool (you can find this from the Get-StoragePool output). This command will change the pool’s state, allowing write operations.

Note: If this step fails, it might be due to an underlying issue with the pool, such as a failure of one or more disks. You may need to troubleshoot or remove any problematic drives from the pool.

5. Check the Pool Status Again

After running the command, you can verify that the pool is no longer in read-only mode by running:


Get-StoragePool

Ensure that the IsReadOnly property now shows False.

6. Wipe the Storage Pool and Drives

With the pool now in write mode, you can wipe it and its associated drives. To do this safely, run the following commands:

To clear the pool:


Clear-StoragePool -FriendlyName "Storage Pool 1"

To remove the drives from the pool:


Get-PhysicalDisk | Where-Object {$_.FriendlyName -like "Storage Pool 1*"} | Remove-PhysicalDisk

These commands will clear the configuration and remove any physical disks associated with the pool.

7. Reinitialize the Drives (if necessary)

If you need to reinitialize the drives for new use, you can do so by running:


Get-PhysicalDisk | Where-Object {$_.FriendlyName -like "Storage Pool 1*"} | Clear-Disk -RemoveData

This will wipe all data from the disks, allowing them to be reconfigured for new pools or other storage tasks.

Conclusion

Following these steps, you can resolve a Storage space pool stuck in read-only mode on a rebuilt Windows Server 2022 OS. After switching the pool to write mode, you can wipe and repurpose it and its drives as needed. Ensure that data on the pool is backed up before performing these actions to avoid unintentional data loss.

This process is essential for keeping your server environment clean and ready for new configurations. It also helps maintain optimal performance and manageability in your storage infrastructure.

Thanks,

 

Dave