Jump to content











Photo
- - - - -

Easy2boot RestoreE2B modified


  • Please log in to reply
15 replies to this topic

#1 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 25 September 2014 - 11:47 PM

Steve, I have a question for yah relating to your tools, namely RMpartUSB and my multi-boot drive using your wonderful E2B (This post seems the most logical of the ones you seem to be watching to post it in, sorry in advance if I got it wrong).

 

So I have gotten a new drive and in the process of copying my stuff over to the new drive I see you updated E2B and I decided to update my toolsets, and making use of your new features and the fact I had driver packs become not accessible due to the new fancy partition mapping you do to support uefi, I have finished working up a work around but have one last snafu that Google isn't helping with and I believe you are the author of the program with the snafu.

 

For better or worse I have edited your 'RestoreE2B (run as admin).cmd' into 'RestoreE2Bscript.cmd' having changed 1 or 2 lines and deleting 4 to 5 lines, code as follows

@ECHO Off
cls
SETLOCAL ENABLEEXTENSIONS
color 1f
echo.



pushd "%~dp0"
if exist "%systemdrive%\Program Files\RMPrepusb\RMPartusb.exe"  pushd "%systemdrive%\Program Files\RMPrepusb"
if exist "%systemdrive%\Program Files (x86)\RMPrepusb\RMPartusb.exe" pushd "%systemdrive%\Program Files (x86)\RMPrepusb"
if not exist RMPARTUSB.exe echo Please install RMPrepUSB to the standard Program Files location & echo OR copy RMPartUSB.exe to %~dp0! & pause & goto :end

echo %~n0 [SSi] v1.00
echo.

echo SELECT A USB DRIVE
echo ==================
echo.
rmpartusb% LIST | find "DRIVE"
echo.
set DD=
set /a DD=1
if "%DD%"=="" goto :end
if "%DD%"=="0" goto :end

set LBA=30
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

set LBA=60
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec

set LBA=1
set MBR=
set PTN=
call :getsec
if "%MBR%%PTN%"=="11" goto :gotsec
echo No backup MBR found! & pause & goto :end


:gotsec
RMPARTUSB drive^=%DD% usbinfo usbstart^=%LBA% LENGTH=1SEC sure
echo Found backup MBR at SECTOR %LBA%
echo.

:: MUST NOT USE USB drive to store .TMP file as RMPartUSB cannot access it after dismounting the volume!

:: Save LBA 0 to E2B0.TMP
RMPARTUSB USBTOFILE drive=%DD% FILE="%TEMP%\E2B0.TMP" USBSTART=0 LENGTH=1SEC FILESTART=0 SURE > nul

RMPARTUSB USBTOFILE drive=%DD% FILE="%TEMP%\E2B%LBA%.TMP" USBSTART=%LBA% LENGTH=1SEC FILESTART=0 SURE > nul
if errorlevel 1 goto :end
RMPARTUSB FILETOUSB drive=%DD% FILE="%TEMP%\E2B%LBA%.TMP" USBSTART=0  LENGTH=1SEC FILESTART=0 > nul
if errorlevel 1 goto :end
echo MBR Restored OK
pause

:end
popd
endlocal
GOTO :EOF


:getsec
FOR /F "tokens=16,17 delims=- " %%A IN ('RMPARTUSB drive^=%DD% usbinfo usbstart^=%LBA% length=1sec sure`^| FIND "01F0"') DO (
if "*%%A*%%B*"=="*55*AA*" echo Found MBR & set MBR=1
)
FOR /F "tokens=4 delims=- " %%A IN ('RMPARTUSB drive^=%DD% usbinfo usbstart^=%LBA% length=1sec sure`^| FIND "01C0"') DO (
if not "*%%A*"=="00" echo Found Partition 1 Entry & set PTN=1
)

goto :eof

:check_Permissions
    >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
	REM --> If error flag set, we do not have admin.
	if '%errorlevel%' NEQ '0' (
        echo.
	echo Sorry - you need to run this script as Administrator.
        echo.
	echo Please use right-click - Run as administrator.
	echo.
	echo.
	color cf
	pause
	Set ADMIN=FAIL
    ) else (
	echo Administrative permissions confirmed.
    )


