Backing Up an SD Card or Hard Drive to A VHD File (Virtual Hard Disk)

 

The Microsoft Virtual Hard Disk – An Ideal Backup Image Format

Microsoft’s Virtual Hard Disks (VHD) are files that look like hard drives to a computer’s operating system. They are typically used for installing file systems on when working with virtual machines (including Microsoft’s own Hyper-V or Oracle’s Virtualbox) but can also be attached and used on a physical Windows 10 box so the Windows machine treats the file as a hard drive. As such, they are ideal to clone physical hard drives to as a method of backup. They work particularly well with multi-partitioned drives or SD cards, such as those used with Raspberry Pis. A full clone image works well over just copying files as it preserves the partitions and bootable formatting.

Backing Up A Raspberry Pi Drive to A VHD Image – Step By Step

If you have a Windows 10 computer, here’s a relatively simple way you can backup SD cards to a browserable VHD disk image that is not proprietary to your backup software.

  1. Attach the hard drive you are duplicating to your Windows computer. In my case I have a 150 GB external USB hard drive which serves as my Pi’s bootable drive. I detach that from the PI and insert the USB connection to my Windows computer.

    If you have an SD card you would need to attach the SD Card to you Windows computer using an SD Card reader.

  2. Open up Disk Management (right click on the Windows Icon in lower left corner->Disk Management). Alternatively press Windows Key-R, then type “diskmgmt.msc” and press enter.
  3.  

  4. Select “Action” in the menu, then “Create VHD”. If the Action menu items are grey, click first on something in the Disk Management window and then try again.

  5. When the “Create and Attach Virtual Hard Disk” window opens, click “Browse” to name your Virtual Hard Drive file and select the folder where it will be located. In addition, select the options shown below (VHD hard disk format, Dynamic/Expanding). The Dynamic disk option will save space on your physical hard drive . Fill in the “Virtual Hard Disk Size” with the size of the drive you are duplicating. Below I am duplicating my Raspberry PI’s 149.05 GB external USB drive that has a 256 MB bootable Fat 32 partition along with a 148.80 GB linux partition. If you are duplicating your PI’s SD card it will look similar but will be sized differently – it will have a FAT32 partition, as well as “Healthy (Primary Partition”) that is your Linux partition. Below is my example – the drive on the left is the source drive. The new Virtual Hard Disk we are creating will be the target cloned drive.

  6. When done select “OK”. You will see new drive in your Disk Management showing an “Unallocated” partition. On my system it shows up as Disk 8:

  7. Now open up your drive cloning software. I use the free MiniTool ShadowMaker Free 3.5. It is an excellent free backup tool for windows and includes a cloning tool.
  8. In Shadowmaker, I open the program and select Tools->Clone.

  9. I then select the Source (USB drive) and the target Destination (the unallocated Virtual Disk):

  10. Then Press “Ok” and confirm that the target Disk will be destroyed:

  11. ShadowMaker will then start cloning the disk (my clone took about an hour and a half):

  12. When done, ShadowMaker will ask if you want to shutdown, say “NO”:

  13. Now open up Disk Management again and confirm that the Virtual Drive is now correctly formatted and shows the partitions:

  14. Now, right click on the disk number (i.e., in the example, “Disk 7”) and select “Detach Virtual Drive”.

  15. You are done. The virtual drive file is now on your backup media having the extension “VHD”.

Restoring Entire Drive or Retrieving Backed Up Files

Anytime you need to restore it you just need to re-attach it and repeat the process, but reverse the cloning so the VHD is cloned to the physical hard disk. If you just need to copy some files off the VHD image, you can attach it and use it like any other hard drive, copying files off using Explorer. As an additional bonus, you can also attach the virtual drive to most virtual machines, including Oracle’s Virtual Box. You can also attach to a WSL session (at least WSL2) by attaching the disk in Disk Manager, assigning a letter to the Linux partition using Ext2 Filesystem Driver for Windows, and then opening WSL and typing “cd /mnt/[drive letter]”.

Ultimate Ad-Free Browsing

geoff-brooks unsplash - Advertisement Clutter

