Jump to content
RESET Forums (homeservershow.com)
artiom

Running Windows 2012 R2 from USB drive

Recommended Posts

artiom

Hi all,

Here is some info I would like to share about running Windows from USB drive on a server.
As usual, I am not responsible if you destroy your server using anything described here!

A while ago, I was running Hyper-V 2012 R2 from an USB drive on HP MS G8 for more than a year - despite many people claiming that USB drives are not reliable.
I disabled the page file and was using a more-or-less recommended flash drive - Kingston Datatraveler Ultimage G3.

The disk performance of host os was limited to the internal USB2 port, however all HDDs were free for VMs and Storage Services.

At some point, I decided to use rack-mounted servers, as 16GB RAM limit on HP MS G8 was too low for me.
Long story short, I got 2 servers in the garage and installed the full Windows Server 2012 R2 OS - mainly for the amazing data deduplication feature of Storage Services.

As a full OS can wear a flash drive much quicker (I am running them with GUI enabled), I decided to use something more reliable than a simple flash drive. As I did not want to spend money for USB SSD drives (like Kingston HyperX?), I went to a much cheaper route - I got the cheapest mSATA SSD drive (Intel SSD 310 @40GB) and the cheapest mSATA-to-USB adapter. Well, the cheapest adapter didn't work on my laptop but did work on the server, so the second one was a little bit more expensive - by ~50p. In total one enclosure with a SSD drive costed me ~30GBP.

Then, I migrated the installed OS to the SSD - and this is the tricky part. I did the following:
1. Attached the SSD-in-USB-enclosure drive to the destination port on the server and all further actions were performed on the server via RDP.
2. Partitioned the destination drive according to MSDN recommendations:
  a. UEFI server: https://msdn.microsoft.com/en-us/library/windows/hardware/dn898510%28v=vs.85%29.aspx
  b. MBR server: https://msdn.microsoft.com/en-us/library/windows/hardware/dn898504%28v=vs.85%29.aspx
3. Captured the live server OS in a VHDX with Disc2vhd tool: https://technet.microsoft.com/en-us/sysinternals/ee656415.aspx
4. Mounted the captured VHDX file, assigned a drive letter to the OS partition and removed the letters from others (the tool captures them as RAW partitions even if you unchedk them from capture process).
5. Mounted the SYSTEM hive from OS on the VHD drive: http://smallvoid.com/article/winnt-offline-registry-edit.html
6. Updated the driver loading flags to load USB drivers on boot (otherwise you get BSOD when loading from USB): http://blog.frankovic.net/2010/06/install-windows-server-2008-r2-or-windows-7-on-usb-stick/
   However, by trial and error, I found that the article above does not specify the needer path for the flags key and to make it work I had to edit the key at the following location: <LOADED SYSTEM>\HardwareConfig\<some guid>
7. Removed the information about drive letters from original HDD, otherwise the OS boots from a drive different than C but certain system files get loaded from C anyway and all this leads to weird errors: http://windowsitpro.com/windows-client/changing-windows-system-drive-letter
8. Captured the OS image into a WIM file (yes, without sysprep): https://msdn.microsoft.com/en-us/library/windows/hardware/dn898498%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
9. Depending whether the server is UEFI or MBR, the following was done to make it boot:
  a. UEFI server: use bcdboot tool and force UEFI boot configuration. I had a few automatic repairs and reboots after, but all worked in the end.
  b. MBR server: use bcdboot tool with default parameters and then use bootsect tool to fix the MBR boot record. All worked from the first try.
10. Booted the OS and verified that it indeed uses the new USB SSD.
11. Using bcdboot tool enabled the hypervisor launch (it is disabled in default configuration): http://blogs.interfacett.com/enabling-hypervisor-auto-start-boot-configuration-database-bcd

According to general recommendations, the page file was not disabled.

General recommendations:
0. DO NOT delete or alter or change or touch or do anything with the original OS HDD until you boot everything from USB SSD and set up backup and make sure it works and you are happy with it! You've been warned!
1. Set up backup asap and make sure you can restore it.
2. Have a Windows Deployment Services server running in the network - it is really helpful when you need to load Windows PE to fix broken boot records.
3. Have running all necessary remote tools - like iDRAC console on Dell, iLO on HP or iKVM/IPMI on Supermicro to avoid running around with monitors and keyboards. It is much more fun to do everything from your sofa.

For me, all is working fine so far - I will post here if I will encounter any issues or find some more interesting information.
I hope this information will be helpful to someone.

Thank you for reading!

  • Like 1

Share this post


Link to post
Share on other sites
darenfriday

Hey Artiom

 

Can I ask you about your USB 2012 install?

 

