Jump to content

Strange Problems with Pendrives


Recommended Posts

That's your pendrive all right! Now, one problem I can already see: the MBR has a single partition of type 1B (which means a hidden FAT-32 partition), no wonder nothing gets mounted. It ought to be changed to 0B. This is easy to solve, but I'll let jaclaz suggest what app you should use to solve it. I'd fix it with an hexeditor, but there are many less dangerous ways to do it.

Link to comment
Share on other sites


Just in case:

http://www.boot-land.net/forums/index.php?...c=9916&st=6

There are a number of "strange things in the partitioning/formatting of that stick:

Partition type is 1B (hidden FAT32 CHS Mapped) as dencorso pointed out:

http://www.win.tue.nl/~aeb/partitions/partition_types-1.html

The geometry is "queer", being HS 32/63 - which is unusual though the data in the MBR and bootsector are matching.

The CHS values are UNbalanced with the LBA ones:

CHS: (140+1)x(31+1)x63=284,256 sectors x512=145,539,072 bytes <- :w00t:

LBA 31,249,953+63=31,250,016 sectors x512=16,000,008,192 bytes <- which sounds like "right" :thumbup

The LBA is correctly aligned to Cylinder boundary, but the "virtual geometry" is:

(15500+1)x(31+1)x63=31,250,016

which corresponds to a "real" CHS data of:

0/1/1/1023/31/63

"Something" must have changed the data. :whistle:

I would try first thing to set the partition as visible: 1B->0B

Then I would try changing the partition type to a LBA one: 0B->0C

Then again I would change the CHS end Cylinder: 140->1023

Finally, I would scratch the whole thing and re-partition/re-format it with the "usual" HS geometry of 255/63, using one of the tools listed here:

http://www.boot-land.net/forums/index.php?showtopic=9460

To do the changes manually, I suggest you the use of either beeblebrox (as it runs on BOTH 9x and NT based systems):

(site down) available through Wayback Machine:

http://web.archive.org/web/20080320075013/...byu.edu/~codyb/

http://web.archive.org/web/20080320075013/...byu.edu/~codyb/

http://web.archive.org/web/20060223003038/...brox9xsetup.zip

http://web.archive.org/web/20060223003044/...broxntsetup.zip

Or use tinyhexer, possibly using my Structure Viewers as help/guidelines:

http://www.boot-land.net/forums/index.php?showtopic=8734

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Ok Guys, thanks for all your help so far. :thumbup

I'm going to be needing my flash drive at college the next couple of days, and it's all a WinXP environment there, so I'm not going to run any more experiments just yet. As soon as that's over, Ill resume the quest to figure out what's going on with it.

@jaclaz

I have a question that's semi-related to this, but probably more appropriate in this thread. Will post there.

Flash Drives Wearing Out ?

Link to comment
Share on other sites

The Geometry of 32 Heads and 63 Sectors is not unusual for USB Flash Drives. I have seen 16 Heads as well.

The most important fix for this Pendrive is changing the Partition ID, at offset 1C2H, from 1BH to 0CH.

To avoid potential partitioning problems in the future, the CHS entries should be corrected.

The CHS End Cylinder High 2 Bits and Sector, at offset 1C4H, should be changed from 3FH to 0FFH.

The CHS End Cylinder Low Byte, at offset 1C5H, should be changed from 8CH to 0FFH

Link to comment
Share on other sites

The Geometry of 32 Heads and 63 Sectors is not unusual for USB Flash Drives. I have seen 16 Heads as well.

The most important fix for this Pendrive is changing the Partition ID, at offset 1C2H, from 1BH to 0CH.

To avoid potential partitioning problems in the future, the CHS entries should be corrected.

The CHS End Cylinder High 2 Bits and Sector, at offset 1C4H, should be changed from 3FH to 0FFH.

The CHS End Cylinder Low Byte, at offset 1C5H, should be changed from 8CH to 0FFH

Whenever I'm finished with my flash drive at college this week I think I may just reformat it, from what you all are telling me it seems to have some bizarre settings.

@rloew - While you're here I'd appreciate your input on the question I asked jaclaz in the other thread. :)

