1

I've used the "Recovery Disk" function in Windows 8.1 to create a bootable USB drive with the factory defaults for a laptop. Now I plan to wipe the laptop and install Ubuntu on it.

I'm not comfortable with having a USB drive as my only backup for the factory image (the reliability of these drives is legendary \s). So a more reliable backup is in order.

Is there a way to make Windows Recovery write directly to a mounted image file instead of a USB drive? Alternatively, can I create a bootable image file from the USB drive, including all the boot info and the data? This might be something like dd, but in Windows for a UEFI-enabled bootable drive.

The end goal is to maintain the image file in safe backup and write it to an actual USB drive only if/when required for a factory reset.

I've tried looking at a few articles, such as this, but they go off on tangents without addressing the issue I'm facing (or similar). This question and this one are similar, but not quite the same.

  • There are some tools in Linux that will do this for a Linux installation on a flash drive, although I have not yet had that joy. I don't know if one of those would work on a Windows flash drive, particularly 8.x (the idea being that you boot up into Linux with a LiveDVD and use the tool from there). You would download and burn the Linux iso, and booting from it wouldn't affect anything on your system. I'll just throw this concept out there as a possibility in case it triggers a thought for someone with more knowledge. – fixer1234 Dec 22 '14 at 6:18
  • @fixer1234 The laptop doesn't even have an optical drive. I might be able to use a live USB I guess. – metacubed Dec 22 '14 at 6:36
  • If something like this would work, you will probably need two USB ports (you wouldn't be able to unplug the live session drive to plug in the Windows drive). A USB hub would do it if you don't have two free USB ports. – fixer1234 Dec 22 '14 at 6:40
  • @fixer1234 I'd rather go for a Windows-based solution though, saving steps if it makes sense. – metacubed Dec 22 '14 at 8:52
3

You can use Cygwin to obtain a working version of dd through Windows. I'm not sure how cygwin dd handles its device naming, but Linux drives are mounted as "/dev/sdX". A simple google search should explain cygwin's method of handling USB devices.

This will require root priviledges. On an actual Linux machine you would just run the command with sudo, but with Cygwin you have to launch it by right-clicking it and selecting "Run as administrator".

On Linux, if we assume the flashdrive is /dev/sdb (whenever you find cygwin's alternate device naming, substitude that for this in the command), one would use dd if=/dev/sdb of=usbImage.img bs=4M. Then you can put this newly created "usbImage.img" file somewhere you remember, and use the same command (but with 'if' and 'of' reversed) to write the image BACK to the flashdrive.

Before running this command, make sure the flashdrive is prepared in this "bootable" state. After running the command, you can modify the flashdrive however you please and you can later return it to the bootable state by simply running dd if=usbImage.img of=/dev/sdb bs=4M (the same command but with if/of reversed).

Remember that restoring the image to the flashdrive will completely overwrite all data on it.

|improve this answer|||||
  • I'm not familiar with the UEFI implications for a flash drive, but this will record and restore all of the Windows boot partitioning, etc. on the flash drive? – fixer1234 Dec 22 '14 at 20:09
  • @fixer1234 Think of it as a RAW backup of the 0's and 1's of the flashdrive. It preserves it in the EXACT state of the entire device, including partitions. – techniponi Dec 22 '14 at 22:00
  • FYI using Cygwin does not allow me to access the drive directly (/dev/sdb in my case). I get a "Permission denied". sudo does not work either. I'm looking for workarounds as I type this. – metacubed Dec 24 '14 at 5:33
  • All right.. got it working. I needed to right-click the Cygwin exe and "Run as Administrator". This adds the current user to the root group. If you can add that bit in, I will mark this as the answer. Thanks! – metacubed Dec 24 '14 at 6:46
  • Done, glad I could help. – techniponi Dec 24 '14 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.