WikiDevi.Wi-Cat.RU:DD-WRT/USB Drive Mounting Issue's

From WikiDevi.Wi-Cat.RU
Jump to navigation Jump to search
Login through ssh or telnet and:

1) check usb_storage module is properly loaded (lsmod)
2) check the kernel log right after insertion of usb drive (dmesg |tail -n15)
3) check the kernel log for errors while loading usb drivers (dmesg |grep -i -C10 [euo]hci)

If nothing suspicious is catches your eye, try mounting your drive manually: mount /dev/sda1 /mnt
then df -h to check if it's mounted as it succeeded.
scsi 0:0:0:0: Direct-Access     Century  EX35SW8_SB8-A    0100 PQ: 0 ANSI: 2
sd 0:0:0:0: [sda] 1666446768 512-byte hardware sectors (853221 {{abbr|MB|MegaBytes}})
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] 1666446768 512-byte hardware sectors (853221 {{abbr|MB|MegaBytes}})
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
sd 0:0:0:0: [sda] Assuming drive cache: write through
 /dev/scsi/host0/bus0/target0/lun0: p1 p2 p3 p4
sd 0:0:0:0: [sda] Attached SCSI disk
usb-storage: device scan complete

01/07/2011

frater:

If DD-WRT is the culprit, you could turn automount off in the webif and use this code to mount the correct partition

insmod mbcache
insmod jbd
insmod ext3
prt='1465215 sd.2'
n=1
while [ $n -lt 300 ] ; do
 if [ -z "$p" ] ; then
   p=`grep "$prt" /proc/partitions | awk '{print $4}'`
 else
   grep -q "$p" /proc/mounts && break
   mount -o noatime /dev/$p /opt
 fi
 let n+=1
 sleep .3
done

You should do a 'cat /proc/partitions' to see what you need to put in 'prt=' Replace the letter (a/b/c/d..) with a dot as a wildcard. It will not work properly if the blocksizes of your different partitions are the same.


I don't know if you need to start optware then or if DD-WRT will do it. I haven't seen how they implemented it on my request.

You need to place this after the loop if nothing happens:

/opt/etc/init.d/optS &

01/08/2011

I decided to put the final (and working) solution in a separate post:

ord() {
  printf '%d' "'$1"
}
insmod mbcache
insmod jbd
insmod ext2
insmod ext3
pn=2
prt="478144 sd.$pn"
n=1
while [ $n -lt 500 ] ; do
 if [ -z "$p" ] ; then
   p=`grep "$prt" /proc/partitions | awk '{print$4}'`
   pc=`echo $p | cut -b3`
 else
   grep -q '/opt' /proc/mounts && break
   mknod /dev/$p b 8 $((16 * (`ord $pc` - 97) + $pn))
   mount -o noatime /dev/$p /opt
 fi
 let n+=1
 sleep 1
done


PS I have my own WDS now with this setup, so I can continue working with it....