Hi, 

> On Feb 27, 2023, at 7:27 AM, Bernd Boeckmann via Freedos-devel 
> <freedos-devel@lists.sourceforge.net> wrote:
> 
> Hi Jerome,
> 
>> Am 26.02.2023 um 23:31 schrieb Jerome Shidel <jer...@shidel.net>:
>> 
>> Unfortunately, the current FDISK performs this task be creating a bunch of 
>> 2GB partitions. This tends to annoy users installing on real hardware with 
>> very large disks.
> 
> Yes at the moment it sadly is hardcoded to creating partitions of 2048 MB in 
> size.
> 
>> I propose two additional options that could be added to modify what occurs 
>> when partitions are automatically created.
>> 
>> First, the ability to only create a single partition automatically. Leaving 
>> the the remainder of the disk unallocated. 
>> 
>> Second, an option to tell it to use FAT32 and create the partitions as large 
>> as possible.
>> 
>> The options could be used together or separately along with the 
>> auto-partition option.
> 
> FDISK should already be able to create primary partitions etc. from the 
> command line. Therefore suggest the following:
> 
> fdisk /ifempty /pri:<size> …

We learn something new every day… Where were you about 7 or 8 years ago when I 
was creating the installer? I had not been used FreeDOS much up to then and it 
would have been great to have this simple answer at that time. 

Seriously, thank you. :-)

I just did a simple test inside a VM with a 32gb drive. Booted T2302 Live CD 
and ran:

fdisk /pri:8589934592,100 1
Invalid partition size specifed                 ; should be ‘specified'
Program terminated

fdisk /pri:8589934591,100 1                     ; no error or other messages 
displayed

I ran fdisk and checked. Entire drive used with single partition. Good enough. 

Now lets see if I can squeeze an update to both installers out the door before 
the next OS Interim Build (T2303) in just under 48 hours. Not difficult to 
implement. But, I’m tied up with other things at the moment. I will try to work 
it in later today or tomorrow. If it is not ready for T2303, then definitely by 
T2304. 

I think I will go with a max partition of 2GB (FAT16) on real hardware and the 
entire disk (FAT32) inside Virtual Machines. 

On a side note: It might be nice to support '/prio:max’ and '/pri:max’. 

> The proposal here is /ifempty. That would make FDISK terminate if the 
> partition table is not empty, and in effect ignoring all the arguments behind 
> it. So the partitions are conditionally created only if the disk is 
> „uninitialized“.
> 
> Perhaps the FreeDOS installer could make the user choose between a few 
> different partition layouts if it detects that the partition table is empty. 
> If you need a way to make FDISK tell the installer if the disk is empty give 
> me a note. I can make FDISK return that info via exit code in a fdisk 
> /isempty like call.
> 
> The /auto option then could for compatibility reasons stay as it is.
> 
> Greetings, Bernd

At present, the installer looks to see if there is an existing usable DOS 
partition. If there is not and if there are no partitions at all, it 
auto-partitions the drive. If there is not and any partitions exist, it 
executes fdisk and lets the user worry about the problem. 

It performs the check for partitions by using FDISK and parsing the returned 
information about the drive. While having an /isempty option is not required at 
present, it would be much better to have FDISK perform the test instead of the 
installer. That way in the future, no problems occur if the return information 
from FDISK is modified in such a way that the installer cannot figure out. 

That would simplify that portion of the installer to just… Hey, try and make a 
partition if it is empty. Failed? Ok, run then fdisk. 

It would also permit the installer to “auto-partition” an empty drive when it 
was not able to create a ram disk. Which is required to parse the return 
information by the batch based installer when no existing usable drives are 
ready.

:-)

Jerome

_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to