FDOS/fdisk

Drive letters assigned to partitions within FDisk not always correct

Closed this issue · 5 comments

Hello,

on my system, fdisk v1.3.11 is unable to assign correct drive letters to partitions.

There are 2 disks on the system, with the following partitions:

Drive 0: EDD-Version=30 API-Bitmap=1
ExInt13: Flags=0000 Sectors=3907029168 (1907729 MB) SecSize=512
EDD3: bus=PCI interface=SATA IFPath=1/0/1/-1 [bus/dev/fn/chl] devpath=0,0,0
BI Type                    Start-C/H/S   End-C/H/S     Sector     Size      MB 
-------------------------------------------------------------------------------
80 83 Linux ext2fs            0/  0/ 1  460/254/63       2048  204800000 100000
00 82 Linux Swap            460/  0/ 1  480/254/63  204802048   16777216   8192
00 0c Prim. DOS,FAT32,LBA   480/  0/ 1  501/254/63  221579264   16777216   8192
00 0f Extended DOS,LBA      501/  0/ 1  428/254/63  238356480 3668672688 1791344
*1 0c Prim. DOS,FAT32,LBA   501/ 33/45  602/203/49         32   83888096  40960

Drive 1: EDD-Version=30 API-Bitmap=1
ExInt13: Flags=0000 Sectors=500118192 (244198 MB) SecSize=512
EDD3: bus=PCI interface=SATA IFPath=1/0/1/-1 [bus/dev/fn/chl] devpath=4,0,0
BI Type                    Start-C/H/S   End-C/H/S     Sector     Size      MB 
-------------------------------------------------------------------------------
80 0c Prim. DOS,FAT32,LBA     0/ 32/33 1007/254/63       2048   65536000  32000
00 83 Linux ext2fs         1007/  0/ 1   64/254/63   65538048   67108864  32768
00 07 HPFS,NTFS,exFAT        64/  0/ 1  146/254/63  132646912   67108864  32768
00 0e Prim. DOS,FAT16,LBA   146/  0/ 1  401/254/63  199755776    4096000   2000

As it can be seen, each disk contains at least 1 primary FAT partition. Disk 0 additionally contains a FAT partition in an extended partition, while disk 1 contains a secondary primary partition.

The problem is that FDisk assigns letter D: to the primary partition of disk 0, and letter C: to the (first) primary partition of disk 1.

MS fdisk ( contained in Win98SE ) assigns the drive letters correctly.

Thanks for the report! May I ask what is the program you generated the output with? Looks rather nice. Is it possible for you to additionally post the output of fdisk.exe 1 /info and fdisk.exe 2 /info? That would give me a better impression of what FDISK actually thinks is the layout of the disk.

I think I found out what was going on and tried to fix it with 51e1834. Can you test if it is now working for you as expected? You may download a build from the actions page under https://github.com/FDOS/fdisk/actions/runs/7401514852, if you do not want to build it by yourself.

This should behave like the FreeDOS kernel in DOS drive ordering mode, if I understand the kernel code correctly.

Can you test if it is now working for you as expected?

Yes, it does - thanks!

May I ask what is the program you generated the output with?

It's a self-written little tool in assembly.

Thanks for reporting and testing this. I will prepare a new release with the bugfix applied.

This is partially solved as of version 1.3.12. However, FDISK currently does not detect if for example the FreeDOS kernel is compiled without FAT32 support. In such cases, the drive letters may still differ between FDISK and FreeDOS. This is also the case for non-FAT32 enabled MS-DOS kernels, if FDISK runs in Win98 compatibility mode (which it does by default).

I close this ticket, because the original faulty behaviour @Baron-von-Riedesel described is fixed. There is another ticket #66 for the version compatibility parts of FDISK.