Applet for detecting the filesystem type.

Sameer Naik sameer.subscriptions at damagehead.com
Thu Nov 25 02:38:54 UTC 2010


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.

Regards
~Sameer


On Thu, Nov 25, 2010 at 7:49 AM, Sameer Naik
<sameer.subscriptions at damagehead.com> wrote:
> Hi,
>
> fdisk -l /dev/sdc shows me the following output.
>
>   Device Boot      Start         End      Blocks   Id  System
> /dev/sdc1               1         584     3926016    5  Extended
> Partition 1 has different physical/logical beginnings (non-Linux?):
>     phys=(0, 32, 33) logical=(0, 34, 43)
> Partition 1 has different physical/logical endings:
>     phys=(488, 227, 59) logical=(583, 195, 59)
> /dev/sdc5               1          79      524288   83  Linux
> /dev/sdc6              79         157      524288   83  Linux
> /dev/sdc7             157         235      524288    b  W95 FAT32
> /dev/sdc8             235         313      524288    7  HPFS/NTFS
>
> Here the last (two) fields report the partition type, not exactly but
> to some extent. Meaning "Linux" could mean ext2/ext3 and so on.
> However it seems to atleast zero in on a set of partition types.
>
> 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"
>
> Regards
> ~Sameer
>
> On Wed, Nov 24, 2010 at 12:59 PM, Sergey Naumov <sknaumov at gmail.com> wrote:
>>>> I would like to know if there is any existing applet in busybox so as
>>>> to determine the file system type of a disk partition.
>>>
>>> fdisk -l will show the size and type.
>>>
>>>>>> Dan
>>
>> As far as I know, fdisk -l shows filesystem type for partition as it
>> was selected at the moment of partitionizing (and it get this
>> information from MBR). But there is no guarantee that the real
>> filesystem type is the same at it was specified in MBR. So if you can
>> guarantee, that at your system partition types in MBR corresponds to
>> real partition types, then you can use fdisk -l, else you should look
>> for another utility.
>>
>> Sergey Naumov.
>> _______________________________________________
>> busybox mailing list
>> busybox at busybox.net
>> http://lists.busybox.net/mailman/listinfo/busybox
>>
>


More information about the busybox mailing list