The idea being to use it as part of a startup script on auto pilot. almost all prompts have either been removed or hard coded save one that is a dialogue box courtesy of RMpartusb. is there a way to prevent or auto acknowledge that dialogue box with no user interaction?

 

PS: this is intended for use in modified pe3 where by default you are already administrator, the idea being as before this script is run the main drive where I keep my driver packs is inaccessible and they are scripted into the start up of said pe3. So what I am doing is running this do get drive access back, running imdisk to remount the image elsewhere and then with the drive once again accessible the drivers go ahead and load.



#2 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 26 September 2014 - 06:36 AM

The parameter  SURE  will get rid of any prompts.



#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 26 September 2014 - 07:16 AM

P.S. If you use .imgPTN23 then 2nd and 3rd partitions on E2B USB drive will be left in place.
So you could keep any drivers/software etc, on the 2nd partition.

#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 September 2014 - 08:26 AM

(This post seems the most logical of the ones you seem to be watching to post it in, sorry in advance if I got it wrong).

 

The second you said.

 

A thread (normally) has a title which is the actual topic, and though everyone seems to forget it, it would be a good idea to use that as a reference (as opposed to last post by a given member or the contents of last post by a given member).

 

There are PM's if you want to address privately another member and in the case of Easy2boot ans Steve6375 there is a dedicated support board:

http://www.easy2boot.com/forum/

 

:duff:

Wonko



#5 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 26 September 2014 - 07:21 PM

@ steve Thank you for the 'SURE' parameter. On the note of the tidbit about using ' .imgPTN23 ' had I been aware of that a week ago I might be working on that avenue now as I had explored doing that but quit when I discovered the second partition was also not accessible. Making the filter driver work to see the second partition via script proved difficult, and when I realized the point was moot because the whole of the drive was innaccessable while mapped I pursued this option which seemed simpler, please see here (I may not be pursueing that at the moment but your opinion and advice on that thread is welcome as I may eventually come back to that idea).

 

I havent been able to test the 'SURE' parameter yet but in a few hours I will.

 

@ wonko

 

I Honestly havent ever looked at the PM function that I can recall and being on the fourm is more desirable as more people can input. That said I clicked onto steve's profile pulled up the page that showed where he posted and found one that seemed very similar to what I was doing hence I posted there. Moving my post such as was done I assume by you but I'm not sure risked me not finding it again, I was lucky that it was still on the recent posts list on the main page, I dont believe it was very if at all off topic where it was.



#6 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 26 September 2014 - 08:03 PM

Also Steve your newest version of e2b has a new menu item to switch up which version of grub is being used, this is extreamly cool, but for the life of me I cannot find which mnu file and or e2b grub script has the displayed line of text. As you will see in the picture I am attaching it is a little to long to be displayed right in my menu and if I can find where that string of txt is I can edit it so it looks better.10574148_10154629001350177_1659091921369



#7 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 September 2014 - 09:47 AM

@ wonko

I Honestly havent ever looked at the PM function that I can recall and being on the fourm is more desirable as more people can input. That said I clicked onto steve's profile pulled up the page that showed where he posted and found one that seemed very similar to what I was doing hence I posted there. Moving my post such as was done I assume by you but I'm not sure risked me not finding it again, I was lucky that it was still on the recent posts list on the main page, I dont believe it was very if at all off topic where it was.

Which is good, as it means that we can have different opinions on how a technical board should be organized.

The topic where you posted:
http://reboot.pro/to...ith-everything/
was (and is) NOT related to Easy2boot and not even to RMprepUSB, until it was ALREADY hijacked and re-hijacked towards Easy2boot.

The concept is that there is a TOPIC and people posts on that TOPIC or starts a new THREAD on a new TOPIC.
Possibly the TITLE of the thread should be MEANINGFUL and RELATED to the TOPIC.

It is not difficult, nor particularly complex, and of course it is just one of the possible way to manage posts, ultimately we could make just a single sub-forum, with a single thread like "Post here anything that cross your minds about anything" so that the thread would be easier to find (though information - if any - in it will be much tougher to find).



