📜 ⬆️ ⬇️

Creating a multiboot USB HDD or flash drive



Bootable USB Flash or HDD drive is convenient because you can stop using CD / DVD to install the OS and use diagnostic programs like Memtest, MHDD, Acronis TI.

A “multi-boot” USB flash drive or HDD is good because you can not format the entire disk for each program, but once install all the necessary programs there and select the right one through the beautiful menu when booting from it. In the case of HDD it is convenient to create a separate small section for this.
')
There are many solutions for flash drives (for example, http://eee-pc.ru/wiki/soft:usb_multiboot ), but, as a rule, they do not work with USB HDD. On Habré, I found only an article about installing Win7 from a USB HDD, but a year ago attempts to reproduce it were unsuccessful. To install Windows 7 from a USB flash drive, there is the MS Win7 DVD Tool , but again it does not work with the HDD. So let's create our multiboot USB HDD using GRUB4DOS.

We will need:


Let's start


  1. Download HP USBFW and format our drive. Usually everyone, including me, skips this step. It may work without it, but personally I tried all the standard formatting options from Windows 7, but the download from my 320GB Toshiba did not work (it hung right after selecting the Boot menu) before using this utility.
  2. If you use HP USBFW from the last item, you can delete the partition created by it on the entire disk and create your own, smaller (FAT32 is desirable, otherwise there may be problems with some programs and OS), and leave the remaining space for the file dump.
  3. Install the GRUB4DOS bootloader in the MBR. It is recommended to use the first option in order not to be mistaken with the choice of a disk or partition.
    1. You can use the GUI: to do this, download grubinst-1.1-bin-w32-2008-01-01 , run grubinst_gui.exe , select the disk, click Refresh in the Part list and select the desired partition. The remaining settings can not touch.
    2. Or in the console with the command:
      grubinst.exe hd( ,  ) 
      The disk number can be found in Disk Management (diskmgmt.msc).
  4. Copy the grldr and Menu.lst files from the grub4dos-0.4.4.zip archive to the root of the section.

You can reboot and check the performance of our multi-boot drive.

To check the performance of many programs, it is not necessary to reboot the computer each time. You can use virtual machines: MobaLiveCD or VirtualBox. For VB we execute in the console:
 "C:\Program Files\Oracle\VirtualBox\VBoxManage" internalcommands createrawvmdk -filename "C:\USBHDD.VDI" -rawdisk \\.\PhysicalDrive1 
where the number in PhysicalDrive is the number of our boot disk, and specify the resulting file (C: \ USBHDD.VDI) as the hard disk when creating the machine. However, some operating systems (for example, Windows 7) may not work this way.

Installation examples of some OS and programs


Memters86 +

Download ISO image off. memtest.org/download/4.20/memtest86+-4.20.iso.zip site and throw it on our bootable HDD (do not forget to unzip the .zip archive).

Open Menu.lst with a text editor, add the following there:
 title Memtest find --set-root /mt420.iso map /mt420.iso (hd32) map --hook root (hd32) chainloader () 

And let's try to figure out what these commands mean.
title Memtest - the name of the item (Memtest), which will be displayed in the menu.
map /mt420.iso (hd32) - download an ISO image located in the root of the boot disk (CD-ROM emulation).
root (hd32) - makes the virtual CD-ROM root.
chainloader () - transfers control to another loader (if nothing is indicated in brackets, then the root is used, in this case hd32).

Ubuntu 10.4


We also throw an ISO image from ubuntu.com on the HDD and write it to Menu.lst (the image is renamed ubuntu1.iso):

 title Ubuntu map /ubuntu1.iso (hd32) map --hook root (hd32) kernel /casper/vmlinuz iso-scan/filename=/ubuntu1.iso boot=casper quiet splash -- locale=ru_RU initrd /casper/initrd.lz 


Windows 7


But with Win 7 is a bit more complicated.

Method 1:


Copy all files from the disk (image) of Windows 7 and add to Menu.lst:
 title Install Windows 7 find --set-root /bootmgr chainloader /bootmgr 


In some cases it works, but various errors may occur during installation. In addition, it will work in this way only if there is one Windows 7 on the hdd, otherwise (for example, if we want to put x86 and x64 there), the installation will be started by the first one found.

Method 2:


A small script that automates some operations (including adding an item to Menu.lst) to change the image. Source - greenflash.su/forum/5-661-1 , there are links to a detailed description of what he does.

Method 3:


Download imdisk , launch, copy the resulting imdisk folder to our disk.
Create files in this folder with the following content:

SetupImDisk.cmd
 @ECHO ON rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 .\imdisk.inf 


SetupCDROM7.cmd
 @ECHO ON Set fullname=%srcdrv%\win7.iso imdisk -a -f %srcdrv%\win7.iso -m #: 


Setup.bat
 @ECHO OFF for %%x in (CDEFGHIJKLMNOPQRSTUVW XYZ) do if exist %%x:\imdisk\SetupImDisk.cmd set srcdrv=%%x: echo Find the USB in %srcdrv%\ echo. cd\ %srcdrv% cd imdisk echo Begin with SetupImDisk.cmd echo. call %srcdrv%\imdisk\SetupImDisk.cmd @ECHO OFF echo. echo Now going to SetupCDROM.cmd echo. pause echo. call %srcdrv%\imdisk\SetupCDROM7.cmd @ECHO OFF echo. echo Done. Have Fun..... echo. pause for %%y in (CDEFGHIJKLMNOPQRSTUVW XYZ) do if exist %%y:\look.win set install=%%y: cd\ %install% cd sources setup.exe exit 

Or we take here already ready folder.

We throw the image of Windows 7 in the root of the disk (do not forget to rename it to win7.iso or change the names in all files accordingly) and add to Menu.lst:

 Title Install Win7 map /win7.iso (hd32) map --hook chainloader (hd32) 


And during the installation of Win 7, when asked for the CD-ROM driver, open the console ( SHIFT + F10 ) and run setup.bat:
 pushd E:\imdisk —      HDD setup.bat 


The source is chapaty.org/kasha/software/usb-hdd-install-iso-win-7-xpubuntu.html .

UPD : automation of this method: rghost.ru/20467691 or greenflash.su/_fr/7/7487664.7z . Files from the archive (except menu.lst and seven.iso) must be copied to the root of the section (or, accordingly, change the path in Menu.lst).

Possible problems and errors



Error 60: Console Disk Area

Solution : you need to defragment the image. For example, using the Contig program from Mark Russinovich. Usage: contig.exe g: \ ubuntu1.iso in the console.

BIOS does not support booting from USB, freezes, long loading and other problems associated with booting from USB HDD

Solution : Plop boot manager . There are a lot of use options and there is not enough space for their description, therefore, instructions in Russian can be found, for example, here .

I hope this article has helped you understand the creation of a multiboot hard disk or flash drive.

A more detailed manual on GRUB4DOS is here (translation into Russian, in places of a curve) or in README_GRUB4DOS from the archive with GRUB4DOS.

UPD1 : rewrite the script from 2 wines7 method: made a mistake and put the old version, it had problems with x64.
UPD1.1 : added an automated 3 way win7.

Source: https://habr.com/ru/post/124482/


All Articles