Jump to content











Photo

Windows 7 bkup/restore USB as an ISO to boot with Grub2


  • Please log in to reply
No replies to this topic

#1 911CD.net

911CD.net

    Member

  • Advanced user
  • 86 posts
  •  
    United States

Posted 03 November 2023 - 10:46 PM

Hi Guys.

 

I have a Windows Recovery USB drive that works, when I can find it and recently I needed to.  After I restored the C: drive I thought making an ISO file of it which would allow me to boot it via my Grub2 menus since I have about 3 dozen ISO boot menus.

 

I used the linux dd to copy the Recovery drive to an ISO.

sudo dd if=/dev/sda1 of=/mnt/nvme0n1p7/ISOs/Windows_Recovery_Drive.iso

I then tried to make a Grub2 menu to the USB  drive or the ISO version of it.

if [ $grub2win_bootmode = EFI ]; then
   set USB_drv=/bootmgr
   set USB_efibootmgr=/EFI/Boot/bootx64.efi
   set bootdrv=$root
   search -l "RECOVERY" --set=root
   if [ $? = 0 ] ; then
      echo
      echo Grub will now boot    Windows USB Recovery drive
      echo Boot disk address is  $root
      echo Boot mode is          Windows EFI
      echo
      echo Booting will be very slow. Be patient.
      sleep -i -v 6
      chainloader $USB_efibootmgr
      set root=$bootdrv
   else
      set iso='/ISOs/Windows_Recovery_Drive.iso'
      search -f $iso --set=root
      if [ $? = 0 ] ; then
         echo
         echo Grub will now boot    Windows Recovery Drive ISO
         echo ISO drive is          $iso
         echo Boot disk address is  $root
         echo Boot Manager          $USB_efibootmgr
         echo Boot mode is          Windows EFI
         loopback loop ($root)$iso
         echo Loop is               ($loop)
         echo
         echo Booting will be very slow. Be patient.
         read
         chainloader (loop)/$USB_efibootmgr
         set root=$bootdrv
      else
         echo "----------------------------------------"
         echo " "
         echo "Windows USB Recovery drive not found. Mounted?"
         echo " "
         ls ; echo ; ls ($root) ; echo
         sleep -i -v 10
      fi
   fi
   set root=$bootdrv
fi

The errors I was getting make It seem like the loop command only likes Linux ISO files. 

 

Then I found that I can't open the 7.3 GB ISO file in Linux or Windows to view the files in it!!

 

So, 2 questions: 1. how do I create a Windows Recovery ISO file and 2. how do I boot it with Grub2??

 

Thanks guys.



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 November 2023 - 01:23 PM

Well you didn't make a .iso.

 

You made a RAW copy of a USB stick to a file, giving to that file the .iso extension.

 

The normal extension for these dd copies is .img as they are an image of a (small) hard-disk-like device.

 

