On Tue, Mar 08, 2011, Shawn Guo wrote:
> Have a look at the /dev/sdb change in device report before and after
> the command you suggest ...

 Interesting :-)

 But the linaro-media-create "size" output is probably broken for the
 same reason: sdb appears to be unavailable for some time after changing
 the partition table:

> Are you 100% sure, on selecting [/dev/sdb] (y/n)? n
> r65073@S2101-09:~/image/linaro$ sudo parted -s /dev/sdb mklabel msdos && sudo 
> sfdisk -L /dev/sdb
> /dev/sdb: No medium found
> 
> sfdisk: cannot open /dev/sdb read-write

 That's pretty convincing to me; anything relevant in dmesg?

 We could do something like the attached shell script; would you mind
 running it to confirm this works without removing/reinserting the MMC?
 I'm curious to see how much time your drive needs to come back.

-- 
Loïc Minier
#!/bin/sh

set -e

sudo="sudo"
if [ $(id -u) -eq 0 ]; then
    sudo=""
fi

usage() {
    echo "Usage: $0 <block-device>" >&2
    exit 1
}

if [ $# -ne 1 ]; then
    usage
fi

dev="$1"

if [ ! -b "$dev" ]; then
    usage
fi

set -x

$sudo parted -s "$dev" mklabel msdos

#sync?

nap_time=0
while :; do
    if $sudo sfdisk -L "$dev" >/dev/null 2>&1; then
        break
    fi
    if [ $nap_time -ge 30 ]; then
        echo "Giving up after $nap_time seconds failing to list partitions" >&2
        exit 1
    fi
    sleep 1
    nap_time=$(($nap_time + 1))
done

echo "Could list partitions after $nap_time seconds!" >&2

_______________________________________________
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev

Reply via email to