Applet for detecting the filesystem type.

Dan Fandrich dan at coneharvesters.com
Thu Nov 25 06:11:47 UTC 2010


On Thu, Nov 25, 2010 at 08:08:54AM +0530, Sameer Naik wrote:
> The main reason why i need to detect the partition type before
> mounting is so that i can specify the "iocharset" mount option to the
> mount command. If i do not specify the charset, unicode characters do
> no work and iconv() calls in applications as well start reporting
> errors during the conversion.
> 
> This issue shows up mainly for fat32 and ntfs partitions and i have to
> specify "iocharset=iso8859-1,utf8" at the time of mounting fat32 and
> ntfs partitions.
> 
> On Thu, Nov 25, 2010 at 7:49 AM, Sameer Naik
> > I do not understand what you mean by "if you can
> > guarantee, that at your system partition types in MBR corresponds to
> > real partition types"

Linux for the most part ignores the partition type field in the MBR; you
could set a partition type to 40 (Venix 80286) and Linux would still
happily mount it as ext2/3 or whatever it auto-detects.  But most partition
types are actually set correctly by whichever installer created each
partition, so using the MBR type to detect FAT and NTFS partitions in this
way should almost always work in practise.

>>> Dan


More information about the busybox mailing list