Forum: EasyBoot
Topic: Ran Bootsect /NT60 on my USB drive. Need Help
started by: Orochi

Posted by Orochi on Apr. 09 2011,11:48
I was trying to fix my windows installation and ran:
Bootsect.exe /nt60 all /force. I forgot that I had a usb plugged into my computer. Of course bootsector was written on my usb drive as well.

I decided to run balder's easyboot-usb script. The script formated my usb stick with grun4dos. Then I put all my programs back to usb including installation of windows 7 with a bootmgr in the root of the usb.

The problem is now when I boot from usb drive, I don't see grub menu, instead windows 7 starts installing itself.

Can i somehow fix this without formating my usb again?

Posted by balder on Apr. 09 2011,12:03
@Orochi

Quote: ”I forgot that I had a usb plugged into my computer”

Well nobody is perfect :;):  – happens to me as well :(

Quote: “I decided to run balder's easyboot-usb script”

If you run this script you are asked first to choose between using floppy image or to use ISO-file.
If choosing ISO-file, you are then asked to locate and double-click to ISO-file.

So what ISO-file did you choose?

This is vital: Please show what’s on the text-file “menu.lst” that you have on the root of your USB device
This can give me vital information to help you solve your problem :cool:

Regards balder

Posted by Orochi on Apr. 09 2011,12:26
WOW Guru is here. :)
Balder thank you for your help.

I chose floppy image not an ISO during the script. Then I deleted the floppy and put my own menu.lst with files on the usb.

CODE

default 0
timeout 30
gfxmenu = /wallpaper/backtrack3.gz

title Start From Hard Disk
map (hd0) (hd1)
map (hd1) (hd0)
map --hook
chainloader +1
boot

title Launch Support for USB 2.0
root (hd0,0)
kernel /iso/plpbt.bin

title Hirens BootCD 13.1
root (hd0,0)
configfile /iso/hiren.lst

title Memtest86+ 4.20
find --set-root /iso/mt420.iso
map /iso/mt420.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)

title SpinRite 6.0
find --set-root /iso/SpinRite.img.gz
map --mem /iso/SpinRite.img.gz (fd0)
map --hook
root (fd0)
chainloader (fd0)+1

title MiniTool Partition Wizard BootCD 5.2
find --set-root --ignore-floppies /iso/pw52.iso
map /iso/pw52.iso (hd32)
map --hook
chainloader (hd32)
boot

title Paragon Hard Disk Manager 2011 Linux
map (hd0,0)/iso/phdm11lnx.iso (hd32)
map --hook
chainloader (hd32)
boot

title Image for DOS v2.60
map (hd0,0)/iso/ifd.iso (hd32)
map --hook
chainloader (hd32)
boot

title Kryptos Logic: Kon-Boot 1.1
map --mem /iso/konboot11.img (fd0)
map --hook
chainloader (fd0)+1
map (hd1) (hd0)
map --hook
rootnoverify (fd0)

title Windows 7 SP1 X64 Setup
root (hd0,0)
chainloader (hd0,0)/bootmgr


Thank you again balder :)



Posted by Orochi on Apr. 09 2011,12:37
Another thing also.

When I ran grub installer I don't see Whole Disk MBR option anymore. Instead I have whole disk FAT32 option only.

< http://img834.imageshack.us/i/20110409123347.jpg >

PS: I think when your script ran it did not fully rewrote MBR, there must be something left from NT60 command that interferes with grub4dos.



Posted by balder on Apr. 09 2011,14:07
@Orochi

Quote: “PS: I think when your script ran it did not fully rewrote MBR, there must be something left from NT60 command that interferes with grub4dos.”

Well what did you have before?
Did you have several partitions or only one partition and NTFS-file-system?
What actually did you have on USB device (partitions file-system etcetera)?
------------------------------------------

Some brief information how script works :cool:
Script overwrite MBR-code to USB device everytime(your USB device seems like a 16 GB USB Stick\Thumb-drive if I’m correct) and as size is less than 32GB, it automatically create one FAT32 partition.

If USB device is larger than 32GB script instead automatically change to NTFS (can be overridden by checking “Force Format to FAT32).

Note1: FAT32 is the overall best file system to use on USB devices (particular USB stick\Thumb-drives).

Note2: If script finds out that you are using any USB device that is a “fixed” drive (normally a hard drive but there are USB Stick\Thumb-drives that can be set to “fixed” by flipping a data-byte in chip) script automatically chose NTFS, as this is the overall best file-system to such unit (“fixed” drive).

