Sunday, September 27, 2015

WD Sentinel DS6100: Perform a clean install of Windows Server 2012 R2

In this exercise, we are going to create a Windows installation media that allows you to perform a clean install of Windows Server 2012 R2 onto a WD Sentinel DS6100. Before getting started, there are a couple of things we would like to mention.

First, if you have any data on your DS6100 you want to keep, back it up. Clean installing an operating system includes wiping your hard drives. We also highly recommend backing up the recovery image in the recovery partition of the DS6100. We have written a guide on how to do this here.

Second, do this at your own risk. Clean installing Windows on your WD Sentinel DS6100 is not something supported by Western Digital. After a clean install on a DS6100, the LCD screen won't work and the system fan will run at full speed. To get these components working, you'll need to install the Windows Essentials Experience role in Windows Server 2012 R2 and the WD components that make them work.

With those things out of the way, let us look at how to perform a clean install of Windows Server 2012 R2 on a WD Sentinel DS6100.

Grab a copy of the Windows Server installation media


Copy the content of your Windows Server 2012 R2 media into a working directory on your computer such as C:\WorkingDir\Win2012R2. We are going to modify the install.wim file in the install media by adding the RAID drivers required by the WD Sentinel DS6100.


Grab a copy of the Marvell 94xx SAS/SATA RAID Controller driver


The DS6100 uses a RAID controller in which Windows Setup and Windows Server 2012 R2 does not have the driver for. In order for Windows to see the boot drives in your DS6100, you will need inject a RAID controller driver into the Windows install image.

On a DS6100, go to the directory C:\Windows\System32\DriverStore\FileRepository and copy the files in the folder with the name beginning with mvs94xx.inf_amd64. The four files in this folder contain the driver for the Marvell 94xx SAS/SATA RAID Controller which is used on the DS6100. Copy these files to the directory C:\WorkingDir\mvs94.xx.inf_amd64 on the same computer you have copied your Windows installation media to.


Note that you can use the same files to inject the RAID driver into your Windows PE bootable USB which you will make later in this guide.

Inject the RAID controller driver into the installation media


Create a new folder called mount under your working directory (C:\WorkingDir\mount). Then open a command prompt as an administrator.


Run the following three commands to inject the RAID controller driver into the first image (Index:1) inside install.wim.
  1. Dism /Mount-Image /ImageFile:C:\WorkingDir\Win2012R2\sources\install.wim /Index:1 /MountDir:C:\WorkingDir\mount
  2. Dism /Image:C:\WorkingDir\mount /Add-Driver /Driver:C:\WorkingDir\mvs94xx.inf_amd64\mvs94xx.inf
  3. Dism /Unmount-Image /MountDir:C:\WorkingDir\mount /Commit
Since there are 4 images in total on a Windows Server 2012 R2 install media, repeat the steps for each of the other images (Index:2-4). Below is a list of what index is which image.
  1. Windows Server 2012 R2 Standard (Server Core Installation)
  2. Windows Server 2012 R2 Standard (Server with a GUI)
  3. Windows Server 2012 R2 Datacenter (Server Core Installation)
  4. Windows Server 2012 R2 Datacenter (Server with a GUI)

Create a Windows PE bootable USB and run Windows Setup


Using our previous guide, create a Windows PE bootable USB with the RAID controllder drivers injected. Once done, copy the folder C:\WorkingDir\Win2012R2 to the root of your Windows PE bootable USB. To boot your WD Sentinel DS6100 using USB, plug it in to one of the USB ports on the back of the DS6100 and turn it one while pressing and holding the recovery button. Once Windows PE has loaded, change the working directory to the Win2012R2 folder on the USB and run setup.exe.


Proceed to install Windows as you normally would by following the Windows Setup wizard.

Thursday, September 24, 2015

WD Sentinel DS6100: Transitioning to Windows Server 2012 R2 Standard from Essentials

The WD Sentinel DS6100 comes preinstalled with Windows Server 2012 R2 Essentials and is aimed at small businesses as a first-server solution. Windows Server Essentials has a 25 user limit. If you have the correct licensing, you can transition from Windows Server Essentials to Windows Server 2012 R2 Standard, unlocking the all the features in the Standard edition such as a higher user limit and Hyper-V.

To perform the transition (sometimes called "transmog"), open a command prompt on your server and enter in the following command.

Dism /Online /Set-Edition:ServerStandard /AcceptEula /ProductKey:<Product Key>