Link to comment
Share on other sites

Whenever I'm finished with my flash drive at college this week I think I may just reformat it, from what you all are telling me it seems to have some bizarre settings.

There's no hurry to do it, so take your time. I see no need to reformat, however. Moreover, reformating per se wouldn't change anything, since the problems identified are all in the MBR. You'd have to repartition and reformat. But, just by repairing the problems found by jaclaz, through editing those three bytes as described by RLoew, you pendrive should be fine again, so repartitioning and reformatting seem to me a bit of overkill. Moreover, anyone of us might do it for you in the MBR image you attached and attach it back, so that all you'd need to do would be to write the MBR sector back, using HDHacker (just make sure you are writing to the right disk, before actually doing it).

Link to comment
Share on other sites

The Geometry of 32 Heads and 63 Sectors is not unusual for USB Flash Drives. I have seen 16 Heads as well.

The most important fix for this Pendrive is changing the Partition ID, at offset 1C2H, from 1BH to 0CH.

To avoid potential partitioning problems in the future, the CHS entries should be corrected.

The CHS End Cylinder High 2 Bits and Sector, at offset 1C4H, should be changed from 3FH to 0FFH.

The CHS End Cylinder Low Byte, at offset 1C5H, should be changed from 8CH to 0FFH

Whenever I'm finished with my flash drive at college this week I think I may just reformat it, from what you all are telling me it seems to have some bizarre settings.

@rloew - While you're here I'd appreciate your input on the question I asked jaclaz in the other thread. :)

You didn't say which question. I assume you are referring to your question about FileSystems that only Dencorso has replied to so far.

I have thought about Patching the FAT32 FileSystem to support >4GB files but have not run yet run the tests or done the analysis to see if it is feasible.

There may be limitations at higher levels, such as the 2GB Copy limit others have found.

I haven't found a source for documentation on Installable File Systems for Win 9X.

So far the only Patches I have written for VFAT.VXD are for the 1TB Partition Limit and support for 128KB Clusters. An experimental Patch is wating for Hard Drives larger than 2TB to become available.

Link to comment
Share on other sites

I assume you are referring to your question about FileSystems that only Dencorso has replied to so far.

I have thought about Patching the FAT32 FileSystem to support >4GB files but have not run yet run the tests or done the analysis to see if it is feasible.

Yep, that's the question. Patching the FAT32 filesystem sounds like a good idea if it's possible, however I can see how this might be a somewhat awkward process if one had to install the patched VFAT.VXD on each and every machine (And this would no doubt include 2K/XP/Vista/Win7 machines as well I assume) that he wanted to be able to write a 4GB+ file to or use a FAT32 formatted flash disk in for said purpose.

Is there a possiblility of writing a Windows 98 driver for exFAT? I have seen it mentioned on here before, not sure of the legalities involved, but provided it's not illegal I think it would be a very useful utility.

EDIT: Never mind, I see on Wikipedia that Microsoft is still charging a licensing fee for exFAT implementations.

Edited by LoneCrusader
Link to comment
Share on other sites

The Geometry of 32 Heads and 63 Sectors is not unusual for USB Flash Drives. I have seen 16 Heads as well.

Well, no.

The 16/63 geometry is rather common, the 32/63 is far less common, but BOTH can be found on very small capacity sticks, I have never seen any of them on a "large" stick, this one is a 16 Gb one!

Usually whatever goes above the CHS limits for a given geometry uses NOT the "smaller" geometry:

http://www.boot-land.net/forums/index.php?...=9776&st=56

We have CHS limit at:

255/63->1024*255*63*512=8,422,686,720<-Current geometry on "modern" BIOS and OS, say since 1998

128/63->1024*128*63*512=4,227,858,432<- Rarely used (default in WinHex if I remember right)

64/63->1024*64*63*512=2,113,929,216<-Really rarely used (cannot remember a single system/OS that used it)

16/63->1024*16*63*512=528,482,304<-Old geometry and first HD size barrier

64/32->1024*64*32*512=1,073,741,824<- this was "old" NT 3.51/4.00 default

240/63->1024*240*63*512=7,927,234,560<- only stoopid laptops AFAICR

