Create a Windows 10 recovery disk on Linux

In this howto there are the steps to follow when a Windows 10 OS is not bootable anymore and you haven’t a recovery disk. This is a typical case after a new OS will be installed on Dual boot or boot partition was altered.

  1. Download Windows 10 iso:
    1. Download the official Windows 10 image
  2. Prepare USB to be bootable:
    1. Open GParted with
gparted /dev/DEVICE-TO-ERASE
  • Select the USB drive
  • Device > New partition table
  • Select GPT
  • Apply: this will delete any data on the USB
  • Create a new NTFS partition then Apply (do not use FAT32 since some files can be greater than 4GB)
  • Close GParted
  • Write files:
    1. Unplug and plug USB
    2. Copy all Windows files to the empty USB drive using 7zip with:
      7z x -y -o/media/user/path-to-USB/ Win10_1809Oct_Italian_x64.iso
    3. If something goes wrong during copy, you can mount the ISO image then rsync the source with the USB drive (the trailing slash is important):
  • cd path/to/usb/drive
    rsync -avzp /media/myuser/CCCOMA_X64FRE_IT-IT_DV91/ .
  • umount
  • Add boot flag
    1. Open GParted selecting the device just written
    2. Select the new partition then
    3. Select Partition > Manage flags
    4. Select boot flag (esp will be auto-selected)
    1. Use windows tools
      1. Follow this howto by MS to recover MBR, restore BCD or similar actions

    You can follow these steps to write on a USB a recovery ISO from windows the same way.

    Reinstalling Windows keeping GNU/Linux partition safe

    Tested with:

    • Windows Vista
    • Ubuntu 9
    • (on the same disk, different partitions)

    Today I’ve to reinstall Windows. I’ve already an installation of GNU/Linux (Ubuntu) on the same disk. I have to worry? In the past, I had to say a big YES. And since I do a Windows reinstall every 2-3 years, this carry back something from previous times.

    (Please skip this paragraph.)

    When I was a little boy, the best processor I was dreaming was Pentium 133Mhz, PCs were assembled in my country and my days was filled with Duke Nukem 3d and Lucas Arts adventures, well in that days I had a freaking fear to lose all my precious savegames and BASIC experiments due to a disaster. I discovered a real MBR disaster several years later, with Mandrake and Windows 98.

    Well, now things are easier.

    1. Backup your files from Windows (Lucas Arts adventures savegames too…).
    2. Reinstall that crappy OS that you had to have to play some games to the partition that it deserves.
    3. After the operation Your Master Boot Record is gone, GRUB is gone. Linux, where are you??
    4. Download Super Grub2 Disk.
    5. Take an old CD-RW (that one with the photos of your sister kitten that she loves so much), erase it and burn the bootable iso on it.
    6. Now follow the instruction from the website. I’ve followed these steps:
    7. Select Detect any OS. On the next window, select your GNU/Linux distribution, identified by the kernel version (the more recent version is usually the right).
    8. Now that your distro is successfully running (i.e. Ubuntu), you have to rebuild the Grub bootloader, putting it on the MBR of the disk.
    9. Open a shell and type:
      sudo -i
      grub-install /dev/sda
      Where /dev/sda is the device for the disk where the two OS are. If you have doubt, use tools like gparted to inspect your disk searching for the right device identifier.
    10. After restart, Grub is running again! So Windows is reinstalled without even touching Ubuntu.

    If you’re also interested on changing grub boot sequence order, follow this howto.