I plan to run 2012 R2 from the USB drive and save all 4 x 3.5 for data/VM's.  How did you choose the USB as the destination for the OS?  Did you have to make it part of the RAID setup?  Is it an off the shelf config or was all a workaround?

 

Thanks

 

Daren

Share this post


Link to post
Share on other sites
artiom

Windows Installer cannot deploy OS to an USB drive - you will have to deploy it manually.

1. Partition the drive with diskpart (I am using GPT format).

2. Deploy the Win 2012 R2 from wim image with dism.

3. Update drive boot with bcdboot.

4. Plug the USB drive into server and set it as bootable.

 

I did this several times and everything is still working perfectly.

Share this post


Link to post
Share on other sites
darenfriday

Thank you.  My Microserver will be here this week so just preparing.  I may just stick in a cheap/small SSD for the OS but looking for options.  Cheers, Daren  

Share this post


Link to post
Share on other sites
jmwills

Don't go smaller than at least 80 gigs.

Share this post


Link to post
Share on other sites
artiom

it all depends on the needs. My servers are running perfectly on 40GB mSATA SSDs in USB enclosures - Hyper-V + File Services. Everything else is installed in VMs.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • E3000
      By E3000
      Hello all,
       
      A few questions for those who use Type-1 Hypervisors on their Gen8 MicroServers...
       
      I am looking to try ESXi or ProxMox and have been reading a lot of the threads on here.
      Hopefully you guys can help with some harder to find answers I have been seeking.
       
      1) Which would be the better way to setup ProxMox:
           a) Hypervisor on Internal MicroSD, VMs installed on SSD in ODD Port, Data on 4x HDDs in bays.
           b) Hypervisor on Internal USB, VMs installed on SSD in ODD Port, Data on 4x HDDs in bays.
           c) Hypervisor and VMs both installed on same SSD (partitioned?) in ODD Port, Data on 4x HDDs in bays.
           d) Hypervisor on SSD using a USB-to-SATA cable on Internal USB, VMs installed on separate SSD in ODD Port, Data on 4x HDDs in bays.
       
      2) Would a 128GB SSD be a ‘waste‘ for installing a Hypervisor on? How much space is typically needed?
       
      3) How many VMs have you guys run on a Gen8 comfortably without it being sluggish?
       
      4) Everyone seems to be going RAID crazy these days. Is there any reason to use it if high-availability is not that necessary and a good backup plan is in place? What is wrong with separate disks (or singular Raid0s)?
       
      5) Does using Type-1 Hypervisors have any effect on the internal fans speed/noise? Is it possible to have 3-5 VMs running and still have the fan speed @~8% as it was when I was using 2 nested (Type-2) VMs?
       
      Sorry in advance if some of these questions are silly, common knowledge, or “depends on what you are doing in the VMs!” 😆
       
      Thanks in advance to all those that help!
    • radaxian
      By radaxian
      Hi all,
       
      Here's a guide I would like to share around Windows Storage spaces and creating a 4x drive Parity pool
       
      In a nutshell I have Windows Serer 2019 and storage space parity pool running very nicely on my Gen8. Here's the configuration I used and How to copy my setup.
      (I still believe ZFS or UnRAID are far better choice as a filesystem on these limited servers, but if you need Windows like I do, then storage spaces can be an excellent alternative.)
       
      This is my "best effort" guide and by no means perfect. It does however yield excellent results for both read and write speeds.
       
      Gen8 Microserver
      16GB RAM
      CPU Stock for now (1270 V3 on it's way)
      Disks  4x 3TB WD NAS drives in front bays
      SSD - Samsung Evo 850 265
       
       
      First lesson, DONT use the Windows GUI to create the pool or Virtual disk as the GUI applies terrible defaults that you can't edit and will ruin performance. Also make sure you're on the latest version of Windows server as a LOT has changed and been improved recently.
       
       
      You must use PowerShell.
       
       
      Terms:
      PhysicalDiskRedundancy - Parity Columns - 4 (The data segments stripped to disks. Should match your 4 disks) Interleve - 256K (The amound of data written to each "column" or disk. In this case 256KB interleave gives us a 64K write to each disk) LogicalSectorSize - 4096 PhysicalSectorSize - 4096 REFS/NTFS Cluster - 64K  
       
      Overall configuration:
      4 drive file system, one bootable SSD in RAID mode.
       
      BIOS setup initial
      F9 into the BIOS and set the B120i controller into RAID mode
      F5 into the RAID manager and create 1 individual RAID0 logical drive for the SSD
      Set the SSD as the preferred boot drive (Yes in the same screen)
      Set the cluster size to 63
      Enable caching
       
      Windows install 
      Install Windows 2019 Server Standard GUI edition from ISO
      Offer up the B120i RAID drivers via a USB stick so the wizard can see the SSD RAID0 drive. Filename p033111.exe (Have them extracted)
      Windows update and patch and reboot
       
      BIOS setup post windows
      Once windows is up and running go back into the F5 RAID manager and finish the setup of the 4 front drives into 4x RAID0
      Check the SSD is still set as the preferred boot drive (Yes in the same screen)
      Set the cluster size to 63
       
      Windows config of storage spaces
      At this point you should see 4 individual drives ready to be used as a Storage pool
       
      Try to set each disk to have a cache (Not all drives support this)
      Win + X to open the side menu
      Device Manager
      Expand Disk Drives
      Right Click the "HP Logical Volume" for each drive
      Check - "Enable write caching on the device"
      (If it doesn't work don't stress, it's optional but nice to have)
       
       
      Powershell - Run as Admin
       
      Determine the physical drisks available for the pool we're about to create
      Get-PhysicalDisk | ft friendlyname, uniqueid, mediatype, size -auto  
      Your output will look something like this, so identify the 4 drives that are the same and take note of their uniqueID
       
      Mine are the bottom four drives all 3TB in size
       
      friendlyname            uniqueid                                        size
      ------------                         --------                                        ----
      SSD
      HP LOGICAL VOLUME       600508B1001C5C7A1716CCDD5A706248        250023444480
       
      HP LOGICAL VOLUME       600508B1001CAC8AFB32EE6C88C5530D       3000559427584
      HP LOGICAL VOLUME       600508B1001C51F9E0FF399C742F83A6       3000559427584
      HP LOGICAL VOLUME       600508B1001C2FA8F3E8856A2BF094A0       3000559427584
      HP LOGICAL VOLUME       600508B1001CDBCE168F371E1E5AAA23       3000559427584
       

      Rename the friendly name based on the UniqueID from above and set to "HDD type"
       
      Set-Physicaldisk -uniqueid "Your UniqueID" -newFriendlyname Disk1 -mediatype HDD
       
      You will need to run that 4 times with each UniqueID code and create a new friendly name for each drive. I called mine "Drive 1, Drive 2" etc
      Set-Physicaldisk -uniqueid "600508B1001C2FA8F3E8856A2BF094A0" -newFriendlyname Disk1 -mediatype HDD Set-Physicaldisk -uniqueid "600508B1001CDBCE168F371E1E5AAA23" -newFriendlyname Disk2 -mediatype HDD Set-Physicaldisk -uniqueid "600508B1001CAC8AFB32EE6C88C5530D" -newFriendlyname Disk3 -mediatype HDD Set-Physicaldisk -uniqueid "600508B1001C51F9E0FF399C742F83A6" -newFriendlyname Disk4 -mediatype HDD  
      Verify the disks have been set correctly
      The following example shows which physical disks are available in the primordial server and CAN be used in the new Pool. You're just checking here if the friendly name renaming worked and they are all set to HDD type. Primordial just means on your local server and available.
      Get-StoragePool -IsPrimordial $true | Get-PhysicalDisk | Where-Object CanPool -eq $True You should see your four drives with nice names that you set like "Disk1"
       
       
      Now find out your sub system name, as we need this for the next command. Just take note of it. Example "Windows Storage on <servername>"
       
      Mine is ""Windows Storage on Radaxian"
      Get-StorageSubSystem  
       
      The following example creates a new storage pool named "Pool1" that uses all available disks and sets the cluster size.
      New-StoragePool -FriendlyName Pool1 -StorageSubsystemFriendlyName "Windows Storage on Radaxian" -PhysicalDisks (Get-PhysicalDisk -CanPool $True) -LogicalSectorSizeDefault 64KB  
       
      Now create the Virtual Disk on the new pool with 4x disks and Partity set correctly. (This is critical to do via PowerShell)
      New-VirtualDisk -StoragePoolFriendlyName "Pool1" -FriendlyName "VDisk1" -ResiliencySettingName Parity -NumberOfDataCopies 1 -NumberOfColumns 4 -ProvisioningType Fixed -Interleave 256KB -UseMaximumSize Those two commands should complete without error, if they don't go back and check your syntax
       
       
       
      Go back into the Windows GUI and open this
      Server Manager\File and Storage Services\Servers
      You should see the Storage pool listed and the Virtual disk we created in the previous steps.
       
      Storage pool - Pool1
      Virtual Disk - VDisk1
       
      Select Disks in the GUI
      Identify your new VDisk1 and right click it.
      Set to Online, this will also set it to use a GPT boot record
       
      On the same screen in the below pane Volumes
      Click TASKS and select "New Volume"
      Select REFS and Sector size of 64K
      Enter a volume name like "Volume1" or whatever you want to call it
      Select a drive letter such as Z
      (You can use NTFS here for slightly better performance, but I'm sticking to REFS as it has some benefits)
       
      You'll now have a Storage pool, Virtual disk on top and a volume created with optimal settings
       
       
       
      Go back into Power Shell
      Enable power protected status if applicable (Just try it, no harm)
      (Ideally here you should have your server connected to a basic UPS to protect it from power outages)
      Set-StoragePool -FriendlyName Pool1 -IsPowerProtected $True  
      Check if the new sector sizes of Virtual disk and all relevant settings are correct
      Get-VirtualDisk | ft FriendlyName, ResiliencySettingName, NumberOfColumns, Interleave, PhysicalDiskRedundancy, LogicalSectorSize, PhysicalSectorSize Example output
      FriendlyName  ResiliencySettingName  NumberOfColumns  Interleave  PhysicalDiskRedundancy  LogicalSectorSize  PhysicalSectorSize
      VDisk1                Parity                                      4                       262144                         1                                        4096                       4096
       
       
      You're done.... enjoy the new Volume.
       
      At this point you can share out your new Volume "Z" and allow client computers to connect.
       
       
       
       
      Some other commands in Power Shell that I found useful
       
      Get more verbose disk details around sectors.
      Get-VirtualDisk -friendlyname Vdisk1 | fl  
      Get-PhysicalDisk | select FriendlyName, Manufacturer, Model, PhysicalSectorSize, LogicalSectorSize | ft  
       
      Check if TRIM is enabled. This output should be 0
      fsutil behavior query DisableDeleteNotify If TRIM is not enabled, you can set it on with these commands
      fsutil behavior set disabledeletenotify ReFS 0 fsutil behavior set disabledeletenotify NTFS 0  
       
      Check the Power Protected status and cache
      Get-StorageAdvancedProperty -PhysicalDisk (Get-PhysicalDisk)[0]  
       
      Once your data has been migrated back to your new pool from backup, make sure you run this command to "spread out the data" properly.
      This command rebalances the Spaces allocation for all of the Spaces in the pool named SQLPool.
      Optimize-StoragePool -FriendlyName "Pool1"  
       
      I'm yet to get my Xeon in the mail, but once that's installed I think the disk performance will go up even higher as the stock CPU is junk.
       
       
       
       
       
       
    • Henrik
      By Henrik
      Hi Community,
       
      First, my specs (briefly):
      MicroServer Gen10
      AMD Opteron X3216
      Win Server 2016
      [...]
       
      Problem:
      The Taskmanager shows only 1 CPU-core instead of 2.
      (ref. image 1)
       
      Solutions tried:
      checked msconfig...no CPU-Limit set checked, whether other users see the same amount of CPU-cores in task-manager (ref. image-link (internal) 2)  
      Anyone out there with an idea to solve this?
       
      Greets
      Henrik
       

    • MarkFlagman
      By MarkFlagman
      Hi, everyone!
      Hoping someone can help me out with this one!
      I have a simple RDS setup of 2 servers. One is the connection broker/gateway etc (RDS001), and the other is the session host (RDS002). These are both Server 2012 R2, in the same OU, with the same GPO's applied.
      I am using HP T510 clients (running ThinPro 5.2), with an RDP connection to the farm address (rds.domain.local). The connection is working fine, however usb devices (ie memory stick) will not redirect to the session host. All the redirection options in the collection properties are ticked. Audio redirects to the client with no problem. 
      I have also tried connecting directly to the session host (RDS002) with no difference. 
      I believe the redirect settings on the T510 to be correct, as if i set up another rdp connection from the client to another server or even the connection broker (RDS001) , the usb device i have plugged to the client redirects fine. 
      So, it seems as though it is only the session host (which is where i actually want to redirect a device to..lol) having this problem. 
      However, if i connect to the session host from a windows 10 pc, everything redirects as expected - just not from the t510!
      Any help appreciated!
    • skinfreak
      By skinfreak
      Hi there,
      Over the many years of using the Gen8 there always seems to be some problem!! ;-)
       
      I have Windows 10 Pro install to a HDD in the ODD. The 4 3TB drives in the other bays, configured via Storage Spaces. BIOS set to AHCI and I have made use of the usb boot key to map the boot to the ODD bay. All has been resonably well for well over a year however I was never able to get Windows to update. Now I'm getting warnings that the software will be unsupported and have tried several times to do an upgrade but frequently get errors such as the installer cannot detect how much space is availble. I think that's because of the USB key.
       
      I don't want to go back to square one and reinstall if I cannot help it but has anyone else experienced this? I seem to recall having problems with using the B120i but cannot for the life of me remember why I stopped using it... but I know that changing to Legacy SATA should remove the need for the USB boot mapping.
       
      Thanks!


×
×
  • Create New...