Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows Server 2016 / The Disk is Offline Because of Policy Set by an Administrator

December 12, 2019 Windows 10Windows Server 2016

The Disk is Offline Because of Policy Set by an Administrator

On one of the servers running Windows Server 2016, an additional disk (not a system one) connected as a SAN LUN over FC gets offline after each restart of the server. If you open Disk Management console (diskmgmt.msc), you can see that this disk is in Offline state.

Windows Server 2016 Offline disk because of policy set by an administrator

To make the disk available in Windows, right-click it and take it online. You will have to do it after each server restart. I don’t think you are happy with that.

make disk online on windows server via disk management

First of all, I suspected that after a power outage in the server room, the storage systems booted later than the physical server. However, after a soft server reboot the disk went offline as well.

Note the popup message about a disconnected disk in the Disk Management:

Offline (The disk is offline because of policy set by an administrator).

As it turned out, this problem may appear in the failover cluster environments or virtual machines running Windows that have any shared disks can be accessed by several operating systems. It is related to the SAN Policy that appeared in Windows Server 2008. This policy controls automatic mounting of external disks and is used to protect shared disks available to multiple servers at once. By default, the Offline Shared (VDS_SP_OFFLINE_SHARED) policy is used for all SAN disks on Windows Server. You can change your SAN Policy to OnlineAll using Diskpart.

Run the command prompt as administrator and run the diskpart. In diskpart context, display the current SAN policy:

DISKPART> san

SAN Policy : Offline Shared

Change your SAN Policy:

DISKPART> san policy=OnlineAll

DiskPart successfully changed the SAN policy for the current operating system.

DISKPART set san polic to OnlineAll

View the current policy again:

DISKPART> san

SAN Policy : Online All

Select your disk (in our example, the disk index is 2):

DISKPART> select disk 2

You can view its attributes:

DISKPART> attributes disk

Make sure that the Read-Only attribute is not enabled. If it is, disable it, otherwise when trying to write something on the disk, you will see this message: The disk is write protected:

DISKPART> attributes disk clear readonly

Take the disk online:

DISKPART> online disk

DiskPart successfully onlined the selected disk
You can manage your disks not only in Diskpart, but also using the integrated PowerShell Storage module. For example, to take a disk online, run this command:

Set-Disk 2 -IsOffline 0

Close diskpart, restart your server and make sure that the disk is available after boot.

It turned out that the problem of unavailability of connected disks is typical not only for Windows Server, but also for all desktop Windows versions. For example, if you connect an external USB drive or an SSD in Windows 10, you can also see the following disk status (Offline – The disk is offline because of policy set by an administrator) in the Device Manager:

windows 10 usb/ssd disk is offline because of policy set by an administrator

In Windows 10, the issue with the offline disks is solved in the same way: you need to change the SAN policy. If the disk is new, you may need to initialize it and create file system partitions on it.

8 comments
0
Facebook Twitter Google + Pinterest
previous post
How to Backup Hyper-V Virtual Machines?
next post
VMWare: How to Find VMs by IP or MAC Address?

Related Reading

Windows Security Won’t Open or Shows a Blank...

May 17, 2022

How to Manually Install Windows Updates from CAB...

May 16, 2022

RDS and RemoteApp Performance Issues on Windows Server...

May 16, 2022

Deploying Software (MSI Packages) Using Group Policy

May 12, 2022

Fix: You’ll Need a New App to Open...

April 27, 2022

8 comments

Tom Schreur April 15, 2020 - 7:13 pm

Thank you. Helped immensely and solved my issue.

Reply
steve May 2, 2020 - 3:50 pm

Have been looking for this info for a long time, a long long time. Thank you.

Reply
Darrel Merkey July 10, 2020 - 6:40 pm

Did not work for me! It still says “Diskpart failed to clear disk Attributes.”

Reply
John July 29, 2020 - 2:07 pm

Great Resource and much cleaner than some others. Thank you!!!!!!!!!!!!!!!!

Reply
Dag S Hansen November 2, 2020 - 7:44 am

Ran into this problem when moving VMs from Hyper-V to VMWare and your post had us quickly fix the problem.

Reply
Shekhar December 23, 2020 - 11:28 am

Very helpful and precise..

Reply
Frustrated April 6, 2021 - 11:10 am

Just here to say thanks a ton, was pulling my hair out for a bit.

Reply
Darwin April 6, 2021 - 10:59 pm

I’m trying to fix corrupt hard drive for three days. I cant recover and reinstall windows because I cant create partition. It says write protected. I install windows on usb to access disk management the drive is offline so I search google and brought me here. Now I fixed and recover my files. Thank you…

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows 7
  • Windows Server 2019
  • Windows Server 2016
  • Windows Server 2012 R2
  • PowerShell
  • VMWare
  • Hyper-V
  • MS Office

Recent Posts

  • Create Organizational Units (OU) Structure in Active Directory with PowerShell

    May 17, 2022
  • Windows Security Won’t Open or Shows a Blank Screen on Windows 10/ 11

    May 17, 2022
  • How to Manually Install Windows Updates from CAB and MSU Files?

    May 16, 2022
  • RDS and RemoteApp Performance Issues on Windows Server 2019/2016

    May 16, 2022
  • Deploying Software (MSI Packages) Using Group Policy

    May 12, 2022
  • Updating VMware ESXi Host from the Command Line

    May 11, 2022
  • Enable or Disable MFA for Users in Azure/Microsoft 365

    April 27, 2022
  • Fix: You’ll Need a New App to Open This Windows Defender Link

    April 27, 2022
  • How to Reset an Active Directory User Password with PowerShell and ADUC?

    April 27, 2022
  • How to Completely Uninstall Previous Versions of Office with Removal Scripts?

    April 26, 2022

Follow us

woshub.com

ad

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to Repair EFI/GPT Bootloader on Windows 10?
  • How to Restore Deleted EFI System Partition in Windows 10?
  • Booting Windows 7 / 10 from GPT Disk on BIOS (non-UEFI) systems
  • Error Code: 0x80070035 “The Network Path was not found” after Windows 10 Update
  • Removable USB Flash Drive as Local HDD in Windows 10 / 7
  • How to increase KMS current count (count is insufficient)
  • How to Disable UAC Prompt for Specific Applications in Windows 10?
Footer Logo

@2014 - 2018 - Windows OS Hub. All about operating systems for sysadmins


Back To Top