Create recovery partition to install, backup, restore and repair: multi Ubuntu versions, HBCD-PE-64 and multi Windows installation without usb drive

Create recovery partition to install, backup, restore and repair: multi Ubuntu versions, HBCD-PE-64 and multi Windows installation without usb drive

In this guide we will recognize how to use Ubuntu to make multiboot ntfs partition contains:

  1. the ability to boot from multi Ubuntu versions ISO files or from folder stored outside ubuntu root partition.
  2. the ability to boot from ntfs partition/s (especially for HBCD PE or Windows installation).
  3. no need to use any especial multiboot creation tool.
  4. no need to install grub boot loader in this partition.
  5. ntfs recovery partition boot menu will added to main boot menu as a separate menu to avoid any problem when update any of them.

    enter image description here

    enter image description here

Asked By: Talaat Etman

||

Our steps in this guide to Create ntfs partition contains multi Ubuntu versions, HBCD-PE-64 and multi Windows installation:

1- prepare or create ntfs partition by Ubuntu disks utility.

2- copy your ISO files and other folders to the ntfs partition.

3- edit the ntfs partition boot menu.

4. add ntfs recovery partition boot menu to main boot menu as a separate menu.

5- examin more than one Linux/Ubuntu from your new multiboot ntfs partition.

6- Make filesystem.squashfs from Ubuntu root partition as a backup so we can restore our Ubuntu and we can make Ubuntu live USB by this file.

7- easy method to repair/install Windows (no need to boot by Windows ISO).

1- prepare the ntfs partition by disks utility:

creat and format -16 gb- nfts partition by disk utility, this very usfull fore files > 4 gb.

enter image description here

flag the partition as bootable is optional.

2&3- copy your iso files and other folders to the ntfs partition and edit boot menu:

you can start to add one Ubuntu ISO file to the ntfs partition root directory,
open your text editor and write the new grub.cfg or copy one from any Ubuntu ISO and edit it to make your new boot menu entry. as a example i started my work by Ubuntu budgie ISO and my grub.cfg seems like this:

    set timeout=10
    set default=0
    
    menuentry "Run ubuntu-budgie-18.04.5-desktop-i386.iso"{
            insmod part_msdos
        insmod ntfs
        set root='hd0,msdos4'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  A4025EBD025E93E0
        else
          search --no-floppy --fs-uuid --set=root A4025EBD025E93E0
        fi
     loopback loop /ubuntu-budgie-18.04.5-desktop-i386.iso
     linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-budgie-18.04.5-desktop-i386.iso splash --
     initrd (loop)/casper/initrd
}

Replace `A4025EBD025E93E0` by ntfs partition uuid that can be known from disk utility.
[![enter image description here][2]][2]


this entry can be added directly to main boot menu if you dont want separate boot menu.

save the `grub.cfg` file to the ntfs partition in boot/grub and continue copy the second ISO file to the ntfs partition root directory and add the new menu entry.

Especially for **Ubuntu 23.04** we will add new line to our entry so we can login to test Ubuntu 23.04 not to install it. our neW entry will seems like this:

    menuentry "Try or Install ubuntu-23.04-desktop-amd64"{
        insmod part_msdos
        insmod ntfs
        set root='hd0,msdos4'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  A4025EBD025E93E0
        else
          search --no-floppy --fs-uuid --set=root A4025EBD025E93E0
        fi 
    loopback loop /ubuntu-23.04-desktop-amd64.iso
    linux (loop)/casper/vmlinuz boot=casper layerfs-path=minimal.standard.live.squashfs iso-scan/filename=/ubuntu-23.04-desktop-amd64.iso quiet splash locale=en_US bootkbd=us console-setup/layoutcode=us noeject --
    initrd (loop)/casper/initrd
}

Replace `A4025EBD025E93E0` by ntfs partition uuid.

if you delete `layerfs-path=minimal.standard.live.squashfs` you will login directly to install ubuntu 23.04 so you can add other menu entry for that and it will seems lik this:

menuentry "Try or Install ubuntu-23.04-desktop-amd64" {
            insmod part_msdos
    insmod ntfs
    set root='hd0,msdos4'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  A4025EBD025E93E0
    else
      search --no-floppy --fs-uuid --set=root A4025EBD025E93E0
    fi       
loopback loop /ubuntu-23.04-desktop-amd64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-23.04-desktop-amd64.iso quiet splash locale=en_US bootkbd=us console-setup/layoutcode=us noeject --
initrd (loop)/casper/initrd
}