You posted this:

Steve, I have a question for yah relating to your tools, namely RMpartUSB and my multi-boot drive using your wonderful E2B

which sounds a lot as a one-to-one request for support.

As said, if you want one-to-one support for Easy2boot you can have it fine via it's support forum and if you want to contact Steve6375 you can PM him.

And this:

(This post seems the most logical of the ones you seem to be watching to post it in, sorry in advance if I got it wrong).

Rest assured you got it wrong, and now you have been told why, though you didn't sound as sorry as you promised.

Of course you are perfectly free to consider not my suggestions and to post wherever you feel like to.

:duff:
Wonko

#8 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 September 2014 - 10:15 AM

@tblo

Hi.......

I am also using slightly modified 'RestoreMBR'.

http://reboot.pro/to...e-2#entry187781

Can you please tell me about the advantages of using .imgPTN23 extension in your case ?

Are you using Fixed type USB Drive ?

For which payload file you need to access PTN2 or PTN3 for DRIVER PACK ?

Can you please describe your case in little detail so that I can also improve my 'Restore_PTN.cmd' if necessary ?

Regards.....

#9 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 29 September 2014 - 10:26 PM

Sorry for the late reply!

@ wonko

When I first posted to that thread, the posts I first glanced at near the end seemed to be relavent, when I went back and looked shortly after my last post in this thread, I had to do a double take when I saw the dates and read the older posts, indeed it was hijacked and eventually rehijacked by me sorry!

@devdevadev

I am not using the '.imgPTN23' method though I had researched something that could/would have made use of it.
when I first started loading my new drive and updating e2b and converting my iso's to .imgPTN I noticed that my custom pe3's could not read the drivers or programs on the e2b drive because the way the .imgPTN file was mapped. My first split second idea was to load those files on a second flash drive but that would defeat the idea of this drive to me. So the following idea was to was to create a seprate space that would appear as a second drive so I could still access the drivers and programs however, removable media (flash drives) are prevented by windows from having multiple partitions. I found a driver that would trick windows into thinking that a removable flash drive was a fixed disk so that it would then allow multiple partitions however, I could not find a way to script install the driver that did this trickery. I also found out the idea was flawed as the e2b .imgPTN mapping also prevented access to that second partition (.imgPTN23 would have fixed that issue but I still would need a script to load the driver and that had failed aswell). I did not know about the .imgPTN23 option until steve posted it in this thread, at which point I had already abandoned that line of research.

I currently have a modified restore e2b cmd that has been simply modified so not to need any user input and set it to run upon pe3 startup so I can use the drivers and programs stored on the flash drive, then I have another line in the script use imdisk to remount the .imgPTN as a virtual cd drive so if anything is needed from the disk image it too is available, only one partition needed and this script is well within my current abilities.

@ Steve6375

I did find where that menu item was, though another bit of txt in same file said not to edit it (I did anyway but made a backup first).

I do however have 2 more questions.

When booting using an .imgPTN file the e2b drive gets mapped and that script is needed to put thing back to their original state. If I reboot with out pulling out the flash drive and have not run the restore e2b script I get a blinking dot in the top left of the screen (I am building / testing on a toshiba portege z930 mbr not uefi) that wont go away till the flash drive is pulled and the pc restarted (then it boots normal, and I can run the script from within normal windows). I see on the CSM/UEFI secondary menu that comes up during boot that one of the items is to restore e2b however, if I reboot at that point or after I get the blinking dot, is there a way to make the computer be able to boot into that menu where I can either boot back into the mapped environment or select the restore e2b line item?

Second question (should be easier) I figured out how to change the CSM/UEFI menu background picture, however the display color of the text in that menu is a bit hard to read with the colors in the picture behind it, as yet I have not yet found out how to change txt color, so any advice there would be apprciated.



#10 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 29 September 2014 - 11:06 PM

@ Steve6375

I did find where that menu item was, though another bit of txt in same file said not to edit it (I did anyway but made a backup first).

I do however have 2 more questions.

