Bootsect screwed up my USB flash drive

Coolname007

Distinguished Member
Alright, I was messing around today with BartPe, trying to install it on a USB flash drive (which failed, btw, due to the missing "bootsect.bin" file, which I have now managed to create and put in the correct location). After attempting several times to install BartPE, solving one problem a time, while waiting the ability to post in their 911cd forums (after registering) so I could obtain help from the source (which I still don't have the ability to do, btw), and managing at last to solve all my problems up to a point where the files needed for the installation are in their correct places, but the installation failed due to there being no bootsector on the flash drive's partition, I got the brilliant idea to use bootsect.exe to put a bootsector that is compatible with ntldr on the partition. Bad idea...:frowning: Now I have lost the ability to access my flash drive's files at all, due to a bad bootsector. I get a

I:\ is not accessible
The file or directory is corrupted or unreadable
error message when trying to acess it from My Computer in XP.

Any one have an idea on how to solve this problem?
I have tried using bootsect to attempt the bootsector thing again, but I get a message saying in the command prompt

Could not open the volume root directory:
The parameter is incorrect.
When I try using MbrFix-es "volumeinformation" command, i get another error message saying the following:

Function failed. Error 1392: The file or directory is corrupted and unreadable.
Oh, and one other thing. When I attempted the "bootsect /nt52 I:" command the first time, I got a message saying it completed, but may not have been successful due to the drive not being able to be "locked", or something to that effect...whatever that means. :lup:

And after that is when I was no longer able to access the flash drive's contents at all.

Jake

EDIT: One other thing to mention is that the filesystem of the flash drive's partition (I) was shown as Fat 32 in Disk Management before I ran the bootsect command the first time, and now its just blank in the "Filesystem" column.

EDIT2: And after I did all that, I thought there being no MBR on the flash drive might be part of the problem, so I went ahead and put the WIN98 MBR (which I believe works with BartPE as well) with MbrFix on the flash drive, but it didn't solve the problem. The bootsector is still messed up.
 
Last edited:
You'll need to re-format unless you've backed up the orginal working bootsector. I like BartPE, don't get me wrong, but Burrows has done an excellent job of improving upon it for the UBCD4Win project with many of the tools already included. It comes with a UBCD4Win to USB app, which when it works makes the proccess a heck a lot easier than running x script or copying x file. Build it, pop in your flash drive, set the partition as active, start the usb app from the !critical\...\ubcd4winToUSB\ directory and let it do everything for you.
 
You'll need to re-format unless you've backed up the orginal working bootsector.
Well, I was hoping to find a solution where I wouldn't have to re-format...:scared: I happen to have some files on the USB drive, as well as a few U2 programs, along with the built-in U2 Launchpad), that I would like to remain on there if possible, or failing that, at least back them up to my hard drive. That is one thing that I did not follow in the instructions for installing BartPe like BartPE.
Though they said to run the command to format the USB flash drive volume, I left that part out of the command when running it, as I was hoping to be able to install BartPe alongside of the existing files, which seemed to me that it should work perfectly fine, since the volume was already formatted with Fat 32 by default, and BartPe supposedly can work with either FAT or NTFS.
And I now remember what the gist of the output was that last time, when I finally had managed to have all the appropriate files in their respective places, and tried once more to install BartPE. The output said something to the effect that the installation would only work on either Fat 32 or NTFS formatted volumes, which was nonsence to me, since the volume *was* FAT (i.e. FAT 32). >.<
So that was when I decided to use bootsect.exe to put boot code that is compatible with ntldr on the flash drive volume, which for some reason, did not work as intended. And on those lines...does anyone know if there's a bootsector fixing tool that works on USB flash drives? I searched briefly yesterday, and downloaded the FTTD Partition Table Doctor which supposedly can repair bootsectors, and tried that out, but the flash drive volume didn't even show up in the program, so I guess it doesn't support flash drive volumes. :frowning:
don't get me wrong, but Burrows has done an excellent job of improving upon it for the UBCD4Win project with many of the tools already included. It comes with a UBCD4Win to USB app, which when it works makes the proccess a heck a lot easier than running x script or copying x file. Build it, pop in your flash drive, set the partition as active, start the usb app from the !critical\...\ubcd4winToUSB\ directory and let it do everything for you.
Right. Actually, my original plan was to install BartPE (by itself) onto my flash drive, and install whatever recovery programs I want to put on there, and then make a UBCD4Win CD which will have pretty much everything else the flash drive lacks in terms of recovery programs. :wink: I have already downloaded UBCD4Win, but was planning on working at getting the CD made after I got my flash drive successfully booting with BartPE. That's the last time I use bootsect.exe on a flash drive...:angry:

Jake

Addendum:

Haha! I managed to repair the flash drive volume's bootsector with TestDisk. :joy: For future reference for anyone else who has this same problem, I followed these simple steps:


  1. Downloaded TestDisk from this link. I selected the version for Windows.
  2. I extracted the /win directory and subfolders to a folder I named "TestDisk".
  3. Navigating to that folder, and the "win" directory located inside, I then simply double-clicked on "testdisk_win.exe" to start up the program (no installation necessary, only extraction from the .zip after you download it).
  4. Once the program opened, I selected the "Create" option, and pressed Enter, which took me to a new screen which displayed my main hard drive, along with the plugged in flash drive.
  5. I selected the volume on the flash drive that had the corrupted bootsector, and pressed Enter.
  6. I selected "Intel", and pressed Enter.
  7. I selected "Advanced".
  8. With the volume with the corrupted bootsector selected, and the "Boot" option selected, I pressed Enter, got to a new screen which gave a success message, quit the application, went to my "My Computer" in the Start menu, selected the flash drive volume, double-clicked on it to open, and TADA, it opened, everything still there as before. :?? No more errors.
I'm glad I chose to go that route instead of re-formatting. Now all my data on the flash drive is ok again. :smile: Now time to try out the installation of BartPE again on the flash drive. :joy:

FYI, don't ever attempt to use bootsect.exe on a flash drive as I did. It will completely screw up your bootsector.

Jake
 
Last edited:
Ok, you're trying this out on a U3 drive? I can tell you right now (especially with the Sandisk Cruzers) that it well not work. Its something to do with thier software/hardware that prevents it though the BIOS still sees it as a bootable device. If you re-format you should be able to get the u3 installer from here and re-install the launchpad. You should never use a flash drive for this purpose that contains personal files you need. Always have a separate flash drive dedicated to utilities.
 
Ok, you're trying this out on a U3 drive? I can tell you right now (especially with the Sandisk Cruzers) that it well not work. Its something to do with thier software/hardware that prevents it though the BIOS still sees it as a bootable device. If you re-format you should be able to get the u3 installer from here and re-install the launchpad. You should never use a flash drive for this purpose that contains personal files you need. Always have a separate flash drive dedicated to utilities.

I would suggest using something like testdisk to try to get back your files, but I know first hand it didnt work for me when I did almost the exact same thing :frowning:

Ok, I think you misunderstood what my situation is currently...:wink: TestDisk has *already* repaired my flash drive volume's bootsector, so I can now access the partition first-hand and obtain the files that way. :smile: So I think its a bit too late for that...:tongueout:

But yes, I'm trying this out on a U3 SanDisk Cruzer Micro 8GB drive. So you say it wont work to install BartPE on this drive?

Jake
 
Last edited:
Nope. Get a regular flash drive for the purpose. You shouldn't be using a drive you depend on for it anyway. And I took the last part out once I had gone back and skimmed over your post. Glad it worked for you. I'd copy the files off that drive than that are important if the u3 launchpad isn't working so you can re-install which well require a re-format.
 
Nope. Get a regular flash drive for the purpose. You shouldn't be using a drive you depend on for it anyway. And I took the last part out once I had gone back and skimmed over your post. Glad it worked for you. I'd copy the files off that drive than that are important if the u3 launchpad isn't working so you can re-install which well require a re-format.

Ok, more clarification...
The U3 launchpad is now indeed working again, since the bootsector is fixed. So everything's back to normal, and working fine. :smile:
I'd hate to give up completely on installing BartPE on this drive though, so I think I am going to continue trying at it, and maybe one of these days I'll succeed... :grinning: I wont take 'it wont work' as an answer without first verifying myself whether it does or it doesn't. I'd really hate having to buy a new flash drive for this purpose.
 
Last edited:
Here's a thread from the UBCD4Win forums on it. Apparently the OP appears to have sorted out a way to make it possible, but you cannot keep the u3 launchpad. There's a few problems with the way they do it. I've tried installing on a u3 drive too and didn't work.
 
Hmm...it seems that how-to is for installing *UBCD4Win* on a U3 launchpad USB flash drive, not BartPE by itself, which is what I'm trying to do. :wink: I think what I'm trying to do should work, once I can manage to successfully write the right kind of bootsector to my Fat 32 flash drive volume (though not doing it with bootsect.exe!). The how-to I'm looking at here talks about using a different tool for that purpose, so I may give that a try, and it will hopefully work. The problem I'm having currently with BartPE's installation is there is no boot actual bootsector (i.e. it is RAW) on the volume, and the installation only supports either NTFS or FAT boot sectors, which was the exact same problem I was having before attempting to use bootsect.exe on the volume, which of course failed, leading up to me starting this thread. I think if I use the tool mentioned in the link I just posted several sentences above, then I wont have any more problems. I also hope it will allow me to keep my U3 launchpad, so I can have both BartPE and U3 launchpad installed on the same flash drive side by side.
As for the actual installation procedure I'm using, I am simply following the instructions (minus the '-f' part of the install command, as I don't want to format the volume) found in the pe2usb.txt file that came along with the actual installation files in the .zip, when I downloaded it from this link. Its in the first post of that page.

