Multiboot USB Flash Disk
From WikiGuruja
Contents |
Introduction
This article provides information on how to create a Multiboot USB Flash Disk. As example a Multiboot Rescue USB Flash Disk will be created. This example is perfect for those people that are used to fix a PC that has virus, corrupted data, memory leak problems, partition problems, (un)delete problems or would like to backup/restore hard disk partitions.
The objective is to build a USB Flash drive with the following partitions:
- Rest of disk - Bootable Partition - free to carry your files.
- 32 MB - PING (backup and restore whole partitions / Drive Image)
- 109 MB - Kaspersky Anti-Virus 2009
- 250 MB - System Rescue CD (GPArted, FreeDOS, MemTest+, Gag (Graphical Boot Manager), Ranish Partition Manager, sfdisk, Partimage, TestDisk, Clam-AntiVirus, NTFS-3g)
The size (in MB) of each partition is defined above.
Needed Tools
Download and extract the latest version of Syslinux.exe. It makes a partition bootable.
Other needed tools will be described here at the right moment.
Solving the partion problem under Windows
Firstly you have to teach your PC how to "see" more than one partition defined in your USB, since Windows (Vista, XP, Server, etc.) will show on Windows Explorer only the first partition.
You do not have to perform this task in other computers, only in the computer you are preparing your Multiboot Rescue USB Flash Disk or PCS you would like to "see" the USB partitions.
To solve this problem follow the instructions bellow:
- Download the Hitachi Microdrive that will tell Windows how to control your USB drive correctly
- Extract it to a directory. It has six files and more or less 20 Kb unzipped. Do not worry about the source code that is also contained in the folder
- Edit the file cfadisk.inf
- Search for the string [cfadisk_device]
- Add the ID specific for your USB Flash Disk. To find the ID, insert your USB stick into the USB port, and run the windows program REGEDIT to check the value for your device. It is located at HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\USBSTOR registry key
- Copy the key to the memory, paste it in Notepad and cut the part USBSTOR\<MYUSBDISK>. Example: USBSTOR\Disk&Ven_Ut163&Prod_USB2FlashStorage&Rev_0.00
- Remove all the entries like this IDE\DiskIBM-DSCM-11000__________________________XXXXXX
- Leave only the entry for your(s) USB Disk(s). Example:
[cfadisk_device] %Microdrive_devdesc% = cfadisk_install,USBSTOR\Disk&Ven_Ut163&Prod_USB2FlashStorage&Rev_0.00
- Save the file cfadisk.inf.
- Open Device manager and select your USB drive in "Disk Drives". You can also right-click on the USB Drive letter under Windows Explorer and choose Properties->Hardware. Select your USB drive on the list.
- Click on Properties->Drivers->Update Driver:
- Don't use windows update
- Install from a list or specific location
- Don't search. Select the option "I will choose the driver to install"
- Have disk
- Browse to location of edited file cfadisk.inf
Now you should be able to see all the partitions of your USB drive disk. Until now we did not created any parttion on the USB disk, but if you had done it before on other PC you should be able to see the partitions. If not, restart windows.
Partioning your USB Flash Drive
You can use the Windows program Control Panel->Administrative Tools->Computer Management to partition your USB drive. You can also use programs like Partition Magic, or the freeware Active@ Partition Manager.
Caution: Do not use GParted. I got partition problems on the USB.
- You have to format all the partitions as FAT32.
- You have to make the first partition active.
Remember to plan and design the size of each partition of your USB disk in order to calculate the needed size of the first partition that must be created firstly:
P1 = Total of MB of the USB - P2 - P3 - ... - Pn - (5 bis 10 MB as Free Space for MBR)
Now, we can install some bootable software on the partitions.
PING
PING stands for Partimage Is Not Ghost. It is a software to backup and restore disk partitions.
About the PING Features:
- Probably the best available Linux toolbox for rescuing a system;
- Backup and Restore partitions or files locally or to the network (MS Network Shared directory, NFS, FTP or SSHFS);
- Backup and Restore the BIOS data as well;
- Either burn a bootable CD / DVD, either integrate within a PXE / RIS environment;
- Possibility to Blank local admin's password;
- Create your own restoration bootable DVD (see the Howto Documentation);
- Partition and Format a disk before installing Windows (so to make sure your unattended Windows installation will happen on the right partition);
Installation
- Download PING
- Extract the files contained in ISO file to the second partition
- Rename the file isolinux.cfg to syslinux.cfg
- Make the partition bootable:
syslinux.exe -mf <drive letter of second partition:>
- Verify that the file ldlinux.sys was created on the root of the partition.
Kaspersky Rescue Disk
Kaspersky Rescue Disk is one of the best bootable anti-virus rescue disk out there with an fully functional option to download latest anti-virus definitions updates from internet.
- Download Kaspersky Bootable Rescue Disk ISO image from the official site.
- Download the Gentoo Linux Bootable USB Maker.
- Extract the file Kaspersky-Bootable-Rescue-Disk.zip.
- Copy kav_rescue_2008.iso to the extracted GentooUSB folder.
- Double-click and launch fixgt2.bat and enter the USB drive-letter to format and create bootable disk.
| |
- Follow the on-screen instructions and your bootable Kaspersky USB Rescue Disk will be ready in minutes.
Use the Kaspersky Universal Updater to update the virus definition of your version embedded in the USB. Some PCs does not have internet connection. Then create a folder in the first partition with the Kaspersky Universal Updater. When you boot the Kaspersky Rescue Disk browse the USB partitions to point to the location of your Updates directory. More information can be found here.
SystemRescueCD
SystemRescueCd is a Linux system on a bootable CD-ROM for repairing your system and recovering your data after a crash. It aims to provide an easy way to carry out admin tasks on your computer, such as creating and editing the partitions of the hard disk.
Some important tools are GPArted, FreeDOS, MemTest+, Gag (Graphical Boot Manager), Ranish Partition Manager, sfdisk, Partimage, TestDisk, Clam-AntiVirus, NTFS-3g.
- Download SystemRescueCd
- Extract the files contained in ISO file to the fourth partition
- Rename the file isolinux/isolinux.cfg to isolinux/syslinux.cfg
- Rename the directory above called /isolinux to /syslinux
- Make the partition bootable:
syslinux.exe -mf <drive letter of second partition:>
- Verify that the file ldlinux.sys was created on the root of the partition.
Installing Grub
In this example all the partitions are bootable. But we are making the first partition active, that means, this partition will be booted first and will redirect the boot process to other partitions on the USB, on the hard disk, network, cdrom, etc. Remember that the second or third partition could be activated and become the first bootable partition. In this case, you hava to use a program to set the bootable flag of the desired partition.
| |
- Download and extract Grub4dos and grubinst, a subproject of Grub4dos.
- Run grubinst\grubinst_gui.exe
- Select the optin "Disk" and select your flash drive from the list. Unfortunatlly you have to guess which one is your disk. If you have only one USB flash disk connected, select the last entry (on the bottom of the list).
- Do not change the other values. Click on the install button.
| |
- Now, copy the file grub4dos\grldr to the active partition of your USB flash disk. In this example, the first partition.
- Create the file menu.lst on the root of the active partition:
color black/cyan yellow/cyan default 0 timeout 30 title Kaspersky Anti-Virus 2009 root (hd0,2) chainloader (hd0,2)+1 boot title System Rescue CD (GPArted, FreeDOS, MemTest+, Gag (Graphical Boot Manager), Ranish Partition Manager, sfdisk, Partimage, TestDisk, Clam-AntiVirus, NTFS-3g) root (hd0,3) chainloader (hd0,3)+1 boot title PING (backup and restore whole partitions) root (hd0,1) chainloader (hd0,1)+1 boot title Windows NT/2000/XP/2003 root (hd1,0) chainloader (hd1,0)/ntldr boot title Windows Vista/Server 2008 root (hd1,0) chainloader (hd1,0)/bootmgr boot
Your USB Flash Disk is ready to boot !
Ready to Go
It is better to run again the Windows program Control Panel->Administrative Tools->Computer Management and make sure that the first partition is really active.
Now, remove your USB securely. The Multiboot Rescue USB Flash Disk is ready to go !
Change the BIOS options of the machine that will boot the USB stick. Modern computers offer the option to press F8 or other key to display a boot menu on the screen during the boot process.
Note: If you get the error message "Error 21: The BPB hidden_sectors should not be zero for a hard-disk partition boot sector.", try to run grubinst\grubinst_gui.exe again.