When booting using an .imgPTN file the e2b drive gets mapped and that script is needed to put thing back to their original state. If I reboot with out pulling out the flash drive and have not run the restore e2b script I get a blinking dot in the top left of the screen (I am building / testing on a toshiba portege z930 mbr not uefi) that wont go away till the flash drive is pulled and the pc restarted (then it boots normal, and I can run the script from within normal windows). I see on the CSM/UEFI secondary menu that comes up during boot that one of the items is to restore e2b however, if I reboot at that point or after I get the blinking dot, is there a way to make the computer be able to boot into that menu where I can either boot back into the mapped environment or select the restore e2b line item?

Second question (should be easier) I figured out how to change the CSM/UEFI menu background picture, however the display color of the text in that menu is a bit hard to read with the colors in the picture behind it, as yet I have not yet found out how to change txt color, so any advice there would be apprciated.


The grub4dos menu is in \_ISO\MAINMENU\ZGRUB_USB_046.mnu

Do NOT edit any E2B files! In this case, if you just want to change the menu text, use \_ISO\MyE2B.cfg and set a special LANGUAGE value - e.g.
if "%LANG%"=="" set LANG=tblo
then copy the contents of the \_ISO\e2b\grub\ENG folder to a new folder at \_ISO\e2b\grub\tblo
Now you can edit the STRINGS.txt file - for the grub4dos menu - you need to edit $$STRm014 and $$STRm015

The other way of doing this is to RENAME the \_ISO\MAINMENU\ZGRUB_USB_046.mnu file to say \_ISO\MAINMENU\ZGRUB_USB_046tblo.mnu and then simply change the $$STRm014 and $$STRm015 text to be your own title and help text - that way, when you update E2B with the next version, it won't overwrite any of the changes you have already made.


re. your .imgPTN boot issue - does it boot correctly using QEMU or a VM - or is the boot problem just on a real system?

The colours are set in the \menu.lst file - not sure why you are having problems setting colours when I specifically added text to help???

# -------- MENU COLOURS -------
# Colour pairs are Text/Background - i.e cyan/blue = cyan text on blue background
# Use black if a transparent background is required for menu highlight background - e.g. highlight=red/black
# Valid colours are: black, blue, green, cyan, red, magenta, brown, light-gray, dark-gray, light-blue, light-green, light-cyan, light-red, light-magenta, yellow and white.
#  normal    = normal menu text
#  highlight = highlighted menu text when a menu entry is selected
#  helptext  = the colour of the title help text shown just below the menu box
#  standard  = the console background and text colours (e.g. when listing files)
#  border    = the colour of the border of the menu box

color normal=light-cyan/black highlight=yellow/dark-gray helptext=white/black standard=light-cyan/black border=light-green/black