Jake
 
Last edited:
ubcd4win and bartpe are basically the same thing. With little or no modification the steps should be similar if it is to work, but what I see wrong with it is:

a) the virtual cd-rom partition only exists through a driver in Windows, so its not possible to access it
b) Its way too small for a 1.5gb+ build.
c) You would need a special bootloader to load the iso file unless the iso file itself has been extracted to the partition with the right boot code in place.
 
ubcd4win and bartpe are basically the same thing. With little or no modification the steps should be similar if it is to work, but what I see wrong with it is:

a) the virtual cd-rom partition only exists through a driver in Windows, so its not possible to access it
True, but the thing is I wouldn't need to access the virtual cd-rom partition during the actual boot of BartPE. :wink: From XP, the virtual cd-rom partition is seen as (H) while the actual volume the flash drive contains is shown as (I). :smile: Not only that, but the filesystem of (I) is Fat 32 from what I can see from Disk Management anyway. Since I figure it to be a Fat 32 partition, and BartPE is to be installed to that Fat 32 partition, I see no problem with it working right beside U3 launchpad (though obviously I would only be able to use U3 launchpad from inside Windows, which is what I want anyway).
b) Its way too small for a 1.5gb+ build.
c) You would need a special bootloader to load the iso file unless the iso file itself has been extracted to the partition with the right boot code in place.
Huh? If the installation only requires 1.5 GB amount of space, then that is not a problem seeing as the flash drive is 8 gigs...:wink: Besides, according to the instructions in the pe2usb.txt file, the installation of BartPE only requires approx. 256 MBs.