All this is automatically done (script do a close examination of the USB device before it start’s up the format procedure) - it’s more complicated than what you actually see for your eyes only :;):
To not destroy data, script is also prohibit to format any USB device that has more than one partition - Or if you by mistake have two USB devices plugged in at same time :O
----------------------------------------------

However, it is a mystery that you not fully can use the menu.lst as you claim that setup of Win7 starts without you have any possibility to choose any other option in menu.lst!
I cannot understand that last part ???

Hmmm… I guess I need some more info :)
Eeee.. What happened with your harddisk?
And there is no harm run script again to see if it behaves better.

Note: I always run ghost.exe to my “super-designed” USB devices (where I have a lot of “important” stuff)
I can then easily “ghost back” my USB device to original shape – or ghost to a different USB device (large enough to hold my build).

Regards balder



Posted by Orochi on Apr. 09 2011,17:19
balder thank you kindly for your help.

QUOTE
Note: I always run ghost.exe to my “super-designed” USB devices (where I have a lot of “important” stuff)
I can then easily “ghost back” my USB device to original shape – or ghost to a different USB device (large enough to hold my build).


I use disk snapshot and I also back up files regularly. So running the script again is not a problem. The problem is that not many imaging software can actually back MBR. So if MRB gets corrupted it becomes a bit problematic.

I will try running script again and report back.

Posted by Orochi on Apr. 09 2011,22:42
Hi balder,

I was able to fix my usb :)
Had to reformat using usb HP format utility. After this your script worked like a charm.
Also this time I backed MBR using bootice. ;)

Thank you so much your help my friend !!!

Posted by balder on Apr. 10 2011,02:42
@ Orochi

Quote: ”Had to reformat using usb HP format utility”

Yes HP format tool is (or was) the “king” of format tools for USB stick\Thumb-drives to the point that users (I was one of them) realized that HP format tool created an mismatch in length of the partition table :angry:

This mismatch is generally called “error 110”.
Basically you get a mismatch between the CHS length (Cylinder/Head/Sector) and the length of LBA (Logical/Block/Address).

I used HP format tool to a small USB stick and I got this:
The CHS length ended up being 97902 but the LBA length ended up to be 97903.
However the USB stick booted anyway – but on some odd BIOS this might be a problem, but frankly, I have never experienced this to any computer so far – so I guess this is more of a theoretic (academic) discussion ???  than the “real experience in life” in case you use the HP format tool.

However this problem continues on your USB stick. My script doesn’t change this “bad” behaviour in the mismatch CHS versus LBA .

How to get rid of this missmatch that HP format tool creates?

Several solutions can be used to solve this:
1. Let Easyboot launch the “old” DOS format tool Norton partition magic-8. You can launch the floppy image from Easyboot and follow instructions given by partition magic.  Partition magic then correct CHS length to the correctly one on the USB stick connected to your computer.
2. Use my script “easyboot-usb-ghost.script” and push button “Repair MBR BOOT-record” Note: can only be used to USB Stick\Thumb-drives!!! You of course need Ghost.exe (Ghost-8 is recommended). This solve problems related to CHS versus LBA right away in a couple of seconds
-------------------------------------------------------------

Some interesting incidents I have experienced related to “bad behaviour” from USB stick\Thumb-drives:

It happens that new USB sticks (never used) was impossible to correctly format and make bootable. Or USB sticks that went “crazy” and I couldn’t make bootable even using the (“wrong”) HP format tool :O

In most of these cases I received a short message from the USB stick like this. “Bad MBR Handler” and there it got stuck and doing nothing more :angry:

All this was fixed using above mentioned script. I have created a Ghost image  (with correct MBR and partition table) that is “injected” right away by Ghost.exe :laugh:
-------------------------------------------------------------

Quote: “Also this time I backed MBR using bootice”
But you now have a mismatch between the CHS versus LBA and it continous when using this MBR-code.

Note: Please don’t get upset by the information above as your USB stick works most likely splendid anyway.
But no harm to now that you have a perfect relation between the CHS length and the LBA length.

And great that you got the USB stick up and working

Regards balder



Posted by Orochi on Apr. 10 2011,15:48
Wow Balder thank you for your input. :)

I have two questions for you:

1. You mentioned that HP utility is not good but what about usb format utility offered by Hiren?
< http://www.hiren.info/download/freeware-tools/USBFormat.zip >
Does this utility do a better job in regards to CHS  LBA inequality ?
Could you test it if you get a chance.?

2. I followed your method # 2 using ghost.
Your script formated my usb and put new grub files. Now, how do i know that the CHS = LBA now?
How can I check this?