In our example, we are using a publicised KMS Client Setup Key. Remember to use your own product key. The transmog process takes several minutes. For more information about this process, you can see the following articles from TechNet;
  1. Transition from Windows Server 2012 Essentials to Windows Server 2012 Standard
  2. Transition from Windows Server 2012 R2 Essentials to Windows Server 2012 R2 Standard

Monday, September 21, 2015

WD Sentinel DS6100: Backing Up and Restoring the Recovery Partition

Computers from most manufactures today will likely come with a hidden recovery partition. In recent versions of Windows, Microsoft included an option to backup this recovery partition to an external drive, allowing a user to perform a factory reset even when the recovery partition has been deleted or corrupted.

On a WD Sentinel DS6100 you may have notice that this option is missing. It's not supported on Windows Server. In this exercise, we are going to look at backing up and restoring the recovery partition on a DS6100 with Windows PE so that you can perform a factory reset. This process also applies to the WD Sentinel DS5100.

Creating a Windows PE bootable USB


In a previous article we outlined how to create a Windows PE bootable USB and boot it on a WD Sentinel DS6100. Follow the steps in that article and create your own Windows PE bootable USB with a 8 GB or larger USB.

We're using script-based approach to backup and restore the recovery partition of the DS6100. On your Windows PE bootable USB, create a folder named WDFactoryRestore. We're going to put our recovery image and scripts in that folder.

Backing up the Recovery Partition


Our strategy to backup the recovery partition is to simply use Robocopy to copy the recovery image that is already in the recovery partition of the DS6100. By default, the recovery partition is not assigned a drive letter. You'll need to assign it a drive letter before we can use Robocopy.

Open a command prompt as an administrator and run Diskpart. Use the following commands to assign the recovery partition the drive letter "R".
DISKPART> select disk 0
DISKPART> select partition 5
DISKPART> assign letter="R"
DISKPART> exit


Now copy the recovery image that is in the recovery partition by entering the following command into the command prompt.

Robocopy R:\Recovery D:\WDFactoryRestore\Recovery /mir
(where D: is the drive letter of the USB)

After Robocopy finishes, you should have now backed up the recovery image of your DS6100 to your Windows PE bootable USB. If you would like to remove the drive letter you just assigned to your recovery partition, run the following commands in Diskpart.
DISKPART> select disk 0
DISKPART> select partition 5
DISKPART> remove
DISKPART> exit

Restoring the Recovery Partition


By now you should have a Windows PE bootable USB with the folder WDFactoryRestore on it. Inside that folder should be another folder called Recovery containing the actual recovery image of your DS6100.

Create two scripts and place them inside the folder WDFactoryRestore. Name the scripts CreatePartitions-UEFI.txt and FactoryRestore.bat.


CreatePartitions-UEFI.txt


The first script is a Diskpart script that wipes and partitions the boot drive of the DS6100. If this script looks family to you, you may have seen it here on TechNet. It's exactly the same script.

Copy and paste the following into CreatePartitions-UEFI.txt to create the script.
rem == CreatePartitions-UEFI.txt ==
rem == These commands are used with DiskPart to
rem create five partitions
rem for a UEFI/GPT-based PC.
rem Adjust the partition sizes to fill the drive
rem as necessary. ==
select disk 0
clean
convert gpt
rem == 1. Windows RE tools partition ===============
create partition primary size=300
format quick fs=ntfs label="Windows RE tools"
assign letter="T"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
rem == 2. System partition =========================
create partition efi size=100
rem ** NOTE: For Advanced Format 4Kn drives,
rem change this value to size = 260 **
format quick fs=fat32 label="System"
assign letter="S"
rem == 3. Microsoft Reserved (MSR) partition =======
create partition msr size=128
rem == 4. Windows partition ========================
rem == a. Create the Windows partition ==========
create partition primary
rem == b. Create space for the recovery image ===
shrink minimum=15000
rem ** NOTE: Update this size to match the size
rem of the recovery image **
rem == c. Prepare the Windows partition =========
format quick fs=ntfs label="Windows"
assign letter="W"
rem === 5. Recovery image partition ================
create partition primary
format quick fs=ntfs label="Recovery image"
assign letter="R"
set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"
gpt attributes=0x8000000000000001
list volume
exit

FactoryRestore.bat


The second script is a script we've written. It runs the script above with Diskpart, copies the recovery image back into the recovery partition and applies the recovery image to the system partition. It essentially restore all the partitions and data on the boot drive of the DS6100 back to how it was out of the factory.