Jake
 
Last edited:
Well, I decided not to use pe2usb since it apparently doesn't support larger UFDs (like mine)... :wink: Instead, I built BartPE with pebuilder, and transferred over to the UFD with PeToUSB which actually turned out to be easier. :tongueout: I just had to select the "copy the files" option, and not check the option that said "format the drive" (or something to that effect). And it simply copied the BartPE files over to my UFD. Now I just got to figure out some way to get it to boot. :brows: My BIOS supports booting from USB removable drives, but I guess the reason why its not booting (even though I made sure to put the USB option first in the boot sequence) must be because there is still a bootsector and MBR problem. There will need to be a MBR and bootsector written to the drive that's compatible with BartPE.

The advice I'm getting now over at the 911cd forums is to reinstall it to the UFD with PeToUSB again, this time using the format option which will supposedly take care of that issue. I guess I all can do is hope that it will, or else I will have erased everything currently on there for nothing...:scared:
 
Like I said earlier in this thread I've heard from others and tested first hand myself and believe it doesnt work on the u3 drives (especially with u3 in place though on the one I tested I reformatted the entire thing). It has to do with thier hardware/software that doesnt permit it. Not all usb devices are bootable and I believe u3 drives fall into that category despite the BIOS allowing you to try to boot from them.

Anyway, good luck and let us know if you did find a way to get it working on a SanDisk as i'd be curious to find out how it would be done.
 
