Saturday, 17 March 2018

Add BlackArch LiveCD (MBR+UEFI) to E2B

The BlackArch Linux LiveCD ISO can simply be added to the E2B USB drive (e.g. \_ISO\LINUX\blackarchlinux-live-2017.12.11-x86_64.iso).

Because the file is larger than 4GB, your E2B USB drive will need to be formatted as NTFS.

This will allow us to Legacy\MBR boot, but what about UEFI-booting to BlackArch Linux?

Well, the E2B grub2 menu system will UEFI-boot from the ISO, but what if we want to use a .imgPTN file instead?

We cannot simply drag-n-drop the blackarchlinux-live-2017.12.11-x86_64.iso file onto the MPI_FAT32 Desktop shortcut to make a .imgPTN file, because there is a large (>4GB) .sfs file inside the ISO.

Here is how to add BlackArch Linux to your E2B USB drive (preferably a large E2B USB HDD) and both UEFI and MBR boot to it.

Instructions

1. Download the latest LiveCD ISO - e.g. blackarchlinux-live-2017.12.11-x86_64.iso

2. Create a new, empty folder called BlackArch on your Windows Desktop

2. Using 7Zip, extract all of the folders inside the ISO file (except the [BOOT] folder) to a new empty BlackArch folder on your Windows Desktop.

IMPORTANT: Check the size of the \blackarch\x86_64\airootfs.sfs file is at least 7GB. If it is only 3GB then the file was not extracted correctly! That is why I recommend 7Zip, because some utilities do not correctly extract this large file.

3. Create a new, empty folder called BlackArch2 on your Windows Desktop

4. Copy the blackarch folder from BlackArch to BlackArch2

5. Delete the blackarch\x86_64 folder from the BlackArch folder

Your two Desktop folders should now look like this:

BlackArch
\blackarch (contains boot folder and txt file)
\EFI
\isolinux
\loader

BlackArch2
\blackarch (contains x86_64\airootfs.sfs of a least 7GB in size)

6. Drag-n-drop the Desktop ArchBlack folder onto the MPI_FAT32 Desktop shortcut.
Choose a location on your Windows hard drive to save the file - e.g. C:\temp\BlackArch.imgPTN.
Skip the installation of syslinux if prompted.

7. Drag-n-drop the Desktop ArchBlack2 folder onto the MPI_NTFS Desktop shortcut.
Choose a location on your Windows hard drive to save the file - e.g. C:\temp\BlackArch.
Note that you must use an identical filename to the previous .imgPTN file, but this time it has no file extension.

8. Copy the BlackArch.imgPTN and BlackArch files to your NTFS E2B USB drive (e.g. \_ISO\LINUX folder)

9. Run the \MAKE_THIS_DRIVE_CONTIGUOUS.cmd script.

10. Make sure you have plenty of free, contiguous space on your E2B drive for this next step, because we may need to re-order the two files on the E2B drive...

Run \_ISO\SWITCH_E2B.exe and double-click on the pair of files which should be listed as:

\_ISO\LINUX\BlackArch.imgPTN & BlackArch

Allow SWITCH_E2B.exe to re-order the files, if required. This may take a long time or may fail if you do not have sufficient contiguous free space on the E2B drive.

In case of difficulty, use Defraggler - Advanced - Defrag Freespace to defrag the E2B drive and then run \MAKE_THIS_DRIVE_CONTIGUOUS.cmd again and then try SWITCH_E2B.exe again.

You will need at least 10GB of contiguous free space on the E2B drive for the file re-ordering to work.

If the files are not in the correct order, UEFI-booting may fail to work.

10. At this stage, you should have successfully switched in the two new partitions.

However, both partitions will be named 'EASY2BOOT'.

Right-click on the smaller partition volume letter icon (approx 120MB) in Explorer - click on Properties and change the Volume name from 'EASY2BOOT' to 'BLACKARCH' (or whatever you like).

11. Finally, for MBR\Legacy booting we must add the following menu entry to the bottom of the \menu.lst file in the BLACKARCH (120MB) volume.

title BlackArch Linux\n Boot to BlackArch Linux in MBR mode
kernel /blackarch/boot/x86_64/vmlinuz archisobasedir=blackarch archisolabel=EASY2BOOT
initrd /blackarch/boot/intel_ucode.img /blackarch/boot/x86_64/archiso.img
boot



If you wish, you can tidy up the EASY2BOOT larger partition by deleting all files and folders except the blackarch folder.

You can also remove the surplus menu entries for MBR booting in the BLACKARCH\menu.lst file.

To login to BlackArch Linux, UserName=root, Password=blackarch.

Boot Problems?

If the startup boot messages show that the loop0 device was successfully mounted, then the boot files are probably correct and it should boot correctly.

However, I found that although testing under VirtualBox was 100% reliable, when testing on real systems using USB 3 Flash drives or USB 3 SSD hard drives, BlackArch could fail to boot and report file corruption or I/O sector errors after successfully mounting the loop0 device.

Often, using a USB 2 port instead of a USB 3 port proved successful, or using a non-UASP USB hard disk enclosure.

You could also try using a USB 2 extension cable if your system has only USB 3 ports.

Good luck!