How to Repair a corrupt E2B USB drive

If you have accidentally corrupted your E2B USB drive, DON'T PANIC! - here is how to fix it.
 
Note: If prompted by Windows to format the drive - DO NOT FORMAT IT!
 
First - unplug the USB drive - reboot your system - reconnect the USB drive.
 
1. Can you see any files on the USB drive? - If YES then goto #A below.
 
2. (no files) - Use RMPrepUSB - Drive Info - 30 to view a backup sector of the USB drive. 
 
Are the last two bytes 55 AA ? e.g.
 
01F0 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 55 AA  ........ ......UÂȘ
Disk Signature bytes (1B8h-1BBh) = 57 1F 00 00
 
Partition 1   SIZE=30567MiB   Type: 07 NTFS  *ACTIVE*
START POS   = CYL:0 HD:32 SEC:33       END POS = CYL:1023 HD:254 SEC:63
START (LBA) = 2,048 (00000800) SIZE (LBA) = 62,601,216 (03BB3800) [End=62,603,263]
 
Partition 2   SIZE=0MiB   Type: 00        
START POS   = CYL:0 HD:0 SEC:0       END POS = CYL:0 HD:0 SEC:0
START (LBA) = 0 (00000000) SIZE (LBA) = 0 (00000000)
 
Partition 3   SIZE=0MiB   Type: 00        
START POS   = CYL:0 HD:0 SEC:0       END POS = CYL:0 HD:0 SEC:0
START (LBA) = 0 (00000000) SIZE (LBA) = 0 (00000000)
 
Partition 4   SIZE=0MiB   Type: 00        
START POS   = CYL:0 HD:0 SEC:0       END POS = CYL:0 HD:0 SEC:0
START (LBA) = 0 (00000000) SIZE (LBA) = 0 (00000000)
 
P1   Start=2,048 (1,048,576 bytes) End=62,603,263 (32,052,870,656 bytes)
 
If bytes 55 AA are not present, repeat the Drive Info command using 60.
If bytes 55 AA are not present, repeat the Drive Info command using 1.
 
If you found a sector ending in 55 AA, we can write that sector to LBA 0 to restore the original partition table as follows:
 
2.1. RMPrepUSB - Drive -> File - mbr.bin - n - 1SEC - 0     (where n is the backup sector 30, 60 or 1)
2.2. RMPrepUSB - File -> Drive - 0 - 0 - 0                          (writes to LBA 0)
 
You should now be able to see the E2B USB drive contents.
 
Tip: If this frightens you and you have used .imgPTN files, then instead run the .\MPI_Tool_Pack_Plus_CloverLite_0xx\csm\e2b\RestoreE2B (run as admin).cmd script from the MPI Tool Pack download. This should restore the original E2B partition table.
 
Now, re-install grub4dos using:
2.3 RMPrepUSB - Ctrl+B to install standard MBR and then RMPrepUSB - Install grub4dos - Y=MBR - cancel copy of grldr if prompted.
 

Install grub4dos to the the PBR - run RMPrepUSB - Install grub4dos - N=PBR - cancel copy of grldr if prompted.

 
2.4 Now check the filesystem of the USB drive - right-click on the drive letter - Properties - Tools - Check.
From an Admin command prompt (type cmd if in Powershell) run chkdsk U: /f where U: is the USB drive letter.
 
The USB drive should now be restored. If E2B is not working correctly, try the Update E2B Drive command in the E2B download. E2B v1.99 and later has a bug fix for issues when the CSM menu option 0 (Boot to E2B Menu) does not work.
 
If you cannot find any backup sector, run TESTDISK to try to recover any important files that may still be on there and then re-make the E2B USB drive from scratch.
 
If Update E2B Drive does not fix the problem and you suspect file corruption, copy the entire contents of the E2B download folder to the E2B USB drive so that it overwrites all the E2B files on the USB drive.
 

'Cannot find GRLDR' error

If you consistently get this error after following the procedure above:
 
1. Copy all files and folders from the E2B USB drive to a temporary empty folder on your system hard drive (except Windows protected folders)
2. Use Windows Format or Easeus Home Partition Master to format the USB volume as NTFS
3. Copy all the files back to the USB drive
4. Re-install grub4dos by 2.3 above.
- o O o -
 
A. If you can see files on the E2B USB drive...
 
First check and fix the filesystem of the USB drive - right-click on the USB drive letter - Properties - Tools - Check
From an Admin command prompt (type cmd if in Powershell) run chkdsk U: /f where U: is the USB drive letter.
 
Next,  - if you see a \_ISO folder go to #B, if you see a \e2b folder goto #C, if you don't see either folder goto #D
 
B. (\_ISO folder present)
The USB drive has probably lost it's boot sectors.
Run RMPrepUSB - Ctrl+B to install a standard MBR. 
Then run RMPrepUSB - Install grub4dos - Y=MBR - cancel copy of grldr if prompted
Now follow 2.1, 2.2, 2.3 and 2.4 above.
 
C. (\e2b folder present)
The USB drive has probably been switched to a .imgPTN image. 
Use \e2b\SWITCH_E2B.exe - Restore E2B Partitions  to restore the E2B partitions.
If no partition is listed by SWITCH_E2B.exe, the USB drive probably no longer contains a grub4dos MBR or grub4dos boot code, so you can run \e2b\RestoreE2B_32_64.cmd  as Administrator. This should restore the E2B partition(s).
If not try running RMPrepUSB - Ctrl+B to install a standard MBR. Then run RMPrepUSB - Install grub4dos - Y=MBR - cancel copy of grldr if prompted.
 
Also, use RMPrepUSB - File Info - \e2b\MBR.bin - 0 to examine the contents of \e2b\MBR.bin on the E2B drive, it should have an NTFS partition and a type 21 partition, something like this:
 
Partition 1   SIZE=122353.398MiB   Type: 07 NTFS  *ACTIVE*
START POS   = CYL:0 HD:32 SEC:33       END POS = CYL:1023 HD:254 SEC:63
START (LBA) = 2,048 (00000800) SIZE (LBA) = 250,579,759 (0EEF8B2F) [End=250,581,806]
 
Partition 2   SIZE=0.031MiB   Type: 21 Hidden(rsvd)       
START POS   = CYL:1023 HD:254 SEC:63       END POS = CYL:1023 HD:254 SEC:63
START (LBA) = 250,581,807 (0EEF932F) SIZE (LBA) = 63 (0000003F) [End=250,581,869]
 
If it has an NTFS partition at 2048, restore that file to the MBR using RMPrepUSB - File>Drive - \e2b\MBR.BIN - 0 - 0.
 
Once the E2B partition(s) are restored, follow 2.3 and 2.4 above.
 
 
D. (no E2B folders/files present)
If you don't recognise any E2B files, the drive may have been reformatted accidentally by an OS installer!
This may mean that you have lost all or many of your E2B files!
Follow 2.1, 2.2, 2.3 and 2.4 or run TESTDISK to try to recover any important files that may still be on there and then re-make the E2B USB drive from scratch.
 

Corrupt persistence partition?

First, attempt to boot from E2B with persistence so that E2B adds the xxxx-rw persistence file into the partition table. Do not reboot to the E2B menu.
If offered a choice in the Linux boot menu, boot without persistence or in safe mode. Otherwise, boot from a LiveCD or other LiveCD media and then connect the E2B drive.
 
/dev/sdX3 should be the persistence partition (where X is drive letter for E2B drive). Use commands sudo lsblk, sudo fdisk -l, sudo blkid and df to check. 
 
To repair, type:
sudo e2fsck -p -n /dev/sdX3
 

Stiil no good?

If that still does not work then contact me.