Like I said earlier in this thread I've heard from others and tested first hand myself and believe it doesnt work on the u3 drives (especially with u3 in place though on the one I tested I reformatted the entire thing). It has to do with thier hardware/software that doesnt permit it. Not all usb devices are bootable and I believe u3 drives fall into that category despite the BIOS allowing you to try to boot from them.

Anyway, good luck and let us know if you did find a way to get it working on a SanDisk as i'd be curious to find out how it would be done.

Well, I'm talking to someone over at the 911cd forums who has used BartPE successfully on a flash drive like mine with a U3 launchpad. :brows: I also just learned that my (H) partition (that you were suggesting was a *virtual* CD drive) is actually a physical partition formatted with CDFS. I just checked Disk Management myself, and verified that it shows up there as an actual partition on my flash drive. And the (H) partition is what contains the launchpad. :wink: The "system" folder found on (I) contains all of my U3 programs.

I'll go try the format option now to see if it works. Be back in a bit to announce my success or failure...

Addendum:

It works!! :joy: I was able to successfully boot into BartPE after formatting the UFD, and reinstalling the files. Not only that, but my launchpad remained intact, and I was able to access it again after rebooting back into Windows. :?? I did have to setup everything again, though...
And my programs were safe too, since I backed up the "system" folder to my HDD, and then after I formatted I simply copied it back into the root of the UFD volume. Couldn't have been easier...

Of course one drag though is that it was formatted as NTFS, while it had previously been formatted as Fat 32. I don't know, but I don't think that's a good thing...
I've heard that Fat 32 filesystem is better for UFDs than NTFS, something to do with NTFS doesn't seem to like quick removals of the UFD, even if you use the "safe removal" feature of Windows. :frowning:

For anyone else who wants to try this, here is a summary of what I did:

