Saturday 8 March 2014

Notes on text 'screengrabbing' and data collection in the grub4dos console

Sometimes you may be asked for debug information using the grub4dos shell/console.


The problem is how do you get all this information to the grub4dos developer if this needs to run on a real system and not a Virtual Machine? Normally, you would take a photograph with your digital camera or cell-phone, download the pictures onto your computer and then upload them or email them to the developer.

However, you can use my grab.g4b batch file to capture the screen instead:

1. Download and extract the contents of the Grab.zip file to the root of your grub4dos drive
2. Boot to grub4dos and get to the grub4dos command console
3. Type graphicsmode 3 to get into text mode
4. Execute any debug commands so that the results are displayed on the screen (80chars x 24 lines)
5. Type /grab.g4b to capture the text into the file grab.txt.
6. If you want to capture another screen to a different file, use /grab.g4b 1  to capture the screen text to the file grab1.txt.
      grab.txt, grab1.txt, grab2.txt...grab8.txt are provided in the download. They must exist before the command is executed.
7. You files can now be sent to the developer.


Capturing memory data


If you are asked to send the results of a cat command - e.g.

cat --hex (md)0x4e+3

This will display quite a lot of data - far more than one screen full. You can redirect the output to an existing file using:

cat --hex (md)0xe4+3 > /myfile.txt

as long as myfile.txt exists and is big enough. Note: If using an NTFS filesystem, the file must be at least 1K or more or the writes won't work.

Unfortunately you cannot use more than 3 sectors as the grub4dos redirection buffer appears to be limited to just 8192 bytes - e.g. cat /file1.txt > file2.txt will only work for the first 8192 bytes.

If you need to collect more than 3 sectors of hex data ouput, you can use the mdcat.g4b batch file included in the download.

/mdcat.gb4 0x4e

The results will be in /mdcat.txt - use NotePad++ to open it (not Windows NotePad).








Easy2Boot v1.30 Trial version available