A .iso is created with a program like mkisofs and is an image of (usually) a CDFS filesystem (though ISO's with UDF filesystems are possible).

 

Some Linux distro's use a format that is actually a hybrid ISO filesystem that can be either be burned to CD/DVD or dd'ed to a USB stick.

 

Of course if you dd-back one of these to a file, the result will be the same hybrid ISO filesystem, but Windows recovery USB stick is a "normal", "plain", hard-disk-like device.

 

You can dd a .jpg image to a file called sometext.txt and then attempt opening it in notepad, but it won't look nice.

 

Definitely you cannot boot a .iso that is NOT a .iso file with the usual loopback loop.

 

No idea on how to boot a hard-disk-like image with GRUB2, and creating a "real" .iso out of it with mkisofs or similar is not easy (I mean it is easy, but whether it will actually boot and work is to be seen):

http://reboot.pro/in...showtopic=21663

 

IF what you have in your hands is a Windows PE of some kind, using a wim image it should be relatively easy to make a bootable .iso out of it, but it depends on the contents, whether you want to boot it in BIOS a nd UEFi or only BIOS or only UEFI mode, etc. etc.

 

:duff:

Wonko



#3 911CD.net

911CD.net

    Member

  • Advanced user
  • 86 posts
  •  
    United States

Posted 27 November 2023 - 08:13 PM

Wonko! :o :jump:   I did not know you replied.  The Current Talks page shows 0 Replies and 0 Views even.  Happy see you're still around and thank you for your reply.

 

So I need to find a mkisofs app.  Ok.  Thank you.

 

This is the USB Recovery drive:

guest@porteus:~$ tree /mnt/sda1
/mnt/sda1
├── BOOTNXT
├── Boot
│   ├── BCD
│   ├── BOOTSTAT.DAT
│   ├── Fonts
│   │   ├── chs_boot.ttf
│   │   ├── cht_boot.ttf
│   │   ├── jpn_boot.ttf
│   │   ├── kor_boot.ttf
│   │   ├── malgun_boot.ttf
│   │   ├── malgunn_boot.ttf
│   │   ├── meiryo_boot.ttf
│   │   ├── meiryon_boot.ttf
│   │   ├── msjh_boot.ttf
│   │   ├── msjhn_boot.ttf
│   │   ├── msyh_boot.ttf
│   │   ├── msyhn_boot.ttf
│   │   ├── segmono_boot.ttf
│   │   ├── segoe_slboot.ttf
│   │   ├── segoen_slboot.ttf
│   │   └── wgl4_boot.ttf
│   ├── Resources
│   │   ├── bootres.dll
│   │   └── en-US
│   │       └── bootres.dll.mui
│   ├── bg-BG
│   │   └── bootmgr.exe.mui
│   ├── boot.sdi
│   ├── bootuwf.dll
│   ├── bootvhd.dll
│   ├── cs-CZ
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── da-DK
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── de-DE
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── el-GR
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── en-GB
│   │   └── bootmgr.exe.mui
│   ├── en-US
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── es-ES
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── es-MX
│   │   └── bootmgr.exe.mui
│   ├── et-EE
│   │   └── bootmgr.exe.mui
│   ├── fi-FI
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── fr-CA
│   │   └── bootmgr.exe.mui
│   ├── fr-FR
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── hr-HR
│   │   └── bootmgr.exe.mui
│   ├── hu-HU
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── it-IT
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── ja-JP
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── ko-KR
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── lt-LT
│   │   └── bootmgr.exe.mui
│   ├── lv-LV
│   │   └── bootmgr.exe.mui
│   ├── memtest.exe
│   ├── nb-NO
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── nl-NL
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── pl-PL
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── pt-BR
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── pt-PT
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── qps-ploc
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── qps-plocm
│   │   └── bootmgr.exe.mui
│   ├── ro-RO
│   │   └── bootmgr.exe.mui
│   ├── ru-RU
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── sk-SK
│   │   └── bootmgr.exe.mui
│   ├── sl-SI
│   │   └── bootmgr.exe.mui
│   ├── sr-Latn-RS
│   │   └── bootmgr.exe.mui
│   ├── sv-SE
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── tr-TR
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   ├── uk-UA
│   │   └── bootmgr.exe.mui
│   ├── zh-CN
│   │   ├── bootmgr.exe.mui
│   │   └── memtest.exe.mui
│   └── zh-TW
│       ├── bootmgr.exe.mui
│       └── memtest.exe.mui
├── EFI
│   ├── Boot
│   │   └── bootx64.efi
│   └── Microsoft
│       ├── Boot
│       │   ├── BCD
│       │   ├── BOOTSTAT.DAT
│       │   ├── CIPolicies
│       │   │   └── Active
│       │   │       ├── {5DAC656C-21AD-4A02-AB49-649917162E70}.cip
│       │   │       ├── {82443e1e-8a39-4b4a-96a8-f40ddc00b9f3}.cip
│       │   │       └── {CDD5CB55-DB68-4D71-AA38-3DF2B6473A52}.cip
│       │   ├── Fonts
│       │   │   ├── chs_boot.ttf
│       │   │   ├── cht_boot.ttf
│       │   │   ├── jpn_boot.ttf
│       │   │   ├── kor_boot.ttf
│       │   │   ├── malgun_boot.ttf
│       │   │   ├── malgunn_boot.ttf
│       │   │   ├── meiryo_boot.ttf
│       │   │   ├── meiryon_boot.ttf
│       │   │   ├── msjh_boot.ttf
│       │   │   ├── msjhn_boot.ttf
│       │   │   ├── msyh_boot.ttf
│       │   │   ├── msyhn_boot.ttf
│       │   │   ├── segmono_boot.ttf
│       │   │   ├── segoe_slboot.ttf
│       │   │   ├── segoen_slboot.ttf
│       │   │   └── wgl4_boot.ttf
│       │   ├── Resources
│       │   │   ├── bootres.dll
│       │   │   └── en-US
│       │   │       └── bootres.dll.mui
│       │   ├── bg-BG
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── boot.stl
│       │   ├── bootmgfw.efi
│       │   ├── bootmgr.efi
│       │   ├── cs-CZ
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── da-DK
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── de-DE
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── el-GR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── en-GB
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── en-US
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── es-ES
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── es-MX
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── et-EE
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── fi-FI
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── fr-CA
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── fr-FR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── hr-HR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── hu-HU
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── it-IT
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── ja-JP
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── kd_02_10df.dll
│       │   ├── kd_02_10ec.dll
│       │   ├── kd_02_1137.dll
│       │   ├── kd_02_14e4.dll
│       │   ├── kd_02_15b3.dll
│       │   ├── kd_02_1969.dll
│       │   ├── kd_02_19a2.dll
│       │   ├── kd_02_1af4.dll
│       │   ├── kd_02_8086.dll
│       │   ├── kd_07_1415.dll
│       │   ├── kd_0C_8086.dll
│       │   ├── kdnet_uart16550.dll
│       │   ├── kdstub.dll
│       │   ├── ko-KR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── lt-LT
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── lv-LV
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── memtest.efi
│       │   ├── nb-NO
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── nl-NL
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── pl-PL
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── pt-BR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── pt-PT
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── qps-ploc
│       │   │   └── memtest.efi.mui
│       │   ├── ro-RO
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── ru-RU
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── sk-SK
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── sl-SI
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── sr-Latn-RS
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── sv-SE
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── tr-TR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── uk-UA
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── winsipolicy.p7b
│       │   ├── zh-CN
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   └── zh-TW
│       │       ├── bootmgfw.efi.mui
│       │       ├── bootmgr.efi.mui
│       │       └── memtest.efi.mui
│       └── Recovery
├── System Volume Information
│   ├── IndexerVolumeGuid
│   └── WPSettings.dat
├── bootmgr
└── sources
    └── boot.wim
89 directories, 224 files
guest@porteus:~$

Thank you again for responding and sorry I didn't see it sooner.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users