Downloaded BartPE's "pebuilder" from here.
Created a directory called "pebuilder". Extracted the pebuilder.exe file from the download to that directory. Created a sub-directory inside "pebuilder" called "BartPE" without the quotes.
Ran PEBuilder.exe from that directory. It is a GUI application.
Once it started up, I specified the location of my Windows XP installation files (which are required, btw, in order to build BartPE) in the "Source" field. In my case, it automatically detected the output folder (i.e. BartPE), so I didn't have to enter in anything in the "Output" field.
Selected "Create ISO image: (Enter filname)" and specified where to save the .iso file to (though FYI, it is not used by your UFD, and isn't copied to it). Hit "Build" to build BartPE with the options I selected.
Once that completed, I downloaded PeToUSB from this link, and placed it also in the "pebuilder" directory.
Double-clicked on it to start it. It is also a GUI app. Selected the following options:

Destionation Drive:
USB removable
(In the empty field below the above options, my UFD volume was already selected)

Format options:
Enable Disk Format <checked> (None of the sub-options were checked)

Drive label:
BartPE

Source path to built BartPE/WinPE files:
<entered path to BartPE folder that I created here>

File Copy Options:
Enable File Copy <checked> [No Overwrite]

Then I pressed simply pressed "Start" to format the UFD (which recreates the volumes completely, I might add), and copy the BartPE files over to the UFD after the new volume was created. From what I can gather after checking all of what happened, it seems PeToUSB performed the following actions:


  • Reformatted the (I) volume of course (it didn't touch the H volume at all, due to it not being writable) with the NTFS filesytem
  • Recreated the bootsector completely (if there was even one there before), and made it compatible with "ntldr"
  • Rewrote the MBR of the UFD (not sure exactly what all that process covered)
  • Set the (I) volume to "active"
And that's "it". ^_^ :wink:

Once I rebooted, and put my USB storage device first in the boot sequence, it booted up into BartPE no problems at all. :grinning: It has a cool wallpaper too, btw.

Its a bit lacking in programs right now of course, but I hope to get some of the best recovery software to put on it, to make it a sort of a bootable recovery tool if something ever goes wrong (I know...who would ever dream of that happening, eh? :wink: ). :brows:

With that completed, I can now start screwing around with UBCD4Win too, to see if I can't get a CD with that before too long. :??

Jake

EDIT: Can't wait until its possible to have EasyBCD to work from a UFD, btw...
 
Last edited:
My Sandisk U3 flash wouldn't work (the U3 part) on Vista, but the nice man from Sandisk walked me through getting rid of it altogether and getting the space back for something useful (and a spare letter too).
Maxthon, Opera etc are just as easy to set up as portable apps without U3, which just adds another layer to slow things down.
 
Well, personally, I *like* U3...:tongueout: I'm sure there are other ways to get portable apps onto a UFD, but U3 certainly makes it easier. :wink:
 
Can you post a link to that thread? I'm curious to see how it is done because I've taken a 1gb here, deleted both partitions and re-formatted with no luck. Works fine on a non-u3 drive for me...

And I like u3 too. While I agree with Terry about just installing without the u3 part the u3 menu makes things easy access without having to browse to the program you want to launch (unless you've created shortcuts) and its password security is nice to have in case someone else gets a hold of it.

Edit: Nevermind about the link, thanks for the steps. So it was as easy as formatting the main volume? I still don't get why than me re-partioning mine to be a single partition didn't work than...
 
Last edited:
What tool did you use to format your UFD volume? I simply used the option in the PeToUSB (which I've now found out, the version I used was a modified Russian version that formats the volume with NTFS instead of Fat 16 like the original version...I believe I linked to it in the post where I give the steps) called "Enable Disk Format" which apparently completly deleted my main (I) volume (it left the H volume which hols the U3 launchpad untouched), and basically rebuilt the entire thing from scratch. :brows: It completely recreated the volume, put a bootsector compatible with ntldr on it, wrote a valid MBR to the UFD, copied the BartPE files over, and I was good to go. :grinning: It worked perfectly the first time I tried to boot from it, after selecting the format option. FYI, though, in order to keep your U3 apps (and any other data on the UFD volume), you will need to first copy them to your HDD, because everything currently there is completely deleted in order to make way for the BartPE installation.
And after I did that (and checked, and discovered that it did indeed leave the H volume untouched, meaning my U3 launchpad was still intact), I rebooted, put my USB device first in the boot sequence in the BIOS, it booted up perfectly into BartPE, no problems at all.

And once I got back into Windows, I simply copied back the "system" folder and other files that I had backed up, to the UFD volume, and everything (i.e. my whole U3 system) worked exactly the way it had before, only I just had to re-setup everything again. But all my apps were ok.

Jake

EDIT: And one other thing...
Before I went through with the formatting, I opened up Tools>Display Disk Info... in the PeToUSB app, which showed me the partition table of the UFD. The only volume that existed in it was (I). So that probably accounts for the CDFS volume that contains the U3 launchpad remaining untouched. I guess you don't need the volume in the UFD's partition table in order to use it or for it to be detected by the OS you're booted into. BTW, I also selected to back up my UFD's MBR first before formatting just in case. It can be found at Tools>Backup MBR... in PeToUSB.
 
Last edited:
Back
Top