sdcard Input/output error

Richard Sharpe realrichardsharpe at gmail.com
Fri Mar 5 00:08:34 EST 2010


On Thu, Mar 4, 2010 at 8:06 PM, Richard Sharpe
<realrichardsharpe at gmail.com> wrote:
> On Thu, Mar 4, 2010 at 4:53 PM, Xiangfu Liu <xiangfu at sharism.cc> wrote:
>> Richard Sharpe wrote:
>>>
>>> On Wed, Mar 3, 2010 at 9:59 PM, Xiangfu Liu <xiangfu at sharism.cc> wrote:
>>>>
>>>> Hi
>>>>
>>>> it's auto mount to /card when nanonote boot.
>>>
>>> Well, indeed it does. However, even with the card mounted on /card I
>>> still do not have problems creating directories on it. Perhaps you
>>> have your card in RO mode, or perhaps you have a hardware problem.
>>>
>> Hi Richard, Zear
>>
>> remount the sdcard. the error is gone. here is the mount option different[1]
>>
>> I found the mount option is different. the system mount the sdcard with
>> "sync"
>> option.
>>
>> the sdcard is 8GB.
>>
>>
>> [1]
>> system auto mount:
>> /dev/mmcblk0p1 on /card type ext2 (rw,sync,relatime,errors=continue)
>> manual mount:
>> /dev/mmcblk0p1 on /mnt type ext2 (rw,relatime,errors=continue)
>
> OK, but there is still the issue that if you plug a card into a
> running system it seems to be mounted on /mnt/mmcblk0p1, while if you
> reboot with the card plugged in, it gets mounted on /card.
>
> This is an inconsistency that should be removed. Perhaps I will look
> at this tonight.

OK, here is the problem:

1. In /etc/fstab the device is listed to mount on /card, so, if the
device is plugged in when the system is booted, it will mount on
/card.

2. In /etc/hotplug.d/block/10-mount, we find:

#!/bin/sh

# Copyright (C) 2009 OpenWrt.org

blkdev=`dirname $DEVPATH`
if [ `basename $blkdev` != "block" ]; then

    device=`basename $DEVPATH`
    case "$ACTION" in
	add)
		mkdir -p /mnt/$device
		mount /dev/$device /mnt/$device
		;;
	remove)
		umount /dev/$device
		;;
    esac	

fi

This code is wrong. It should first try to mount /dev/$device to see
if there is an entry in /etc/fstab

That is, something like:

add)
        mount /dev/$device
        if [ $? ]; then
                 mkdir -p /mnt/$device
                 mount /dev/$device /mnt/$device
        fi


-- 
Regards,
Richard Sharpe




More information about the discussion mailing list


interactive