Feel free to try any other Ubuntu/Linux ISO file and adjust the new menu entry by the new ISO file name.

Now we will try to copy folders from Ubuntu 22.04 ISO to our ntfs partition root and add menu entry to boot from this folders, you will copy all ubuntu 22.04 folders except boot folder. our new entry will seems like this;

menuentry "Try or Install Ubuntu 22.04 backup" {
            insmod part_msdos
    insmod ntfs
    set root='hd0,msdos4'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  A4025EBD025E93E0
    else
      search --no-floppy --fs-uuid --set=root A4025EBD025E93E0
    fi
    set gfxpayload=keep
    linux   /casper/vmlinuz boot=casper file=/cdrom/preseed/ubuntu.seed maybe-ubiquity quiet splash --- 
    initrd  /casper/initrd.gz
}

I use this way because i make a backup from Ubuntu partiton to filesystem.squashfs file so if i make new one or added new thing to my Ubuntu i will replace it in this (casper) folder and no need to replace all Ubuntu ISO for 22.04 version.

enter image description here

note: all of this menu entrys will boot directly to try or install ubuntu except 23.04 adjusted entry will boot to install ubuntu.

Feel free to choose other version and edit its menu entry.

Our last entry will be about another OS like Windows or HBCD PE 64 which builded on Windows 10 64 bit, this very useful tool to repair and install any Windows on your hard disk, with this entry you will need to one file from any Windows ISO and no need to boot by Windows ISO file to fix any problem or make new installation.

Copy all folders -except boot folder just copy its enternal files to boot folder- from hbcd-pe-64.iso to the ntfs partition root and add this menu entry:

menuentry "Windows Recovery Environment HBCD-PE-64" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  55DD0595418E5BFC
    else
      search --no-floppy --fs-uuid --set=root 55DD0595418E5BFC
    fi
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    chainloader +1
}

Replace 55DD0595418E5BFC by your ntfs partition uuid that can be known from disk utility.

if you dont want HBCD you can replace it by any windows 7/8/10/11 files from iso file by the same way but just chang menu entry name, dont chang any other thing. by this way you can boot by other partition if you have, let we say another windows version files from other partiton.

4&5. add ntfs recovery partition boot menu to main boot menu as a separate menu and test your work
go to /boot/grub/grub.cfg in ubuntu root and add this entry:

menuentry "Recovery Partition Boot Menu"{
           insmod part_msdos
            insmod ntfs
            set root='hd0,msdos4'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos4 --hint-efi=hd0,msdos4 --hint-baremetal=ahci0,msdos4  A4025EBD025E93E0
            else
              search --no-floppy --fs-uuid --set=root A4025EBD025E93E0
            fi 
           configfile /boot/grub/grub.cfg
}

save the file, Feel free to reboot and test your all your new menu entrys. also if you dont know how to edit the main grub.cfg file you can add this entry by grub-customizer like this image:

enter image description here

6- How to repair/install Windows (no need to boot by win ISO) from our new ntfs recovery partition:

Extract /sources/install.wim from Windows ISO to your ntfs partition, if you want multi Windows versions you will rename any new extracted install.wim so you will be informed which file to install.

After login in to HBCD open WINNTSETUP programe and choose the appropriate install.wim, Windows partitions, installation settings. after WINNTSETUP finished you can reboot to your new Windows.

note: install windows will delete grub boot loader frome your hard disk so if you installed ubuntu you will have to use boot-repair or ubuntu live USB to restore grub boot loader and add Windows entrys to grub menu so no need to windows boot loader again.

To repair Windows from HBCD you will find many tools like EASYBCD to edit/creat Windows boot menu entrys or install Windows boot loader to your hard disk but same the Windows installation this will delete grub boot loader. ther are many other tools in Hbcd like backup/restor, format/partition, test/fix, and more you can explore them.

Finally i hope this guide will help as an introduction to customize your multiboot ntfs recovery partition that totally will created in ubuntu.

enter image description here

**related:** Create USB drive contains multi Ubuntu versions, HBCD-PE-64 and multi Windows installation https://askubuntu.com/questions/1474717/create-usb-drive-contains-multi-ubuntu-versions-hbcd-pe-64-and-multi-windows-in

Answered By: Talaat Etman