If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#21
|
|||
|
|||
SD Card - boot sector
All the USB adapters I've used - which is many different types - cause
Windows to format cards with an MBR. As a matter of interest, the units I have also report as removable to Windows. Yes, looked at Disk driver source - Windows supports MBR on removable media, but uses only the very first valid partition off it. -- Maxim Shatskih, Windows DDK MVP StorageCraft Corporation http://www.storagecraft.com |
#22
|
|||
|
|||
SD Card - boot sector
Are you telling me that if I have two partitions on a CF card, and I
accidentally damage the logical structure of the first one, Windows will silently blow away the second partition if I reformat the card? Windows cannot support more then 1 partition on removable media. -- Maxim Shatskih, Windows DDK MVP StorageCraft Corporation http://www.storagecraft.com |
#23
|
|||
|
|||
SD Card - boot sector
Windows does not support MBR and partitions on removable media,
What about USB and Firewire disks? First, I was mistaken. MBR is supported on removable media. But only 1 partition is used on it. Look at Disk driver source from the DDK (if you have one). Second, do not mix removable _media_ and removable _device_. USB and 1394 disks are fixed-media removable devices. Iomega ZIP USB is a removable media (special diskettes) removable device. Most USB flash drives are emulating the removable media - the USB diskette drive with the diskette glued to it forever. But some old USB flash drives emulate the real USB-attached hard disk. -- Maxim Shatskih, Windows DDK MVP StorageCraft Corporation http://www.storagecraft.com |
#24
|
|||
|
|||
SD Card - boot sector
I repeat: 63 sectors is a generalization and given that we are messing
with data storage devices, a dangerous one. Please don't let your 63-sector-track assumption stomp on my storage media - let me know what embedded devices you are involved with building, so I can avoid them. I'm speaking about what Windows uses. If the disk is not in BIOS - then yes, H=255 S=63. Anyway CHS are obsolete, and I think that all modern OSes will work fine the the MBR disk where the next partition starts at physical sector 1 (not skipping a track). More so. Linux runs fine with complete junk in CHS values in MBR entries. All IO requests to disk are long ago going using LBA, both int 13h and native (using the OS's driver). -- Maxim Shatskih, Windows DDK MVP StorageCraft Corporation http://www.storagecraft.com |
#25
|
|||
|
|||
SD Card - boot sector
Ok, so if the MBR is effectively obsolete on removable media under
Windows, which explains my findings, what is the best method for determining the equivalent 'CHS' and partition information from the USB disk? Thanks, Alex |
#26
|
|||
|
|||
SD Card - boot sector
Once more - in Windows, if the disk is not registered in BIOS, then H=63
and S=255. Also, if the disk is registered in BIOS as LBA, then once again - H=63 and S=255 by definition. CHS values are no more used for IO since around 2000, neither in Windows nor in Linux. Their only use is to fill the obsolete MBR values. BTW, Linux boots and works fine with nonsense CHS values in the MBR :-) it was Linux kernel 2.2. Why do you ever need CHS? It is absolutely sure that, for a flash drive, they are fake, used only to satisfy MS-DOS. All real IO is done using LBA. -- Maxim Shatskih, Windows DDK MVP StorageCraft Corporation http://www.storagecraft.com wrote in message ups.com... Ok, so if the MBR is effectively obsolete on removable media under Windows, which explains my findings, what is the best method for determining the equivalent 'CHS' and partition information from the USB disk? Thanks, Alex |
#27
|
|||
|
|||
SD Card - boot sector
Thanks for the clarification. I think I jumped the gun and didn't ask
the proper questions to resolve the problem. - Assuming H=63 and S=255, will the calulated disk size always be correct when using the cylinder count found with IOCTL_DISK_GET_DRIVE_GEOMETRY? - Can a RemovableMedia hold multiple partitions? If there is no MBR, yet it works fine in both Linux and Windows machines I'm not sure how this would be handled? - Is it possible for a RemovableMedia device (or partition) to be set active (bootable) like a fixed disk? - Without an MBR, what is the proper method for reading the partition information from the disk (eg, type, size, sectors, etc)? Thanks, Alex |
#28
|
|||
|
|||
SD Card - boot sector
- Assuming H=63 and S=255, will the calulated disk size always be
correct when using the cylinder count found with IOCTL_DISK_GET_DRIVE_GEOMETRY? A bit incorrect. IOCTL_DISK_GET_PARTITION_INFO (sent to the single partition device, and not to the whole disk) is a better way to get the disk size at the level below the filesystem. At filesystem level, you have GetDiskFreeSpaceEx (by name) and undocumented NtQueryVolumeInformationFile/FileFsSizeInformation (by handle). In fact, GetDiskFreeSpaceEx depends upon NtQueryVolumeInformationFile internally. - Can a RemovableMedia hold multiple partitions? Yes, but Windows will ignore all but first if you have DDK - see the comments in Disk driver source - they only create 1 partition device object for removable media. If the media has no MBR - then IoReadPartitionTable code below Disk will "cook" the partition table information with 1 huge partition. This is called "super-floppy". If the media has MBR - then IoReadPartitionTable will really translate the MBR to some Windows-defined structures (common to all possible on-disk PT layouts). Then Disk will interpret the data from IoReadPartitionTable and create the child device objects for partitions, and, for removable media, it will always create 1. Also the removable media devices cannot participate in software RAIDs, and their drive letters (and volume mount points) depend only on their bus connection position. For fixed disks, the partition drive letters depends on MBR signature value and the partition start offset, and NOT on the bus connection position of the drive. Dunno on Linux. - Is it possible for a RemovableMedia device (or partition) to be set active (bootable) like a fixed disk? Depends on BIOS mainly. - Without an MBR, what is the proper method for reading the partition information from the disk (eg, type, size, sectors, etc)? Without an MBR, IoReadPartitionTable will respond "the disk has 1 partition of the whole disk size". Then the Disk.sys driver will do the same. Also IOCTL_SCSI_PASS_THROUGH with SCSIOP_READ_CAPACITY this is even below the partition queries and work for all connection buses. It is mapped to bus-specific hardware "get size" request. For SCSI, it is not mapped at all Also for IDE/ATA/SATA only, you can read the 512 bytes of disk IDENTIFY data (this is IOCTL_SCSI_MINIPORT/SMART_RCV_DRIVE_DATA, do not be confused with SCSI and SMART here - this couple works from NT4 up for SMARTless IDE disks) - and the UserAddressableSectors field (defined by ATA spec) is the disk size. -- Maxim Shatskih, Windows DDK MVP StorageCraft Corporation http://www.storagecraft.com |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mbr for 40G harddrive? | *selah* | Storage (alternative) | 60 | July 12th 05 02:27 PM |
FS printers/parts trays, printheads -- oki fujitsu dl3700 dl3800 hp genicom epson ibm dec jetdirect laserjet lexmark qms okidata microline 320 ml320 393 tally printronix tektronix qms toshiba zebra otc ibm intermec 7755 boul st laurent montreal ca | cisco | Printers | 2 | May 22nd 05 02:05 AM |
FS PRINTER PARTS trays fusers drums printheads -- oki fujitsu hp genicom epson ibm dec jetdirect laserjet lexnmark qms okidata ml320 mannesmann tally printonix tektronix qms toshiba zebra otc ibm lexmark intermec dec compaq montreal canada toronto o | [email protected] | Printers | 2 | May 8th 05 09:58 PM |
Help moving data and boot sector to diffferent hard drive | Ross Meador | Storage (alternative) | 7 | February 10th 05 04:24 PM |
Upgrade Difficulties | Ron B | Gateway Computers | 0 | February 14th 04 03:26 AM |