Open Eugeny1 opened 3 years ago
This is a complex one.
In the past Nextor used to rely on the MBR signature (0x55, 0xAA as the two last bytes of the sector) to determine if there was a partition table in the physical boot sector of the device. But I removed that detection mechanism because it was misleading and sometimes gave false results (and I think it was yourself who reported that if I remember correctly?)
So now the only thing Nextor can do is to read the partition table and try to interpret it, just checking sector 0 to look like a boot sector wouldn't work because the MBR could contain a partition table AND also a boot sector (MegaSCSI, for example, used to partition devices this way).
I'm not sure how this could be solved; at most, perhaps a "hey the device seems to have a FAT boot sector in tthe MBR" message could perhaps be added. Anyway I'll leave the issue open and labeled as "enhancement" and I'm happy to accept further suggestions or related pull requests.
and I think it was yourself who reported that if I remember correctly?
Yes, it was me, and MBR as well as boot sector must contain 0xaa55 signature, so this could not be a reason for decision making.
MegaSCSI, for example, used to partition devices this way
I do believe there may be numerous ways to partition the device, but we must focus on contemporary ways of doing it. Not sure if someone is going to open megascsi volume using Nextor, and it seems megascsi does not contain Nextor kernel. Of course you can not satisfy everyone, so must choose a specific way.
"hey the device seems to have a FAT boot sector in tthe MBR" message
Message is good, but there must be a way to identify if the volume is partitioned or not.
Note that volume may just contain garbage (and I had this case) when, if kernel does not validate boot sector or MBR, the machine will go crazy, so you definitely need some validation for structures being correct before deciding on mounting the volumes.
It is not as tough as you think.
AFAIK, fdisk doesn't have to process such volumes, on any system - it should report an error. For example, fdisk on linux reports: "Device does not contain a recognized partition table." in this case.
AFAIK, fdisk doesn't have to process such volumes, on any system - it should report an error. For example, fdisk on linux reports: "Device does not contain a recognized partition table." in this case.
*it should report an error and propose to create MBR.
well, actually I remember something, that under MSDOS fdisk has to do with filesystems, like FAT-formating partitions, but did it manage to do so on unpartitioned, single volume drive media?
See the subject. Sometimes FDISK displays incorrect (totally wrong, out of blue) partitioning information because it treats boot sector as a partition table. Can you please make FDISK checking sector 0 looking like boot sector, and display that the whole device is one big volume, taking volume configuration information from the boot sector? Current FDISK display misleads people saying the volume is empty (or badly partitioned) while it is having proper bootable volume.