Uninformative mount error when mounting unknown filesystem

beebee at piments.com beebee at piments.com
Thu Jun 24 07:46:06 UTC 2010


On 06/24/10 04:12, Denys Vlasenko wrote:
> On Wednesday 23 June 2010 21:57, Silas Silva wrote:
>> Hi all,
>>
>> I recently modified the Debian Lenny installer to automated some install
>> tasks.  I modified the ``init`` script on the initrd to make what I
>> wanted.  In this script, I have full access to the busybox binary in
>> /bin (an all the symlinks that point to it).
>>
>> I then tried to mount a ext3 partition, but got an error:
>>
>>      # mount /dev/sda1 /mnt
>>      mount: mounting /dev/sda1 on /mnt failed: No such file or directory
>>
>> I also tried to pass the ``-t ext3`` flag:
>>
>>      # mount -t ext3 /dev/sda1 /mnt
>>      mount: mounting /dev/sda1 on /mnt failed: No such device
>>
>> I took some time to discover that the problem was actually that the
>> initrd didn't have the ext3 module, but the error is really not clear.
>
> The program simply displays a textual equivalent of numeric
> errno value. It has no idea what really caused the error.
>
>> Something like "mount: unknown filesystem type 'ext3'" or "do you have
>> the ext3 kernel module" or whatever would be better.  Is there any
>> interest about making that?  Actually, is this possible in busybox'es
>> environments?
>
> I think mount error codes just do not map well to
> existing errno values. There is no ENOSUCHMODULE code.
>
> What solution do you propose.

If I try a similar command on a desktop system using an fs that is not 
in my kernel and has no module, it gives a sensible error:

bash# mount -t yaffs /dev/sda11 /mnt/tmp
mount: unknown filesystem type 'yaffs'

It seems standard mount does detect this condition , and  the wrong 
error code is being attributed here.

best.


More information about the busybox mailing list