Browser getting cluttered with Ads ? Want to achieve a nearly total ad-free browsing experience (at least on your desktop) ?

Use Pi-Hole To Block All Network Devices

Install Pi-Hole . Will work for all devices in your home except those using cellular data.

Block Google Ads in Search Results Using Violent Monkey Scripts

Pi-Hole will cause ads appearing in your google search results to have deadlinks. Although they are blocked, they still appear and one tends to click on them as they appear on the top of the results. To remove them entirely you need to have the web page modified on the fly which is what the Violent Monkey extension (available for Firefox and Chrome) allows you to do by installation of customized javascript. Install the Violent Monkey extension, then install the user script Hide Ads in Google Search Results.

Block Twitter Ads

Install the following Violent Monkey User Scripts to block Twitter Ads:

Also Hide Ads on Facebook

There are other similar scripts on Greasy Fork and OpenUserjs.org.

Keep in mind security concerns – ready the warning on the OpenUserjs.org sitie.

Use Firefox, a Privacy Focused Browser – Firefox

Firefox is much better than it used to be and in my opinion better than Chrome in many ways. Google is never going to give up on Ads so will never allow a user to totally block ads while Firefox has become more privacy focused.

Install the Firefox Add On Ublock Origin

Ublock Origin is one of the best ad-blockers out there.

Now go browse the web!

How to Monitor Your Home Remotely With Skype

SkypeCall

Want to peek in on your dog ? Have an elderly parent or friend that you want to check up on ? Don’t have the time or cash to shell out for a dedicated web based camera solution ?

If you have a spare laptop with a camera, you can install Skype and have your call answered automatically so that you can get a full audio and video peek at any time using your mobile phone.

SkypeCall

A note of caution, this method using Skype obviously involves some risk that a random person might call and peek in on the camera. To minimize this, don’t use an existing account, set up a new user, and limit calls and your contact list only to those who are authorized to check on the camera.

In addition, note that this only works on a Windows or Linux version of Skype. The Apple IOS version does not permit auto answer and the Android version only answers in audio only – the person receiving the call must manually switch the video on (which works great if you have an elderly parent that has trouble with Skype calls as Skype automatically answers your audio call, you can then guide them by voice to turn the video on).

Installing Skype

Here are the instructions for Windows 10 (Linux also works, but the screen shots will be slightly different):

  1. From a Windows 10 machine install the Skype App.
  2. Create a new unique User account with its own set of contacts different from any other existing login you have. Give it a name that is not interesting or identifiable to you or a location.
  3. Login as your new user.

    Configure Skype Settings To Limit Contacts

  4. Open Settings:

  5. Make sure you do not “Sync Contacts” while setting up your Skype Account. Make sure this is turned off, as we are going to limit received calls to those in your contact list and do not want everyone on your computer’s contact list to be able to call this account. Later we will add only a select few to the Skype contact list:

    Skype-no-sync

  6. Turn “Appear in Search Results” off under Contacts->Privacy

    Skype Setting Hide From Search

  7. Turn off “Share location with Bing”Do Not Share With Bing
  8. Click on Calling – Turn on “Only Allow Skype Calls from Contacts to Ring on this device”:

    Skype Only Allow Contacts

  9. Since Skype options often change with each new version, look around for any other settings that might allow unauthorized persons to call or expose your contact information or your camera location and turn them off.
  10. Now turn on automatic answer, by going into Settings->Calling->Advanced Calling:

    Auto Answer

  11. Now add yourself and any other authorized persons to the contact list:

    Skype Add Contact Button

    Invite to Skype

  12. Now – test it out and enjoy two way video monitoring!

    Whatsapp Tip
    For another life-hack which works well as a video baby monitor, you can use Whatsapp on a mobile phone. Although Whatsapp won’t automatically answer, it will will stay connected for hours. Install it on your phone, point it at the baby, and call from another phone. Whatsapp won’t automatically answer so you’ll need to do that yourself, but it doesn’t require the more restrictive contact settings above as someone. This is ideal for monitoring your baby or elderly parent from another room in the same house, getting full HD video and audio (although it will lack night vision).