zaterdag 23 oktober 2010

File Services: Shares not available after a reboot

A short while ago a question was asked on the Technet Forums regarding folders not being shared as expected after a reboot. This specific issue was in regard to BitLocker, but this same issue applies when the folders are being hosted on a volume that's connected through a SAN (Fibre/iSCSI and such)

After being able to answer the question I thought I'd post a short blog article in regard to this issue, because it's a very common issue and not very well documented.

Issue
When you reboot your server all shares that are hosted on a SAN, on a BitLocker protected volume or anything other that needs a service in order to ensure it's availability. After restarting the Server service these shares come available, but there are no clear errors in the eventlog that states something is wrong.

Resolution
The issue is due to the BitLocker (or the service that connects your FC/iSCSI devices) service not being started yet when the Server service is started. When the server service is started, it tries to locate all folders to share and disregard the ones that aren't reachable. Because the service required is started shortly after, you won't notice any apparent issues until you investigate them.

Luckily this issue is quite easily fixed by editing a value in the registry. I'll explain this by showing an example.

1. First, open up services.msc.

When you look at the screenshot below, you'll see the shortname of BitLocker Drive Encryption. Write down this name or save it somewhere, we'll need it later.



2. Open regedit (Start, Run, type: regedit)

Browse to Hkey Local Machine\SYSTEM\CurrentControlSet\LanManServer



When you look in the key you'll see a value called DependsOnService. In my case this value is filled with SamSS and Srv. Open up this value.

As you can see, both services that need to be started in order to start the Server service are SamSS and Srv. Place the cursor after Srv and press Enter. Now type bdesvc (or the name of your required service you located in Step 1) and press Enter again. After filling in the value it should look like this:



Press Ok and reboot your server.

After a reboot your shares will be available directly from boot as they should be. Remember to remove the added service when you disable BitLocker again or remove the disks from SAN, otherwise the Server service won't be able to start.

Hope this helps.

Regards,

Stefan Hazenbroek

2 opmerkingen:

  1. Thanks for the advice on this. I seem to have run into a snag though. When my server reboots, I have to login once in order for the shares to become available. I assume BitLocker unlocks the drive upon login, then the Server service starts? Is there any way to make this work without having to login to the server first?

    Thanks in advance.

    BeantwoordenVerwijderen
  2. I have a similar problem where a BitLocker protected drive that does not automatically unlock on startup contains a shared directory. Trying what you suggested didn't seem to have an effect. I assume the shared directories are still running on startup and waiting until after the BitLocker service runs unfortunately in my case this service isn't automatic. Is there a way to "refresh" the shares after I unlock the drive?

    BeantwoordenVerwijderen