info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Info-mtools] Bug: mformat does not format FAT32 correctly


From: Alain Knaff
Subject: [Info-mtools] Bug: mformat does not format FAT32 correctly
Date: Sun, 23 Sep 2018 23:06:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hi,

On 11/08/18 15:42, Pali Rohár wrote:
> On Monday 04 December 2017 19:29:53 Pali Rohár wrote:
>> 1) mformat is not able to format disk images without specifying C/H/S
>> geometry. Nowadays there is no hard disk or SSD disk which use C/H/S
>> geometry and therefore asking user for such thing does not make sense.

Actually, with physical disks, mtools asks the kernel for a geometry.

However, you're right: the issue is indeed relevant for image files,
which have no innate geometry.

[...]
> Hi! In attachment is a patch which automatically calculates C/H/S
> geometry based on LBA Assist Translation formula just from the size of
> disk. So formatting non-C/H/S disks (today *all* disks) via mformat is
> automatic without need to specify C/H/S numbers. This applies also for
> disk images.
> 
> This patch also adds support for detecting logical sector size of disk
> and propagates it to FAT sector size. This is needed for a new Native 4K
> disks which have sector size 4096 bytes (and not 512).
> 
> So with this patch (and previous one) is formatting Native 4K disk of
> 16 TB to FAT32 easily, just with command:
> 
> $ mformat -F :: -i /dev/sdc
> 

I looked at the patch, and it seems to contain more than bargained for :-)

Indeed, there seems to be debugging code left in: messages printed to
stdout, or messages meant for final diagnostic being printed out right
away before all available options (drive definitions) have been tried.

Also, there is some puzzling "late capping" of sector_size which should
be unneeded (ssize is already being capped at input), and which would
introduce inconsistencies if for some reason it did indeed kick in.

Could you please review your patch, and only keep in those items that
are actually relevant for the purpose at hand (C/H/S calculation and
reading sector size), and resend it?

... or, if these are indeed needed, maybe include a comment and/or
explanation what they are doing?

Thanks,

Alain



reply via email to

[Prev in Thread] Current Thread [Next in Thread]