1

Topic: FAT12 support and other notes

Hello guys smile.
To make the story short, I actually needed to use gparted to solve an issue with the partitioning/filesystems of a small "dedicated" Linux distro, Zeroshell:
http://www.zeroshell.net/eng/
I used gparted through the parted magic distro.
The issue was that the Zeroshell image I tested ZeroShell-1.0.beta16-CompactFlash-IDE-USB-SATA-1GB.img.gz has a "queer" layout and uses the GRUB (legacy) bootmanager installed to the MBR+hidden sectors.
The hardware I tested it on had one of those "Insyde" BIOS that are (seemingly by design) not compatible with the GRUB MBR.
Another peculiarity of Zeroshell is that it has (let's say on "sda"):
sda1 <- "boot" partition with /grub and vmlinuz+initrd ext2/3
sda2 <- an image of the CD-ROM (as well marked with id 0x83 in the partition table)
sda3 <- the "profiles" partition ext2/3
(no "active" partition)
When booting it has some "mechanism" that checks the integrity of these partitions.
Since I needed to have the thingy working, I thought that it would have been easy to shrink a very little bit the third partition, make a fourth one and set this latter "active" putting in it grub4dos and writing a "plain" MBR to the CFcard.
(I am much more a DOS/Windows guy)
So I shrinked it just a little bit (5 or 6 Mb if I recall correctly) and everything went OK, but seemingly gparted doesn't support the FAT12 filesystem and asked for a partition at least 16 Mb to format it FAT16.

As a matter of fact the FAT12 and FAT16 are so similar that I found it strange that support for it was not included, I do understand how the need for it may be "rare", but still I find it desirable.

I had to resort to a DOS boot disk and Ranish Partition Manager to create the filesystem and setting up the thingy.

The other thing that I noticed is that there is (seemingly) no way to see in detail how the alignment to (None/Mbit/Cylinder) influences the result.

This is IMHO a far more serious matter, as the final user is probably expecting to be (at least I would have liked to) "in control", and not
depending on "vague" numbers expressed in Mib's.

Another option that would probably be of use would be a sort of "preview" of the operation details.
I mean, let's say that I wanted to shrink a partition and move it "on the right", once I click on "apply" a sequence of operations is performed, but until they are done (or are in the doing) the user gets NO idea of the complexity of the sequence, nor about the single steps involved (resizing, checking, moving, re-checking, etc.)

Mind you, gparted behaved OK (though not entirely as expected) and it came out as a key tool to solve the problem, but it seems to me that there is still something (probably easily solvable) between "a good tool" and "an exceptional tool". 

jaclaz

2

Re: FAT12 support and other notes

Thank you jaclaz for taking the time to outline your thoughts on GParted.

jaclaz wrote:

<snip>... but seemingly gparted doesn't support the FAT12 filesystem and asked for a partition at least 16 Mb to format it FAT16.

With regards to FAT12, can you point us to some free software tools that support create FAT12 file systems and permit resizing?

Currently we use the libparted library to resize FAT16 and FAT32 file systems.  Please note that this library is limited to resizing FAT16/32 file systems of 256 MB or greater.
See Bug 649324 - failure to move / resize fat32 partitions less than 256 MB in size.

jaclaz wrote:

The other thing that I noticed is that there is (seemingly) no way to see in detail how the alignment to (None/Mbit/Cylinder) influences the result.

While operations are in the queue (not yet applied), you can use the menu option "Partition --> Information" to see where GParted is planning to set the start and end sector boundaries based on the alignment chosen.

3 (edited by jaclaz 2012-09-06 11:49:10)

Re: FAT12 support and other notes

gedakc wrote:

With regards to FAT12, can you point us to some free software tools that support create FAT12 file systems and permit resizing?

Currently we use the libparted library to resize FAT16 and FAT32 file systems.  Please note that this library is limited to resizing FAT16/32 file systems of 256 MB or greater.
See Bug 649324 - failure to move / resize fat32 partitions less than 256 MB in size.

No, but my request was not (yet wink ) about resizing the FAT12 partition, only to create it on the space I had freed by shrinking the third partition.

AFAIK Linux has tools capable of creating/formatting/managing FAT12 partitions allright. (the fact that I am not familiar with them and decided to use a DOS tool being obviously irrelevant).

I do understand how the "main" scope of the app is to re-size and move partitions (and that it needs to know the filesystem used) but I see it more as a "universal" partition tool.

To expand on my previous report, in another attempt on that same Zeroshell image, I *needed* (actually wanted to try) moving the "middle" CDROM partition.
Gparted didn't allow me to do that because it didn't "recognize" the filesystem (all in all "righteously" since it was a .iso).
So what I did was (the size is smallish, around 168 mb) to dd the partition to a file on the larger third partition, delete the second partition, re-created a (FAT16, but it doesn't actually matter) partition, move this partition "to the left" after having shrinked the first partition, then re dd-ed the file to the new "location".
I presume that this could be easily doable even on larger partitions by dd-ing chunks of it to a temporary file and "moving" the partiion chunk-by-chunk either beginning "from the left" (to move on the left) or "from the right" (to move on the right).
BTW (IMHO) this same approach could be used whenever the user request is to ONLY move (without shrinking/expanding), adding the step of correcting the only field that would be affected, the "Sectors Before" in the BPB of the bootsector (if any).
Just ideas....


jaclaz wrote:

While operations are in the queue (not yet applied), you can use the menu option "Partition --> Information" to see where GParted is planning to set the start and end sector boundaries based on the alignment chosen.

Thanks, I'll do some more experiments and check smile.

EDIT:
Made a simple test (still on the same "misaligned" image):

/dev/sda3 786.33 Mib
First sector: 370880
Last sector:1981279
Total Sectors:1610400

Resize/Move /dev/sda3
Free Space preceding (MiB): 0
New Size (Mib): 786
Free space following (MiB):0
Align to MiB

Tried switching from MiB to Cylinder -> Nothing
Set back to MiB, inserted 10 MiB "before"
10
776
0
MiB

Partition size in the "main" window has changed from 776 to 775,
space before is 10.91 MiB no space after

Partition Info:
First sector: 393216
Last sector:1980415
Total Sectors:1587200

Cancelled.
Inserted 10 MiB "before", set alignment to Cylinder:
10
776
0
Cylinder

Partition Info:
First sector: 385560
Last sector:1975994
Total Sectors:1590435

Partition size in the "main" window has changed from 776 to 776.58,
space before is 7.17 MiB space after is 2.80 MiB

Cancelled.
Inserted 10 MiB "before", set alignment to None:
10
776
0
None

Partition size in the "main" window has changed from 776 to 776.33,
space before is 10.0 MiB no space after

Partition Info:
First sector: 391360
Last sector:1981279
Total Sectors:1589920

Though I have not checked the actual numbers, I am pretty sure that the calculations are exact, the issue, as I see it, is that a "common" user won't be able with this kind of info to understand at a glance whether the preexisting partition is aligned to what, nor to what it will be aligned after (which doesn't mean that it won't result perfectly aligned to the setting chosen, only that it is pretty hard to make sure before "Applying").
Also, I do know how in "modern" times (and expecially in the Linux world) the CHS data has lost most of it's relevance, but it still bears a great relevance when booting (BIOS) and in most MS Operating Systems (most MS bootsectors need the correct HS geometry).

If you have some time, have a look at the Partition Logic thingy:
httx://partitionlogic.org.uk/download/index.php
though being in a more preliminar stage (and far from being "perfect", and missing many of the functions Gparted has) it has what it seems to me like a more "informative" interface, mybe you could get a few ideas from it.



jaclaz