If you want to change the MPI 'payload' then use the CUSTOM folder (don't alter the MPI files).
See http://www.easy2boot.../makepartimage/ - Modifying the CSM Menu heading for more details.
HTH
Steve



#11 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 30 September 2014 - 01:17 AM

re. your .imgPTN boot issue - does it boot correctly using QEMU or a VM - or is the boot problem just on a real system?

The colours are set in the \menu.lst file - not sure why you are having problems setting colours when I specifically added text to help???

 

 

Ok so having just tested via QEMU via RMprepUSB it boots fine even when the .imgPTN is mapped in the MBR!

 

The colors issue had more to do with my lack of GRUB knowledge and being one of the least important issues I just hadent looked into it to realize the menu.lst was the major player. Per your response and the helpful comments that is taken care of in one image with the others soon to follow! (thanks!!!)

 

As my real machine will not boot with the mbr .imgPTN map inplace (either to its own hdd or the flash drive) but QEMU show that clearly on some level it is bootable. It will boot fine to the normal E2B setup and it will boot fine to its own internal HDD (assuming the flashdrive is either not mapped and or removed). the CSM/UEFI menu loads/boots fine when chainloaded from the E2B menu just not from a pc cold start or reboot. what does this mean & are there any work arounds?



#12 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 30 September 2014 - 08:15 AM

Your system is probably one that needs two or more partitions in order to boot from the USB drive as a hard disk.

Try using EaseUS Home Partition Master to create a 2nd primary partition if it does not have one already (just a very small one at the end of the drive.) - in the normal E2B state.
Then change the filename of the .imgPTN file to .imgPTN23 - this will cause E2B to leave partitions 2 (and 3 if present) in the partition table, so that the CSM mode will now have two partitions and the BIOS will see two partitions and boot the USB drive as a hard disk rather than a floppy disk.



#13 tblo

tblo

    Frequent Member

  • Advanced user
  • 151 posts
  • Interests:Technology, Science, Art, philosophy!
  •  
    United States

Posted 01 October 2014 - 02:34 AM

You system is probably one that needs two or more partitions in order to boot from the USB drive as a hard disk.

Try using EaseUS Home Partition Master to create a 2nd primary partition if it does not have one already (just a very small one at the end of the drive.) - in the normal E2B state.
Then change the filename of the .imgPTN file to .imgPTN23 - this will cause E2B to leave partitions 2 (and 3 if present) in the partition table, so that the CSM mode will now have two partitions and the BIOS will see two partitions and boot the USB drive as a hard disk rather than a floppy disk.

 

Ok so the good news is that upon implementing this fix my bios based PC can boot/load itself directly to the mapped partition!

 

The bad news, (I have not tested this sense adding the second partition and changing to .imgPTN23) upon barrowing a friends UEFI based laptop, the flash drive was either not booted to at all, booted directly into memtest86 (had not even yet bothered to find or know that was there) no e2b menu (though the memtest86 options menu was there), or if I put his UEFI configuration into legacy mode then e2b would load fine but that defeats the purpose of the test, and not all uefi computers I have seen are nice enough to have a 'legacy mode'!

 

I am hopeful on my next test now that the second partition is there and files are renamed that it will work on UEFI but I wont know till Thursday, as I don't see that friend again till then.



#14 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 01 October 2014 - 08:23 AM

To UEFI boot, you need to switch to CSM mode - i.e. boot to the E2B menu and select a .imgPTN or .imgPTN23 file and switch in that partition image so that you see the CSM menu.
Then connect the USb drive to your UEFI system and boot from it.

Of course, the payload (what is inside the .imgPTN file) must support UEFI booting (see here for info) - I suggest you test with clonezilla as this has both 32-bit and 64-bit UEFI support.

If it boots to MemTest86, then you are in the normal E2B mode (and it is FAT32 formatted). This is normal behaviour when in E2B-mode.

You can test UEFI-booting using VirtualBox - see YouTube video.



#15 Pedro001

Pedro001
  • Members
  • 2 posts
  •  
    Czech_ Republic

Posted 05 March 2015 - 03:18 PM

Thx tblo for great scripts which simplify unmounting e2b partition. I call your script RestoreE2Bscript.cmd from

\sources\$OEM$\$$\Setup\Scripts\setupcomplete.cmd during finishing Win7 installation by command:

"start /wait %CDROM%\e2b\RestoreE2Bscript.cmd"

 

It works, e2b partition is removed, but in your script after message "Found backup MBR at SESCTOR 30, I received error "The system cannot find the path specified". Because of that the installation of Win7 get stuck and never finish. Can you help me where the problem is? I'm not good at scripting I couldn't find the problem.



#16 Pedro001

Pedro001
  • Members
  • 2 posts
  •  
    Czech_ Republic

Posted 10 March 2015 - 04:20 PM

Thx tblo for great scripts which simplify unmounting e2b partition. I call your script RestoreE2Bscript.cmd from

\sources\$OEM$\$$\Setup\Scripts\setupcomplete.cmd during finishing Win7 installation by command:

"start /wait %CDROM%\e2b\RestoreE2Bscript.cmd"

 

It works, e2b partition is removed, but in your script after message "Found backup MBR at SESCTOR 30, I received error "The system cannot find the path specified". Because of that the installation of Win7 get stuck and never finish. Can you help me where the problem is? I'm not good at scripting I couldn't find the problem.

Sorry for previous silly question. Of course, the reasan was that rmpartusb.exe was on the drive which were removed in the script...






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users