Steve's blog about RMPrepUSB, Easy2Boot and USB booting. Please tick one of the 'Reactions' boxes if you enjoyed a post.
Visit www.rmprepusb.com for over 130 Tutorials on USB booting or www.easy2boot.com for a unique USB multiboot solution.

Wednesday, 19 August 2015

Is your E2B USB drive too slow?

Easy2Boot needs to enumerate all the files in and under the \_ISO\MAINMENU folder when it first boots and also needs to count the files in the \_ISO\WINDOWS folders. Some people find that, on some systems, the wait to display the E2B Main Menu is too long.

Possible causes:

1. A Slow USB drive

Many cheap USB 2.0 drives are quite slow. If you are using an SD card in a USB 2.0 SD card reader these are notoriously slow.

Even if your system only has USB 2.0 ports, a USB 3.0 Flash drive will nearly always give better performance than a USB Flash drive which has a USB 2.0 controller inside it.

Tip: From previous personal experience, I would avoid Mushkin Flash drives for reasons of compatibility and reliability (IMHO). Also, E2B works best from a 'Removable' type of USB Flash drive, so try to ensure you buy one of the Removable types if possible.

2. A slow BIOS

The speed of the CPU or memory in the system is not very significant, compared to the sector read access time of a USB drive. It is slow USB sector accesses that causes slow E2B boot times,other boot code is executed virtually instantaneously compared to disk accesses.

All x86 computers have an IBM-compatible BIOS or UEFI BIOS. In order to boot from a USB drive, this BIOS must have it's own USB driver code. It is worth checking that the BIOS Setup menu has been configured to enable USB 2.0 (Hi-Speed).

The BIOS driver can be written in a number of ways. Good USB driver code should use interrupts and DMA to make the best use of the speeds that the USB 2.0 or 3.0 protocols can provide.

By the way:

There is a similar BIOS driver scenario when booting from an IDE internal Hard disk. During my time working at RM, I often found the BIOS IDE driver code in a new system that I was evaluating, did not use DMA. This meant the end-user hard disk backup/restore program that we shipped with each system, which used the BIOS for disk access, performed poorly. I often had to ask the BIOS developers to change the BIOS IDE driver code so that it used DMA. This improved the performance of the backup/restore program dramatically. The end user could then restore the original factory XP image from the backup partition of the IDE hard disk to the main OS partition in under 2 minutes using the RMRestore backup/restore boot utility that was shipped with each system.

You can test your BIOS USB driver by using the Easy2Boot - Utilities - Measure BIOS USB performance test. For 100 loops, (booting on a real system, not a VM!) it should take between 3-10 seconds for a decent USB drive. Try comparing different systems (notebooks and PCs), you may be surprised at the difference in results between different BIOSes.

Note: If you perform the same test under a VM (e.g. VBox) it is usually much faster because it is using the Windows driver to access the USB drive. If you use QEMU, you will get a poor result (e.g. 40-60 seconds for 100 loops) because QEMU is a CPU+system emulator.

How to reduce the E2B boot time

You can use your USB 3.0 drive in a USB 3.0 port, however, bear in mind that Windows 7 and many linux distros do not contain USB 3.0 drivers, so these may not work if you use E2B in a USB 3.0 port, because they will not be able to detect the E2B USB drive once they start to boot.

If you are using a USB 2.0 port (not in a VM), you may be able to replace the BIOS USB driver with the USB 2.0 driver which is included in version 0.4.6a of grub4dos (the default version that is used by E2B).

First run the 'Install fast Grub4dos USB 2.0 driver' menu entry in the Utilities Menu (see above). If that detects your USB drive, try the 'Measure BIOS USB Performance' test again. If it is much faster, you can now try booting from a large ISO on the E2B USB drive - it should load much faster than before.

You can make the grub4dos USB driver load automatically by modifying the \_ISO\MyE2B.cfg configuration file and adding set GRUB_USB=Y, however I don't recommend this as it can cause problems on some systems (e.g. you lose the USB keyboard!) - it is best to use the Utilities Menu - 'Install fast Grub4dos USB 2.0 driver' entry only when you need it.

Another way to make the Main Menu load faster is to enable the 'FASTLOAD' feature in E2B. This causes the Main Menu to be cached once it has been booted for the first time.

Of course, it helps to keep as few files as possible under the \_ISO\MAINMENU folder and under the \_ISO\WINDOWS folder, so delete any unused files or move them to a different menu folder if possible.

Grub4dos seems to take twice as long to access files on an NTFS USB drive compared to a FAT32-formatted USB drive. If you are not going to use files over 4GB in size, you can improve the grub4dos file access times (and thus reduce the time it takes to reach the Main Menu) by using FAT32 for your E2B USB drive.