To create the script FactoryRestore.bat, copy and paste the following into FactoryRestore.bat.
rem == FactoryRestore.bat ==
rem
rem This script performes a factory restore of a
rem WD Sentinel DS5100 / DS6100 from a captured image.
rem
Diskpart /s CreatePartitions-UEFI.txt
Robocopy .\Recovery R:\Recovery /mir
Dism /Apply-Image /ImageFile:".\Recovery\All_os.swm" /SWMFile:".\Recovery\All_os*.swm" /Index:1 /ApplyDir:W:\
bcdboot W:\Windows

To actually perform the factory reset, boot the DS6100 into Windows PE, change the working directory to the WDFactoryRestore directory on the Windows PE USB and run FactoryRestore.bat. We recommend testing the restore process on another computer or virtual machine before you decide to wipe your DS6100.


Note: If you are running RAID 1 on your boot drives, after performing the restore process, you may find that you will need to take out one of the boot drives in order to boot your DS6100. You can put the drive back in later, the DS6100 will rebuild it as part of the RAID 1 array again.

Friday, September 18, 2015

WD Sentinel DS6100: Booting Windows PE on a USB

Windows PE (Preinstallation Environment) is a minimal operating system designed to prepare a computer for Windows installation. In this exercise we are going to create a bootable Windows PE USB to be used on a WD Sentinel DS6100. You may use this USB for example to install a different version of Windows, capture an image or perform a factory restore.

Download and install the Windows Assessment and Deployment Kit (ADK)


For this exercise we're using the Windows Assessment and Deployment Kit (ADK) for Windows 10. You can download Windows ADK for Windows 10 from here.

Run adksetup.exe. When you get to the part where you select the features you want to install, select Deployment Tools and Windows Preinstallation Environment (Windows PE). We only need these components for this exercise.


Grab a copy of the Marvell 94xx SAS/SATA RAID Controller driver


The DS6100 uses a RAID controller in which Windows PE does not have the driver for. In order for Windows PE to see the boot drives in your DS6100, you will need inject a RAID controller driver into the Windows PE image.

On a DS6100, go to the directory C:\Windows\System32\DriverStore\FileRepository and copy the files in the folder with the name beginning with mvs94xx.inf_amd64. The four files in this folder contain the driver for the Marvell 94xx SAS/SATA RAID Controller which is used on the DS6100. Copy these files to C:\mvs94.xx.inf_amd64 on the computer you have Windows ADK installed.


Create the Windows PE image and bootable USB


Run the Deployment and Imaging Tools Environment command prompt as an administrator. The shortcut should be in your Start menu after you install ADK.


To create a new Windows PE image for your DS6100 with the RAID controller driver injected, enter the following commands.
  1. copype amd64 C:\WinPE_amd64
  2. Dism /Mount-Image /ImageFile:C:\WinPE_amd64\media\sources\boot.wim /Index:1 /MountDir:C:\WinPE_amd64\mount
  3. Dism /Image:C:\WinPE_amd64\mount /Add-Driver /Driver:C:\mvs94xx.inf_amd64\mvs94xx.inf
  4. Dism /Unmount-Image /MountDir:C:\WinPE_amd64\mount /Commit
Once you have created your Windows PE image, copy it onto a USB with using the MakeWinPEMedia script.

     MakeWinPEMedia /ufd C:\WinPE_amd64 D:

Make sure you substitute 'D:' with the driver letter of your USB.

Boot the WD Sentinel DS6100 off the USB


Although there are boot options you can configure in the UEFI BIOS of the DS6100, there is no option in there to boot from USB. To boot off your Windows PE USB, you need to press and hold the Recovery button on the back of the DS6100 while turning it on with the USB plugged in. Windows PE will load after a while.


Note: We've tried to boot the DS6100 using a NTFS formatted USB and have found that it doesn't work. FAT32 works best. You may also find that booting off the USB 2.0 ports work better as well.

Thursday, September 10, 2015

WD Sentinel DS6100: Performing a Factory Restore

To perform a factory reset on a WD Sentinel DS6100, press and hold the Shift key before restating your server. Windows will then reboot into the Windows Recovery Environment (Windows RE).



Once in Windows RE, select the Troubleshoot option. Behind the Troubleshoot option, Western Digital placed an option here to factory reset your DS6100. Press WD Factory Restore to start the factory reset.


A script will then run to perform the factory reset. You will need to confirm that you want to continue. Once done, your DS6100 will reboot.


Please note that this process also works for the WD Sentinel DS5100 and ONLY works when you have not messed with the default factory partitions. Outside of this process, there is no official way to factory reset your DS6100. If you have lost your recovery partition, you'll need to contact Western Digital for help. In a later post, we'll look at backing up and restoring your recovery partition on a DS6100.