Partition type

General questions about HDDRIVER/Allgemeine Fragen zu HDDRIVER
peters
Posts: 15
Joined: 27 Nov 2024, 10:49

Partition type

Post by peters »

Hello

I am trying to partition a drive using 12.51 and then 12.79 as:

c: BGM
d: FAT32
e: FAT32
f: FAT32
g: FAT32
h: LNX

d: and e: are 10G, f: and g: are 60G

I am trying to config it so it can be accessed from linux so I was trying different combinations of compatibility:

When I tried GPT, TOS/Windows with Byte swapping it created:

c: BGM
d: FAT32
e: BGM
f: BGM
g: BGM
h: LNX

When I changed it to just TOS, GPT, Byte swap then it creates the correct FS types.

Why has it changed 3 of the 4 large partitions to BGM and left d: as FAT32 ?

I cannot run mkfatfs on BGM
uweseimet
Site Admin
Posts: 368
Joined: 10 Jan 2010, 15:39

Re: Partition type

Post by uweseimet »

HI Peter,

Before I go into detail, please let me make some general remarks:

1. There is exactly one usage scenario where byte-swapping is needed: A drive is connected to an Atari's (or clone's) IDE port, and you want to use this drive for data exchange with other platforms (Mac, PC, ...), or with other Atari buses (ACSI, SCSI, USB). In any other case, byte-swapping is a bad idea. It requires a driver that supports it, like HDDRIVER. The driver has to swap all data it reads, which makes data transfers considerably slower. Furthermore, the TOS bootstrap process cannot deal with byte-swapping. Even if it TOS could boot from such a drive, e.g. a patched TOS, you would still suffer from slow transfers.
2. It is not recommended to use TOS/Windows-compatible media as boot media for the Atari. Why this is not a good idea has been explained many times, therefore I will not go into detail here.
3. Byte-swapping and the partitioning scheme are two completely different things, not related at all.

Regarding mkfatfs, I don't use it with the Atari. You did not explicitly say whether this was on the Atari (e.g. with MiNT or Linux-68k) or on a PC with LInux. If this was on Linux, please see the partitioning page for Linux limitations regarding TOS (BGM) partition sizes. Also see the partitioning thread.


But your core problem appears to be this one: With HDDRUTIL, you created a 60 GB TOS/Windows-compatible F32 partition on a byte-swapped medium with a GPT scheme, but HDDRUTIL later says that this partition is not an F32 partition, but a BGM partition. If you do exactly the same with a non byte-swapped medium, or if the F32 partition on a byte-swapped medium is small, HDDRUTIL correctly says that the partition is an F32 partition. Is my understanding correct? If it is, please simplify your test setup and provide more information as follows:

1. When partitioniong (use HDDRUTIL 12.79, not older), only create a single F32 partition of 60 GB, not several other partitions. The simpler the setup, the easier I can reproduce and analyze it. If your core problem is the one I outlined above, you can most likely reproduce it with just one partition.
2. If you can reproduce it this way, try to make the partition smaller. If you observe the same problem with a smaller partition, this also helps me reproduce it, because I do not have a large enough drive for testing available at the moment.
3. For the simplest partitioning setup that you observe the problem with, save the partition table to a file with the respective option in HDDRUTIL's partitioning dialog. Please do this with HDDRUTIL 13 (you can use the demo version for this), because the GPT support in HDDRUTIL 13 is more extensive than in HDDRUTIL 12. You do not need to touch your HDDRIVER 12 installation for this, i.e. there is no need to install HDDRIVER 13 or the demo version. Just launch HDDRUTIL 13 and use it to export the partition data, so that you can post it here or send it to me in an email.
4. With HDDRUTIL 13, provide a screenshot of the GPT partition editor dialog with the partition list ("Edit Partitions" in HDDRUTIL).
5. Please provide the output of "fdisk -l" (run under Linux) for the drive.
peters
Posts: 15
Joined: 27 Nov 2024, 10:49

Re: Partition type

Post by peters »

A long answer :-)

I suffered a hd crash but I managed to recover the image onto Ubuntu, byte swap it and with DMDE it extracted all the files from each partition.

I am more trying to get all the data back into the Atari drive which is why I was trying byte swap. The Milan can access it but I've not tried to boot from this particular attempt at recovery.

I have an old backup with the same sizes and types of partition and another with even larger 100G sizes so it has worked many times in the past with 11 and 12.

The problem is that I enter 4 partitions as f32 but after partitioning one is f32 and three are BGM.

In both tests I used byte swap, the problem looks to be caused by using TOS/WIN compatibility.

I don't think it's the size is important as long as the f32 is bigger than BGM supports. I think you could reproduce it with 4G partitions for instance.
uweseimet
Site Admin
Posts: 368
Joined: 10 Jan 2010, 15:39

Re: Partition type

