Using Windows "Storage Spaces" to make a home NAS - Part 1

    After the repeated failure of my QNAP NAS, I decided the time had come to start experimenting on how to build my own. In this, the first part of a series of articles, I'll go through hardware choice and show you how to get Windows installed and running FROM an SD card (something Microsoft say you can't do).

I already have an HP Microserver G8 (GT-1610) running FreeNAS which works very well, but I wondered if there's anything in the Microsoft camp which could provide similar functionality.  With this in mind, I started off by buying another Microserver G8 as, even in their base specification, they provide a Celeron 2.3GHz processor, 4GB RAM, 4x 3.5in (non-hot swap) drive bays, internal USB and MicroSD card support, dual Ethernet plus iLO and a PCIe expansion port. This spec is good enough to run FreeNAS out the box, meaning I'd always have something to fall back on if my endeavours ultimately failed.

The first decision was to get some more RAM - the G8 only has 2 DIMM slots so RAM needs (or at least should) be in matched pairs. For now mine is running 1x 8GB DIMM and 1x 4GB DIMM, giving an useable 12GB for the development work (the box will be upgraded to 16GB in the near future). Should the box end up running either Windows 10 or Server 2016 then i'll need a better processor than the Celeron it comes with, especially as it will get tasked with running my Emby media library as well, so a Xeon low power processor is on the cards, but only once the initial testing has been done.

I should probably add that all this is going to be getting benchmarked against my existing FreeNAS setup, also running on a Microserver G8, and my existing Emby server, which is a MacMini with i7 and 32GB RAM, oh, and that's running Windows 10 of course.

The first strugle with this plan is to get Windows installed on the MicroSD card that's sitting inside the G8. The reason for booting off a MicroSD card is twofold - 1) I've got a DVD-RW drive in the optical bay, so can't populate that space with internal SSDs; and 2) I already boot FreeNAS from the SDCard in my other G8, so if Windows is to win out in the new solution it has to do the same. It also keeps the OS and the disks which will make up the actual NAS element seperate, which is no bad thing. (infact, Windows does not allow a boot disk to be part of a Storage Spaces pool or cluster, so this is necessary to avoid loosing capacity)

Microsoft *STILL* don't support booting Windows from any form of removable drive, unless you're opting to use Windows-to-go, which itself only works on USB pen-type drives (sticks) and not on SD cards. However, Windows runs absolutely fine from either SD or USB, so long as your machine's BIOS is able to address them as a boot device. To get round this, it is necessary to get a little bit inventive with Microsoft's imaging tools; which, when used in the right order, make this a simple, if time consuming job.

First off (at least on the G8), make sure the SD card you'll be using as your ultimate boot device has not volumes on it; most cards ship pre-formatted these days, so use the Windows disk manager tool to delete any partitions showing on the card. Next, you'll need to have a bootable installation media for whatever version of Windows you choose (I picked Server 2016 over Windows 10, but both work in the same way) - I used Rufus to burn the Windows ISO onto an 8GB USB stick. Next, put the SD card and USB stick in the G8 and boot the machine. (you'll need to check that booting from USB is enabled in the BIOS if the machine is not set at its facrory defaults)

Once the Windows installer boots, it will present you with a language, location & keyboard choice screen - leave all these as default as we're not going to be using the wizard to install Windows anyway. On the next screen, which is the "Install Now" screen, instead click on the text link marked "Repair your Computer" then click on the Troubleshooting and Command Prompt buttons on subsequent screens to get the installer to drop you into the Windows command line. It's here we'll actually do the work which will allow us to install Windows on the SD card.

Next, we need to make a partition on the SD card using the command line DISKPART tool. To do this enter the following commands: (where the X below is the numerical value for the SD card (disk) in your system. Usually it will be 1 as Windows has booted from the USB disk 0)

list disk
select disk X
create partition primary
format quick fs=ntfs label="SD-Card"

At this point we need to assign a drive letter to the SD card, but becuase we're going to subsequently boot from this drive, it *has* to be drive letter C:. Unfortunately Windows has "stolen" C: for the USB drive we're currently booted from. To resolve this minor issue run these commands. (this is still within DISKPART, and you'll need to replace the values for X and Y with those shown in the list volume command. Usually volume 0 will be the volume from which Windows has booted, and so volume 1 will be the one on your SD card. This would mean X = 0 and Y = 1)

list volume
select volume X
assign letter=D
select volume Y
assign letter=C

Next, we need to apply the Windows install image to our newly created C: drive (SD card). Use the command below to do so. There's two versions of this code listed, depending on whether you're using a Server 2016 or Windows 10 boot image.
WARNING: The dism command takes a looong time (30 - 40 minutes) to run.

Windows Server 2016 version:

dism /Apply-Image /ImageFile:D:\sources\install.wim /index:2 /ApplyDir:C:\

Windows 10 version:

dism /Apply-Image /ImageFile:D:\sources\install.wim /index:1 /ApplyDir:C:\

Finally, once the DISM command has eventually finished (and you've drunk a lot of tea), the last step is to make the SD card bootable. Run these commands to do so, and once complete, feel free to reboot the computer. (remember to remove the USB stick when doing so)

bootsect /nt60 C: /force /mbr
bcdboot C:\Windows

When the computer reboots, if you've got all the above correct, the machine will boot from the SD card and "Iinstall" Windows on to itself. In reality it is just going through the first run setup and "discovering devices" stages that we're used to seeing when installing Windows, but it will seem to take an age this time. Stick with it, and after a reboot or two, the system will eventually boot up with a fully installed copy of Windows, be it Windows 10 or Server 2016.

Part 2 will cover the fun had in getting Storage Spaces to actually work on our newly installed machine... stay tuned!

Edited by Stuclark

User Feedback

There are no comments to display.