Also. I have Paragon Partition Manager installed on my computer and before i ran your script it showed that my usb stick is unformatted. After I ran your ghost script it still shows that it is unformatted.
However, windows explorer and disk management show my usb stick normally. That it is formatted with FAT32 and I can also write files to it. Any ideas why that my be ?

PS: The first time I created my usb was I think with HP format utility. I have two usbs; one 16gb and the other is 4gb. I never had problems on any computer.

PS:2 Why does your usb script formats usb so fast? Are you using quick format?
When I ran HP format it took me almost 20min or maybe even more. If I am not mistaken your earlier scripts took longer to format usb. After all it is the long format by HP utility and quick format that helped me get rid of all the stuff that interfered with grub.

Regards :)



Posted by balder on Apr. 10 2011,17:10
@ Orochi

Quote: ” I have two questions for you”

I downloaded format tool from Hiren and this is simply a “reduced” variant on the original HP format tool

However it has one exception – it’s even worse – this reduced HP tool format you USB stick to have even grater differences to the right CHS.

You are not recommended to use such tool – but please note that your USB stick(s) doesn’t get destroyed in any way :)  – USB stick only have a wrong relationship between the right length CHS versus LBA.
--------------------------------------------

Quote: ”I followed your method # 2 using ghost”
I can guarantee that if you used the “Repair MBR BOOT-record” in easyboot-usb-ghost.script your USB stick now have the RIGHT relationship between lengths to CHS versus LBA - it's optimal :)
----------------------------------------------------------

Quote: ” I never had problems on any computer”
Yes most likely and I quote from post nr;8

on some odd BIOS this might be a problem, but frankly, I have never experienced this to any computer so far – so I guess this is more of a theoretic (academic) discussion than the “real experience in life” in case you use the HP format tool

However, in my opinion, there is no point to create a not 100% correct MBR-code, when you can be sure you instead is using the right condition between length to CHS versus LBA ???

Note: As I already said – it’s more a academic issue than a “real problem” – but again – why not use the right MBR-code ???
-------------------------------------------

Quote: ” How can I check this”
Well I always use a very quick method to check this.
It should be possible to use a kind of hex editor but it’s easy to get lost.
The easy way is to launch the old partition magiq-8 from a floppy image (put floppy image in folder ezboot and use “run” as menu command to floppy image).
When you have tested that you can launch image correctly you use “easyboot-grub-iso.script” to create a new ISO followed by using “Make USB bootable and transfer build to USB”.
Now launch your USB stick and finally launch partition magiq-8 using menu in EasyBoot from your USB stick.
This tells you at once if the MBR-code is correct or not!
I’m sure you can find partition magiq-8 somewhere out there on Internet.
----------------------------------------

It’s odd that Paragon Partition Manager repost such strange thing about your USB stick – can’t tell why at this point.

Quote: ”Why does your usb script formats usb so fast? Are you using quick format”
Yes I use a special format tool (command line tool) in script and only need quick format – you really don’t need to do the “full partition” to such USB stick

Attention! There is no cause for alarm or reason be alarmed by this – I just think when you can get the best – you shall use the best (put the right MBR-code to USB stick).

EDIT
I checked the differences between CHS versus LBA with the same USB stick as used in post nr;8
Difference when using original HP tool was in post nr;8 and I quote: “The CHS length ended up being 97902 but the LBA length ended up to be 97903” – as you can notice only 1.

But when using download from Hiren I get this:  The CHS length ended up being 97902 but the LBA length ended up to be 981953” – as you can notice there is even larger differences between length to CHS versus LBA, using this “reduced” HP tool from Hiren.


Regards balder



Posted by Orochi on Apr. 10 2011,17:47
balder thank you for your explanation.

QUOTE
I just think when you can get the best – you shall use the best (put the right MBR-code to USB stick).


I agree with you. :)

Is your usb script capable of making perfect geometry in regards to CHS and LBA? Will it correct the current difference? If yes, I will try running your script again and let you know whether I could boot to grub menu.

What other usb format tools that are good can you recommend. Is bootice any good?

Are these usb format tools unique or I can achieve the same by simply using any decent partition manager and formating my usb with FAT32.


EDIT:
I ran your usb script. Everything went ok and I was able to get to grub menu.