The CHS limit at 32/63 is obviously:

32/63->1024*32*63*512=1,056,964,608 >- as said very unusual in my experience

Is there a possiblility of writing a Windows 98 driver for exFAT? I have seen it mentioned on here before, not sure of the legalities involved, but provided it's not illegal I think it would be a very useful utility.

EDIT: Never mind, I see on Wikipedia that Microsoft is still charging a licensing fee for exFAT implementations.

Again, NO.

Read the related thread here:

http://www.msfn.org/board/ntfs-support-win...14-page-44.html

At least in Europe, there would be NO problems in writing an exFAT driver from a legal standpoint, for interchange use, and most probably the same would apply to the "fair use" provisions of the US Law.

The "licensing fee" is for devices using the filesystem, not for programs capable of reading/writing it.

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

I haven't found a source for documentation on Installable File Systems for Win 9X.
Well, there is Inside the Windows 95 File System, by Stan Mitchell, available used at amazon.com at affordable prices. It's very comprehensive, and unique as a source, AFAIK. An one of the examples in the companion diskette is fsinfile, that implements a file system within a file, as a remote filesystem.
Link to comment
Share on other sites

I have done some further testing and code analysis, and determined that there are multiple problems with trying to support files larger than 4GB in Windows 9X besides the FileSystem. Installing a new FileSystem will not solve these problems since the FileSystem will never even see File Offsets greater that 4GB.

The following are two issues I have found so far.

SetFilePointer allows 64-Bit Offsets but the Windows 9X Version blocks values outside +/- 4GB within the first few instructions.

Bypassing the check shows that only the lower 32-Bits of the Offset ever reach VFAT.VXD.

IFSMgr_Ring0_FileIO performs File I/O from Ring 0 Code. It uses EDX to pass a File Offset, so the interface would have to be changed to support larger files. This would require Patching all Software that call this function, including an unknown amount of Vendor Software.

I suspect there are many more problems I have not identified.

The only approach I am thinking about at this time, is to hook the User APIs so that a set of smaller Files will appear as one large File to Applications that want to use more than 4GB.

Edited by rloew
Link to comment
Share on other sites

I have done some further testing and code analysis, and determined that there are multiple problems with trying to support files larger than 4GB in Windows 9X besides the FileSystem. Installing a new FileSystem will not solve these problems since the FileSystem will never even see File Offsets greater that 4GB.

Well it doesn't look too promising, does it?

the Windows 9X Version

Is it possible a later version of these functions could be implemented with KernelEx or a similar compatiblity-layer type application, thereby bypassing the need to patch a bunch of different software?

Just trying to think logically, I have no coding or programming experience, so if I say something stupid please bear with me. :D

Edited by LoneCrusader
Link to comment
Share on other sites

the Windows 9X Version

Is it possible a later version of these functions could be implemented with KernelEx or a similar compatiblity-layer type application, thereby bypassing the need to patch a bunch of different software?

I think it's not possible. They're too low-level and deep inside the core of the OS. Sorry.

Link to comment
Share on other sites

Just trying to think logically, I have no coding or programming experience, so if I say something stupid please bear with me. :D

No problem.

"Stupid" is when you ask a question and there is no excuse for you not knowing better.

If you claimed experience with Kernel Programming then it might have been a stupid question.

Link to comment
Share on other sites

Well I suppose it's time to get back to the problem at hand, because now it's more complicated.

:realmad:

A few minutes ago, I copied all of the data (excluding one folder) from my flash drive to a Windows XP machine so I could burn it to a CD or put it back on the drive once this problem is fixed.

The folder I excluded contained a small handful of files from an openSUSE 11 Linux installation. There were a couple of graphics, about 3 screenshots, one text document, a backup of bookmarks.html from Firefox, and about six configuration files (customizing KDE, auto login, etc). I planned to copy these files to a temporary folder on a linux machine and then put them back on the drive when fixed. Now all but two of the files on the flash drive have disappeared. I did not even access this folder when I was copying the others to XP, so I know I did not accidentally delete them.

Is there a way to recover them? And whether there is or not, this drive is destined for a repartition and reformat!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...