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

Configure User’s Folder Redirection with Group Policy

February 3, 2023

Disable Built-in PDF Viewer in Microsoft Edge

February 3, 2023

Join a Windows Computer to an Active Directory...

February 2, 2023

Using Previous Command History in PowerShell Console

January 31, 2023

How to Install the PowerShell Active Directory Module...

January 31, 2023

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 Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Configure User’s Folder Redirection with Group Policy

    February 3, 2023
  • Using Previous Command History in PowerShell Console

    January 31, 2023
  • How to Install the PowerShell Active Directory Module and Manage AD?

    January 31, 2023
  • Finding Duplicate E-mail (SMTP) Addresses in Exchange

    January 27, 2023
  • How to Delete Old User Profiles in Windows?

    January 25, 2023
  • How to Install Free VMware Hypervisor (ESXi)?

    January 24, 2023
  • How to Enable TLS 1.2 on Windows?

    January 18, 2023
  • Allow or Prevent Non-Admin Users from Reboot/Shutdown Windows

    January 17, 2023
  • Fix: Can’t Extend Volume in Windows

    January 12, 2023
  • Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11

    January 11, 2023

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • 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?
  • Configuring L2TP/IPSec VPN Connection Behind a NAT, VPN Error Code 809
  • Managing Printers and Drivers with PowerShell in Windows 10 / Server 2016
Footer Logo

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


Back To Top