I then decided to check partition using program called testdisk. (http://www.cgsecurity.org/wiki/TestDisk)

CHS 1952 vs LBA 1951



Posted by balder on Apr. 11 2011,02:12
@ Orochi

Quote: ”Are these usb format tools unique or I can achieve the same by simply using any decent partition manager and formating my usb with FAT32”

Tested following:
1. Used HP tool to format USB (doesn’t matter if you use full or quick format). Result from testing with “TestDisk” ended as expected with “Bad sector count” – and same when run partition magiq-8 (floppy image launched from Easyboot-menu) :(
2. Used easyboot-usb-ghost.script (Repair MBR-BOOT-record). Result from testing with “TestDisk” ended as expected WITHOUT any “Bad sector count” reported= well working USB volume :laugh:
3. Again used Used HP tool to format USB and at once (as expected) “Bad sector count” is showed in log from “TestDisk”. Run Windows format to USB (doesn’t matter if you use full or quick format) – same result: “Bad sector count”. Again used easyboot-usb-ghost.script (Repair MBR-BOOT-record). Result from testing with “TestDisk” ended as expected WITHOUT any “Bad sector count” reported= well working USB volume
4. I’m not 100% sure if “BOOTICE.EXE” can “reverse” USB stick back to the “right track”
Note: My scripts that has capacity to format USB devices, DO NOT “reset” your USB stick to a correct structure ???

Conclusion from above…
Don’t use HP format tool :O
If this been done earlier to your USB stick(s)– run easyboot-usb-ghost.script and choose to “Repair MBR-BOOT-record”. This guarantees a correct structure to your USB stick :;):
Basically – don’t use HP format tool anymore!
And as it seems that you do have Ghost.exe (version 8 is recommended) in your “arsenal” of tools, then you can “repair” (or shall we say “reset”) your USB stick(s) to a correct structure in a breeze
-------------------------------------------------------

Note: my scripts that has capacity to format your USB device(s) uses several different methods to format its target (your USB device).
1. If USB device is a “fixed” device (usually “hard-disk”), script use “Format.com” (built-in in your Windows=same as you right-click to USB in Explorer in your Windows system and choose to Format – very reliable).
2. If USB device is a “removable” disk, script uses its own built-in command line tool to format USB (quick format). Note: script examines your USB device and then quickly decides what’s should be the right strategy to format your USB device to the right structure.
3. If USB device is a “removable” disk and larger than 32 GB, script creates NTFS-file-system on USB device (regardless if it is a “fixed” or “removable” disk but can be overridden by checking “Force Format to FAT32”). If USB device is smaller than 32GB - script uses FAT32 as file-system. You don’t need to worry about this – script is designed to use the most optimal solution to your USB device that is “common used” (or “world-wide” recommended).

I’m positive that we now - at this point - can agree that HP format tool is “out of date”, and not recommended to format any USB stick\Thumb-drive

Eeeee... I do hope that I haven’t worried you to much with this “academic” discussion – and instead make sure your USB stick(s) from this point uses the most optimal structure=the most optimal bootable structure we have knowledge in.

Regards balder

Posted by Orochi on Apr. 11 2011,03:44
Hello balder thank you for the info. :)

I was able to replicate the "bad sector count" error in testdisk using 1gb usb stick.
Just out of curiosity what size usb sticks did you use in your analysis in the post above mine?

I will stay away from HP usb format. ;)

QUOTE
Eeeee... I do hope that I haven’t worried you to much with this “academic” discussion –


HAHAHA :D not at all. Thank you for such discussion. I am learning new things everyday.

EDIT

Just checked BOOTICE. I think it works great. It has many format options and also I did not get any errors in testdisk.

Also thank you kindly for sharing your knowledge and for an amazing set of scripts. No more HP format for me ;)

Best Regards balder !!!



Posted by balder on Apr. 11 2011,04:03
@ Orochi

Quote: ” Just out of curiosity what size usb sticks did you use in your analysis in the post above mine”

I used one 512MB USB stick and one 16GB USB stick.
Funny part is that when run testdisk_win.exe to 16GB stick program reported “Bas Sector” even there is no “Bad Sector” ???
This doesn’t happen to my 512MB stick – so I don’t to 100% trust test result given by “testdisk_win.exe” :O
In my opinion best test result is given by run partition magiq-8 from floppy (Symantec for sure now how to play “the game”).

If I use HP format tool to USB stick (any stick) I cannot run old DOS-programs like “Partition-Commander” – it stalls and cannot understand the structure of the USB that have “Bad Sector” :(

We are back to “base camp” – don’t use HP format tool.

Quote: “Just checked BOOTICE. I think it works great”
Sure – it is a great tool – small and efficient too

But the best part is this:
Quote: “I will stay away from HP usb format”

He, he you have my blessing :D

Regards balder