Thursday 5 March 2015

Adding FreeBSD, FreeNAS, PCBSD/TrueOS to Easy2Boot

Update: E2B 1.63 now supports FreeBSD, pfSense and GhostBSD .img files! See blog post here.

Recent versions of FreeBSD, FreeNAS, PCBSD/TrueOS ISOs do not 'just work' when copied to the E2B USB drive. However, if you can make a bootable FAT32 USB Flash drive that works correctly (e.g. using Unetbootin), then it is often possible to use the MPI Tool Kit's MakePartImage to make a .imgPTN partition image file directly from the working USB Flash drive.

Unfortunately, Unetbootin don't seem to be able to make a bootable FAT32 USB flash drive from recent versions of FreeBSD-based ISOs. These more recent versions can only be booted from a USB Flash drive if they are directly imaged using 'dd' (or RMPrepUSB - File->Drive).

Method for transferring Unetbootin files to E2B

1. Using a spare FAT32 freshly-formatted USB Flash drive, use a utility such as Unetbootin to make a bootable USB drive
Note: Do not use the 'dd' method of making a bootable Flash drive as this does not make a FAT32 volume on the USB drive.
2. Test booting from the USB Flash drive on a real system (it may not always work under VBox or VMWare).
3. Drag-and-Drop the USB drive icon (e.g. H:) onto the MPI_FAT32 Desktop shortcut to create a .imgPTN file.
4. Copy the new .imgPTN file to your Easy2Boot USB drive (e.g. \_ISO\LINUX)
5. Run WinContig to make all files on the E2B USB drive contiguous
6. Now boot to E2B and test the new .imgPTN file.


I used Unetbootin (UNB) to test a few ISOs or .img files with the results below:

FreeNAS-amd64-LiveCD- E2B-OK (direct boot from E2B, .img.gz also boots)
FreeNAS-amd64-LiveCD- UNB-OK E2B-OK
FreeNAS-9.3-STABLE-201502162250.iso UNB-FAIL
FreeNAS-8.2.0-RELEASE-p1-x64.iso UNB-FAIL

TRUEOS10.1.1-RELEASE-01-31-2015-x64-DVD-USB.iso UNB-FAIL
TRUEOS10.1.2-PRERELEASE-02-20-2015-x64-DVD-USB.iso UNB-FAIL

According to here, FreeBSD 10 does not work with Unetbootin.
FreeBSD-10.0-RELEASE-amd64-bootonly.iso UNB-FAIL
FreeBSD-9.3-RELEASE-i386-disc1.iso UNB-FAIL
FreeBSD-9.2-RELEASE-amd64-memstick.img UNB-FAIL
FreeBSD-8.4-RELEASE-amd64-bootonly.iso E2B-OK (direct boot)
FreeBSD-8.4-RELEASE-amd64-disc1.iso E2B-OK (direct boot)
FreeBSD-8.0-RELEASE-amd64.iso UNB-OK E2B.imgPTN-OK (direct boot)

So it seems there was a change somewhere between 8.0 and 9.2 which stopped Unetbootin from working...

Note: see next blog post to see how I got FreeBSD images working.

UEFI- and MBR-boot pfSense v2.4 using Memstick image

You can MBR-boot by using the .ISO version of pfSense and rename it as .isoBSD.

However, if you try to convert the ISO to a FAT32 .imgPTN file (ignore the 7Zip errors) it will start to UEFI64 boot but then fail to find the iso9660 cd device.

Here is how to UEFI-boot from pfSense using the MemStick image...

1. Download pfSense-CE-memstick-2.4.4-RELEASE-p3-amd64.img.gz
2. Use 7Zip to extract the pfSense-CE-memstick-2.4.4-RELEASE-p3-amd64.img file
3. Use 7Zip to extract the large 1.img BSD Slice file directly to \_ISO\LINUX\pfSense on the USB drive
4. Use 7Zip to extract the contents of 0.img to a new (Desktop)\pfsense folder - the folder should now contain a \EFI sub-folder.
5. Drag-and-drop the folder (Desktop)\pfsense to the MPI_FAT32 Desktop shortcut - choose a destination of \_ISO\LINUX\pfSense.imgPTN on the USB drive.

You should now have these two files on your E2B USB drive:
  • \_ISO\LINUX\pfSense                (750MB)
  • \_ISO\LINUX\pfSense.imgPTN (38MB)
6. Make the files on the E2B drive contiguous.
7. Use Switch_E2B (use default 0x83 for partition number - any non-zero number will do) or boot to the E2B menu and select the \_ISO\LINUX\pfSense.imgPTN file.

Now we need to ensure that the pfSense partition is on partition 2 and not partition 3 by modifying the menu.lst file...

8. Now load the \menu.lst file in Notepad and add the following lines shown in red to just below the set VER= line near the beginning of the file:

set * && set DONE=%DONE% && set NOF9R=%NOF9R% && set GFX=%GFX% && set NOF7HD=%NOF7HD% && set NOF10H=%NOF10H% && set CMD2T=%CMD2T% && set pwd=%pwd% && set USBOPT=%USBOPT% && set DEFMENU=%DEFMENU%
set VER=0.96

#modify for pfSense Memstick image
#move ptn 3 to ptn2 in ptn table
parttype (hd0,2) > nul
set P2=%@retval%
if not %P2%==0 dd if=(hd0)0+1 of=(hd0)0+1 skip=0x1de seek=0x1ce count=16 bs=1 > nul
#remove ptn 3
if not %P2%==0 dd if=(hd0)0+1 of=(hd0)0+1 skip=0x1ee seek=0x1de count=16 bs=1 > nul
if not %P2%==0 parttype (hd0,1) 0xA5 > nul

The E2B USB drive should now UEFI64 boot to pfSense (but not MBR-boot).

Note that you MUST MBR-boot to the switched E2B drive first. If you just use Switch_E2B.exe to select the pfSense image and then try to UEFI-boot, it will not work!

If you also wish to MBR-boot to pfSense also, then add these lines to the bottom of the \menu.lst file:

title pfSense\nBoot to partition 2
chainloader (hd0,1)+1

No comments:

Post a Comment