Post by uweseimet »

As already mentioned, I need to reproduce your problem. Therefore, please provide the information I asked for, as far as possible, in particular the data displayed by HDDRUTIL 13 and fdisk.
A systematic approach is needed, based on what the tools say.
uweseimet
Site Admin
Posts: 368
Joined: 10 Jan 2010, 15:39

Re: Partition type

Post by uweseimet »

The only medium with a large enough capacity that I can currently use for testing purposes is an SD card which is unfortunately broken. But I could still run some tests with it. You have not yet provided the information I have asked for, and therefore I could just run some general tests.

For my tests I used HDDRUTIL, both 12.79 and 13.02. I created two TOS/Windows-compatible GPT partitions: One with 500 MiB, the other with 59 GiB capacity. As expected, whether byte-swapping was enabled or not did not make a difference. Of course, Linux (fdisk or mount) can only use one of the two formats, namely the (from the Linux perspective) unswapped one.

This is the HDDRUTIL 13 partition data export (a CSV file with tabs a separators):

Code: Select all

HDDRUTIL 13.02 Partitioning Overview:

Linux SCSI (Bus A) 7.0: Generic MassStorageClass, 59.02 GiB

Partition Scheme: TOS/Windows GPT

ID	Partition Type GUID	Partition GUID	GPT Name	GPT Attributes	Start	End	Sectors	Capacity
$0E	'EBD0A0A2-B9E5-4433-87C0-68B6B72699C7	039A5365-78B9-E921-9CDF-46CCB1F5BC2C'	'Generic MassStorageClass #1	'	0000000000000000	40	1023999	1023960	500.0 MiB
$0E	'EBD0A0A2-B9E5-4433-87C0-68B6B72699C7	647AFE19-21D2-4C3A-50B7-31305AD510F1'	'Generic MassStorageClass #2	'	0000000000000000	1024008	124825495	123801488	59.0 GiB
One thing is wrong here: The second partition has the legacy type $0E (equivalent to BGM), and not $0C (equivalent to F32). This appears to be the BGM/F32 mismatch you have reported for your large partitions. The legacy type is derived from the boot sector data, not from the GPT. The partitioning page explains the details. All Windows FAT16 types and the Windows FAT32 type have the same GUID ("Microsoft basic data"). With the TOS types it is similar ("Atari TOS basic data"). The actual type, FAT16 or FAT32, is derived from the boot sector data, not from the GPT.
Linux refuses to mount the second partition, which is consistent with the mismatch HDDRUTIL reports. It appears as if for large FAT32 partitions, HDDRUTIL does not create a valid FAT32 boot sector/filesystem. I will have to further investigate this.
As a simple work-around, I created a valid FAT32 filesystem for the large partition, /dev/sdi2 in my case, under Linux:

Code: Select all

sudo mkfs.fat /dev/sdi2
Now HDDRUTIL reported this:

Code: Select all

HDDRUTIL 13.02 Partitioning Overview:

Linux SCSI (Bus A) 7.0: Generic MassStorageClass, 59.02 GiB

Partition Scheme: TOS/Windows GPT

ID	Partition Type GUID	Partition GUID	GPT Name	GPT Attributes	Start	End	Sectors	Capacity
$0E	'EBD0A0A2-B9E5-4433-87C0-68B6B72699C7	039A5365-78B9-E921-9CDF-46CCB1F5BC2C'	'Generic MassStorageClass #1	'	0000000000000000	40	1023999	1023960	500.0 MiB
$0C	'EBD0A0A2-B9E5-4433-87C0-68B6B72699C7	647AFE19-21D2-4C3A-50B7-31305AD510F1'	'Generic MassStorageClass #2	'	0000000000000000	1024008	124825495	123801488	59.0 GiB
The legacy type for the second partition is now $0C, which is correct.

All in all, the potential bug is the invalid FAT32 filesystem HDDRUTIL created for a large TOS/Windows-compatible FAT32 partition. As far as I can tell, this is exactly what you have also stumbled upon. Byte-swapping and the GPT scheme are not involved at all. The GPT scheme is valid, but the filesystem is not. Therefore, mkfs can selectively fix this by creating a new, valid FAT32 filesystem, without touching the partition scheme.

Do I explicitly have to point out that all this information is not relevant for standard setups, but only for expert users with rather exotic setups? ;-)
peters
Posts: 15
Joined: 27 Nov 2024, 10:49

Re: Partition type

Post by peters »

This might take me a few days. While I've got some of the recovered hd copied into an Atari readable drive I'm going to copy it over to my boot drive.

Once the data is copied I will have a drive I can experiment on.
peters
Posts: 15
Joined: 27 Nov 2024, 10:49

Re: Partition type

Post by peters »

It isn't the byte swapping that caused partition type error, it is the TOS/WIN compatibility mode.