Changes:
  • New file extension .isopup supported for Puppy linux ISOs (no persistence)
  • E2B can now be in a Logical partition on the USB HDD boot drive
  • grub4dos 0.4.6 with USB driver menu option in Utilities menu
  • Option in MyE2B.cfg to use grub4dos 0.4.6 USB driver on start-up of E2B
  • If CheckAccess fails on start-up due to buggy BIOS, the grub4dos 0.4.6 USB drivers are used automatically.
  • Make_E2B_USB_Drive.cmd script improved (Grubinst on an NTFS formatted drive didn't always work + switch to root folder). Now moved to the \_ISO\docs\Make_E2B_USB_Drive folder.
  • Change detection code of WINHELPER.USB file on 'Helper' Flash drive
  • .isoWB file extension (Easy2Boot_v1.30b_TESTONLY.zip)
This version should be considered experimental and can be found via the Alternate Download link on the Easy2Boot.com download page here.

grub4dos 0.4.6a USB driver

Using the grub4dos USB driver helps in cases where some BIOSes contain bugs in their USB driver code, and as a result you may find that one or two 'special' systems will not boot to certain payload/ISO files unless you use the new grub4dos USB driver. See my previous blog for details.

The Main menu in E2B v1.30 now has a new menu entry which has two functions. When you first boot E2B, you will see an entry to 'Switch to grub4dos v0.4.6'. If you select this, E2B will reload E2B using grub4dos 0.4.6 (the file is in \_ISO\e2b\grub\grub_46a).

When the the Main menu reloads, you will now see a Main menu entry 'Install Grub4DOS USB Driver'. If you run this the internal grub4dos USB driver will run and will replace the BIOS USB driver. The Main menu will reload and the the 'Install Grub4DOS USB Driver' menu entry will no longer be present; thus if you don't see this menu entry, it means that the grub4dos USB drivers are already loaded.

If you don't want this new menu entry, simply delete the \_ISO\MAINMENU\ZGrub_USB_046.mnu file.

I have not replaced grub4dos v0.4.5 with grub4dos v0.4.6 because there are still a few problems with it. e.g. running usb --init to load the USB drivers twice under VBox/VMWare seems to cause it to hang; does not detect USB drives on Dell Inspiron 530, does not work very well on reboot - best if run from power on.

Note, when you load the grub4dos USB driver, you will see a brief message about how many USB drives were detected. If it does not detect your USB drive, then the BIOS will still be used to access the USB drive. If you have any systems which don't detect your USB drive (always test from power on, not a reboot), please report it to chenal here. Give give details of the grub4dos version you are using as 0.4.6a Date=20140306 Size=281,839 bytes and the make and model of your system and USB drive.

Wednesday 5 March 2014

Buggy USB support in BIOSes

Most BIOSes can boot from a USB drive these days, but they don't always work well.

For instance, my Asus EeepC 904HA netbook has buggy USB boot code in the BIOS. If I boot to Easy2Boot from my 2TB USB hard disk, when CheckAccess.g4b runs (which checks access to the end of the last partition on the USB boot drive), it reports loads of read errors. This is because the USB code in the BIOS cannot access any sector past 137GB on the USB drive (although the BIOS can access all sectors on the internal hard disk).

For another example of buggy USB BIOS support, see here. In this case Leolo had a system with an AsRock P4i65G board which would not boot successfully to WinPE (Win7 install) from a USB drive - but only the AsRock system - all other systems booted fine.

In the past, one way of getting around this type of buggy BIOS was to use Plop! This loads it's own USB USB 2.0 driver and so does not use the BIOS USB driver. The problem with Plop! is that the driver is read-only. This is OK for primitive booting but not for boot managers which need read/write access to the USB drive (such as Easy2Boot).

In both these cases, using the new grub4dos v0.4.6a  fixes the problem. This version of grub4dos contains a USB 2.0 driver but it is not active by default. You need to issue a command to initialise the USB driver:
      usb --init

The USB driver in grub4dos 0.4.6a still has a few bugs, but the latest (developer) version is looking much better.

When it is robust enough, I will add it in to Easy2Boot. If the CheckAccess.g4b fails, E2B will ask if you want to switch to v0.4.6a. There will also be a variable in the MyE2B.cfg file to use the new version and USB driver, as well as a new Main menu entry (determined by a .mnu file which you can remove if you don't want it).

If you have a system with a 'bad' BIOS that boots to Easy2Boot but no further, you can try the new version with Easy2Boot as follows:

1. Extract the grldr file from here (this is a new, developer test version 5th March 2014 - check here for a later version) and overwrite the grldr file in the root of your E2B drive.

2. Edit the \menu.lst file in the root of the E2B drive and add
usb --init
as the first line, or try 
set /p ask=Use grub4dos USB driver (Y/N) : 
if /i "%ask%"=="Y" usb --init
if you want the option to install the USB drivers.


Tuesday 4 March 2014

Easy2Boot downloads now at www.easy2boot.com

It seems DropBox got upset with me using my DropBox Public folder for others to download E2B+DPMS.zip and so they have suspended my Public folder as there was too much traffic!

So I have now moved the Downloads to the new www.easy2boot.com site.

Saturday 1 March 2014

New Easy2Boot website

I have started a new website dedicated to Easy2Boot at www.easy2boot.com

It should be faster to load and more attractive than the rmprepusb.com site.

Please give me your feedback (my web design skills are sadly lacking, as you may have noticed!)

cheers
Steve

Friday 28 February 2014

Easy2Boot v1.29 now available

V1.29 changes are:

  • New grldr grub4dos file - now shows the case of file names and folder names correctly on FAT32 volumes when in grub4dos console.
  • New .isomemF01 and .isofira01 file extensions added (use .isomemF01 for ERD 2005 XP ISOs)
  • Sample .mnu files added or modified (Porteus-v2.0-i486.mnu, FD0-konboot-v2.1.mnu, dft32_v416_b00_install.mnu, BIOS Detect and Run.mnu, Porteus-generic-persistent.mnu, Win7_8_Install_Auto64_32.mnu, RedHat.mnu, RedHat_NTFS.mnu, 64Bit_Auto_Detect_ISO.mnu, WinBuilderPE_ISO.mnu, ERD5_DPMS.mnu, ERD2005.mnu, ERD5_FIRA.mnu)
  • "E2B TXT Maker" and "E2B MNU Maker" batch files available in \_ISO\docs\E2B Utilities folder. See blog post here for details.

Download from Tutorial 72a here.

Add Microsoft ERD Commander and MSDart Windows Recovery ISOs to Easy2Boot


Microsoft Diagnostics and Recovery Toolset (Microsoft DaRT) allows you diagnose and repair a Windows system that has problems starting or has other issues.


Using Easy2Boot you can even boot directly from an MSDaRT 5.0 XP PE based ISO and repair a SATA Windows XP hard disk even though the MSDaRT ISO does not contain any AHCI mass storage drivers!

You can also boot via UEFI too (see below for details).

DaRT is not available from Microsoft as an .iso file. Instead, you use a program that creates an ISO file, which is based on Windows Recovery Environment (WinRE) and a set of tools that DaRT provides. This boot media starts the Windows RE, from which you can start ERD Commander. ERD Commander provides a launch platform for the DaRT tools.

Note: MediCat contains Win10/8/7 MSDaRT ISOs, just copy it to your E2B USB drive (keep extension as .iso) ;-)

Typically, you use something like the ERD Commander Boot Media Wizard to create the ERD Commander ISO (although this can vary depending on the version you are trying to create). It is easiest to create the ISO on the same type of OS that it was designed for (e.g. you cannot create a Dart 5.0 ISO using a 64-bit Win7 system).

.isoPE01
DaRT 8.1 supports Windows 8.1 and Windows Server 2012 R2.
DaRT 8.0 supports Windows 8 and Windows Server 2012.
DaRT 7.0 supports Windows 7 and Windows Server 2008 R2.
DaRT 6.5 supports Windows 7 and Windows Server 2008 R2.
DaRT 6.0 supports Windows Vista and Windows Server 2008.

.isomemF01 or .isomemwinv
DaRT 5.0 supports Windows 2000, Windows XP, and Windows Server 2003.
ERD Commander 2005 supports Windows NT 4.0 (Service Pack 4 or later required), Windows 2000, Windows XP and Windows Server 2003. There is also an ERD Commander 2007.

Tip: If you download an .msi file which won't run under Win x64, try extracting the .ISO file from it using 7zip.

If your ISO is based on Vista, Win7 or Win8 PE (DaRT6 and above), then simply rename the .ISO file to .isope01 and copy it to a suitable folder (e.g. \_ISO\MAINMENU). You can also add a .txt file if you want to define the menu entry text and help text.


XP-based ISOs

If you have an XP-based ERD/MSDaRT ISO (DaRT5 or ERD Commander 2005), try using the file extension .isomemF01 or .isomemwinv.

To determine which E2B file extension works best, rename the .ISO files to .ISOask, and then you will be able to choose from a variety of different methods (see below).



For XP-based Recovery PE ISOs, you can also try using one of the .mnu files. In E2B \_ISO\docs\Sample menu files - there are three .mnu files you can try:
  1. ERD5_FIRA.mnu    - this uses FiraDisk
  2. ERD2005.mnu         - this uses WinVBlock to load the ISO
  3. ERD5_DPMS.mnu   - this uses FiraDisk+WinVBlock+DPMS (recommended)
Typically, #1 or #2 will work for most systems. However, if you try to boot an XP PE ISO which does not contain AHCI mass storage drivers, once the Windows Recovery OS has booted, it will not be able to see your internal hard disks or may even BSOD.

To overcome this, use E2B+DPMS which has lots of internal mass storage drivers and use the ERD5_DPMS.mnu file (read the instructions inside it) . This mimics the same process as if you were booting from an XP Install ISO file and it will try to identify and load the correct mass-storage driver for the system. This will allow you to boot from an ERD v5 ISO on a SATA/RAID Windows XP 32-bit system and then repair it.

I would recommend that you use the ERD5_DPMS.mnu for any XP-based Recovery ISOs. You can modify the .mnu file as required.

# Use for MSDaRT 5 XP-based ISOs (use DPMS2 version of Easy2Boot for AHCI drivers)
# Make new empty folder, e.g. \_ISO\MAINMENU\MSDART5
# Copy this .mnu file and the single ERD or PE ISO file to the empty folder (one .iso file per folder)

title XP MSDart ERD (DPMS)\n If DPMS is not installed\n Remember to select an AHCI driver\n AND the FiraDisk driver (using F6).
set MFOLDER=$HOME$
pause --wait=3 Press ENTER 3 times to boot...
/%grub%/XPStep1.g4b
boot

Note: E2B v1.A7 and later versions support the .isoDPMS file extension so you don't need to use this .mnu file.

Note that Easy2Boot+DPMS only contains Windows XP 32-bit mass storage drivers (which may or may not work for Windows 2003). If your DaRT is XP 64-bit based, then DPMS will not work. You can still use F6 to load the FiraDisk 64-bit driver for IDE systems (note: the ISO file name must contain the characters '64' so that E2B will not automatically use 32-bit DPMS drivers).


UEFI booting

You can add any number of MSDaRT (or other) images to an E2B drive and boot from each image in both MBR\CSM mode and UEFI mode (if the image supports UEFI booting - so not XP or Vista 32-bit!). The process is as follows:

1. Run MakePartImage.cmd to make a FAT32 partition image file from your DaRT ISO (or from a working MSDaRT USB Flash drive if you have already made one). It is easiest to just drag-and-drop the ISO onto the Windows MPI_FAT32 Desktop shortcut.
2. Copy the .imgPTN file to your E2B USB drive (ensure it has the .imgPTN file extension or try .imgPTNLBAa for better 'bootability')
3. Run WinContig to make sure the file is contiguous (e.g. \Make_this_drive_contiguous.cmd)

For more details visit the www.easy2boot.com site and look for MakePartImage.




Thursday 27 February 2014

How to quickly make Easy2Boot .txt and .mnu files

The next version of E2B will be v1.29. and will include two script (.cmd) files in the \_ISO\docs\E2B Utilities folder:

E2B TXT Maker.cmd    - generates an Easy2Boot .txt file
E2B MNU Maker.cmd  - generates an Easy2Boot .mnu file
Make SubMenu.cmd     - generates a SubMenu .mnu file

New! E2B v1.78 now includes \_ISO\TXT_Maker.exe.

This may prove useful if you want to make .txt files or .mnu files for all your payload files.

The easiest way to use these files is to first copy them to your Windows Desktop.

Now to make a .txt file or .mnu file for any payload file on your E2B USB drive, simply Drag-and-Drop the payload file onto the E2B TXT Maker.cmd icon or the E2B MNU Maker.cmd icon on your Windows Desktop.

The script will then ask you what menu text and help text you want and then make a new .mnu or .txt file (in the same folder as the payload file) on your E2B USB drive.

You can specify a hotkey key by using ^^ before the keyname (^^ will be translated into ^ when the file is made).

Here are some screenshots of them in action:
E2B TXT Maker (red boxes show user entries)

E2B MNU Maker (no help text was entered in this example)

The E2B MNU Maker assumes that the payload (ISO) file will always be in the same folder as the .mnu file. You can edit the .mnu file after it has been generated. By default, the .mnu file simply runs QRUN and forces the file extension to be the same as it already is, using this line of grub4dos code:

      /%grub%/qrun.g4b force.iso $HOME$/rhel-server-5.7-i386-dvd.iso 

However, you can change this to force the file extension to be something different, e.g. to run a Microsoft Windows 7 Recovery ISO as if it had an .ISO01 file extension, use:

      /%grub%/qrun.g4b force.iso01 $HOME$/ERD6.iso

Or you can add in your own grub4dos menu.

N.B. For the MNU Maker script to work, the E2B payload file name must not contain spaces!


If you want to make a new SubMenu folder:
1. Create a new folder under \_ISO (spaces not allowed) - e.g.  \_ISO\RESCUE_WIN
2. Drag-and-drop the new \_ISO\RESCUE_WIN folder onto the Make SubMenu.cmd file and answer the questions.

This will make a new .mnu file in the \_ISO\MAINMENU folder for \_ISO\RESCUE_WIN.
Now put your ISO files, etc. in \_ISO\RESCUE_WIN and you will see the new menu entry in the Main Menu.


Wednesday 26 February 2014

Adding WinBuilder PE and WinFE ISOs to Easy2Boot

WinFE ISO

Today I made a WinFE ISO based on a Win7PESE WinBuilder Project. To make the ISO, I followed the instructions on the Hacking Exposed website here.

Because I wanted to add lots of WinBuilder Win7SEPE ISOs to my E2B USB drive, I added the ISO file to my Easy2Boot NTFS Flash drive using this .mnu file.

title WinFE \n Note: Mount the E2B boot drive to use all applications
/%grub%/qrun.g4b force.iso01 /Win7PE_x86.iso
boot

The WinBuilder ISO file must NOT be renamed and must be copied the root of the E2B drive so that the MountPEmedia.exe utility will find it and mount it as drive Y:. The name and path of the ISO file is pre-defined in the \Windows\System32\MountPEmedia.ini. This is written by WinBuilder when the ISO is created (the .ini file is inside the \sources\boot.wim file image).

It is important to ensure there is no \Win7PESE.ini file or \CdUSB.y file (which you may have extracted from a WinBuilder ISO previously) in the root of any drive as this could 'confuse' the MountPEmedia utility.

When the WinFE Write Protect Tool automatically launches after WinFE boots, you need to select the E2B USB drive and click the Mount button, otherwise the Y: drive (the mounted ISO file) will be inaccessible and you won't be able to run many of the utilities from the Desktop.

Other ways of adding WinBuilder PE ISOs and other PE ISOs to E2B can be found in the E2B Tutorial here.

Tuesday 25 February 2014

Some folders/filenames are not displayed correctly on FAT32 volumes under grub4dos



This seems to be a 'feature' of grub4dos from at least 2009 onwards (and probably from the year dot!).
You may have noticed that grub4dos does not always list all file names and folder names in the correct case.

e.g. under Windows or linux, we can list these files on a FAT32 volume:

AA
bb
Cc
CCC.txt
ddd.TXT
ANTIVIRUS
ANTIVIRU


but the same files are listed by grub4dos in the console as:

aa
bb
Cc
ccc.txt
ddd.txt
ANTIVIRUS
antiviru


I have reported the bug to chenall and suggested a fix which I have tested and it seems to work.