(Solved) Recover Raid 5/6 from Rockstor / Recover Raid 5/6 and others from most errors

OK, So I didn’t need to recover my data but I found out it was easy so I did anyway. I set up a Raid 6 and after a year and a half I lost a disk, tried to update Rockstor Per forum advice and got an error. Once rebooted the GUI came back but the degraded pool error was gone yet the pool was not mounting. At any rate the attempts to fix exposed another hardware error that obviously was not noticed at the start of the Nas’s life. Long story short, Rockstor itself was down and out for the count and I was done messing around with it. So I started the process to create another array. I decided to go with Windows and just use storage spaces as it is nice and stable.

As I was getting a new SSD setup with windows I decided to have a look at Btrfs and what other ways there are to access it. I was able to recover the Raid6 array in windows and copy out the data basically saving me and my fam from swapping disks passively when we notice the disk trays are out in the family room. Not a big deal but nice to have pulled it back from the jaws of the abyss none the less.
So this is how to save a NOT TRASHED Raid array from a borked OS or from an inability to access the array in Rockstor for any reason other than any level of critical data has been corrupted or lost due to hardware failure. For Raid 5 that would be more then 1 disk failed or for Raid 6 more then 2 disks have failed. And the last case is no hardware failure you just can’t get in to it with Rockstor. Reality is Btrfs is quite robust even if the program over top of it is not great at dealing with some aspects of it. We just need something that is stable and easy to use because we all know it. So on to the recovery!

Step 1: Remove Rockstor OS and install Windows. First remove the power connector to any disks that are apart of the raid pool to be recovered. Then either swap out the boot disk with another SSD/HDD or format the disk you were using. (SSD/HDD Only windows typicly will not install to a usb stick) Format it with Windows setup as you install your favorite flavor of windows, back as far as XP, the new driver will not work with older versions.
*Windows makes a USB utility that will create a boot able USB drive called windows media creation tool.
*Activation is not needed in windows 10 to complete this recovery.

Step 2 Update windows Easy enough Windows usually does this on it’s own so all you have to do with Windows 11 is facilitate by checking for updates and rebooting as soon as it want’s or as soon as you notice. For Windows 10 you’ll want to run the Windows update assistant to get it up to 22H2 to most up to date version.

Step 3: Download WinBtrfs This is the link to the latest release as of 04/23/2024

the link above is the release I used to recover my Raid 6 from Rockstor.

Step 4: Extract the download and Install the WinBtrfs driver via the btrfs.inf file by right clicking on it and clicking install.

Step 5: Reboot the PC once install has completed.

Step 6: This step depends on your situation so it will be in parts.

A) You believe your pool is degraded-
Click start and type run, then click Run system in the start button search window.
Once Run is open Type Regedit and click OK

Click yes when it asks for permission and click the arrow to the left of HKEY_LOCAL_MACHINE In the drop down list click the arrow to the left of SYSTEM. In the system drop down click the arrow next to CurrentControlSet. Then the same for SERVICES. Then instead of the arrow just click the folder btrfs. in the list on the right you will see an entry for degraded. Double click it and put a 1 in the value data and click OK. Then double click the value Readonly and change the 0 to a 1 in value data and click ok. Now complete part B

B) You believe your pool is in good condition -
Click start and type run, then click Run system in the start button search window.
Once Run is open Type Regedit and click OK

Click yes when it asks for permission and click the arrow to the left of HKEY_LOCAL_MACHINE
In the drop down list click the arrow to the left of SYSTEM. In the system drop down click the arrow next to CurrentControlSet. Then the same for Control. and the same for CI and finally click the policy folder itself. on the right you will see a list of entries. If you have a REG_DWORD named (Upgradedsystem) then you are good to go but if as mentioned you have secure boot active then you need to create it by right clicking anywhere in the right window and clicking New then DWORD (32bit) Value.
Name it Upgradedsystem then double click it and put a 1 in data set and click the dot next to Hexadecimal for the base.
Shutdown and reattach your btrfs raid disks power connectors. Boot back into windows to see your array totally accessible natively in explorer and copy out your data.

This should be a cure all for any OS errors with Rockstor and as long as the pool is still in good condition or just degraded this should save your bum IF YOU PUT IMPORTANT DATA YOU DIDN’T BACK UP ON A NAS SYSTEM!!! LOL Good luck and have fun folk!!!

1 Like

Thanks for sharing this alternate approach.

2 Likes

WOW! Does this mean Windows can create a new Raid-6 with BTRFS ??? Or maybe create anything raid using BTRFS?

:sunglasses:

PS: Downloaded it and as soon as my new drives arrive, I plan to give it a try!

1 Like

I played with winBTRFS and a bunch of windows virtual disks (for testing purposes only) and as far as I could see, it worked perfectly

2 Likes

Looks to be a yes, this being a Rockstor forum I’m not going into detail here. But because Windows is proprietary and a file system structure is such a basic part of any operating system, the native stops at reading and writing to any Btrfs volume. With that said, there are commands that can be used for basic formatting and any of the Raid types as well as compression, scrubbing, ect… I did read someone had some speed issues but that was just one dude and a couple years ago. At any rate like most things PC your mileage may vary. The dude that created it is still actively at it and asking for emails about bugs.

The main point here is this is a game changer for the testing of Btrfs Raid 5/6 in Rockstor folks can run either with relative impunity. This could make it more likely people do run it in the future, meaning more people can report the issues and perhaps, one day Rockstor can get to a point where Philly can drop the Raid 5/6 warning outright. Cheers folk! Happy Nas-ing

1 Like