[HOW TO] Restore Your groups.yaml File In Case The Configurator Screws Up

In once instance when I tried out the Configurator tool that’s new in 0.39, I used a configurator tool to modify the Groups to see what happens to the yaml file. After I make changes, for some reason the file became empty and I did not make a backup.

Fortunately, I did a search in the Internet and here is how I did it.

In the Linux terminal when accessing the remote server, copy/paste the following command, editing the text as necessary:

sudo grep -i -a -B100 -A100 'owm_cloud_coverage' /dev/sdb1

Replace /dev/sdb1 with your partition.

Once executed, the command will scrape the entire disk partition and show output in the terminal that is not deleted off the hard drive. If you found something that looks like a YAML file, you are in luck. Note that the output in the console will show gibberish content. You can ignore them.

If you are in Linux, use Ctrl+Shift+C for copy and Ctrl+Shift+V for paste. In Windows 10, if you are using Linux Subsystem for Windows (Bash for Windows), highlight the text using your mouse, hit Enter to copy text, open your favorite editor such as vim or nano, copy text into the file, and you should be good to go.

Although I don’t use nano, in vim you can use i for insert, ESC for exiting out of insert mode, and :ew for write to file and quit.

I hope I can be of help.