Page 1 of 1
USB Storage = No USB disks connected
Posted: Mon May 02, 2011 11:11 pm
by doritos
Hi,
I've a 1.5Tb Seagate disk connected to the USB port that is correctly recognized by stock firmware or dd-wrt, but not with Gargoyle
dmesg shows the following messages
Code: Select all
scsi 0:0:0:0: Direct-Access ST315003 41AS PQ: 0 ANSI: 2 CCS
usb-storage: device scan complete
sd 0:0:0:0: [sda] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 34 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Assuming drive cache: write through
sda: sda1 sda2 sda3 sda4
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI disk
But the webif shows "No USB disks connected". Any idea?
Re: USB Storage = No USB disks connected
Posted: Tue May 03, 2011 7:19 am
by doritos
Re: USB Storage = No USB disks connected
Posted: Tue May 03, 2011 9:37 am
by doritos
I like to solve my own problems
The problem happens when you have partitions in your harddrive/usb stick wich filesystem is not FAT/NTFS or ext. I my case, I have a swap partition and this causes the script to die abnormally (tries to calculate the size) and never removes the lock files.
My suggestion is to add a better handling for the type detection in
/etc/init.d/usb_storage. What I did was:
Before:
Code: Select all
if [ "$type" = "FAT32" ] || [ "$type" = "FAT16" ] ; then
mkdir -p "/tmp/usb_mount/$id"
chmod 777 "/tmp/usb_mount/$id"
umount "/tmp/usb_mount/$id" 2>/dev/null
err=$(mount -t vfat -o umask=0,dmask=0 "$d" "/tmp/usb_mount/$id")
elif [ "$type" = "NTFS" ] ; then
mkdir -p "/tmp/usb_mount/$id"
chmod 777 "/tmp/usb_mount/$id"
umount "/tmp/usb_mount/$id" 2>/dev/null
err=$(ntfs-3g "$d" "/tmp/usb_mount/$id")
elif [ -n "$type" ] ; then
mkdir -p "/tmp/usb_mount/$id"
chmod 777 "/tmp/usb_mount/$id"
umount "/tmp/usb_mount/$id" 2>/dev/null
err="tmp"
ext_num=4
while [ -n "$err" ] && [ $ext_num -ge 2 ] ; do
type="ext$ext_num"
err=$(mount -t $type -o noatime "$d" "/tmp/usb_mount/$id" 2>&1)
ext_num=$(($ext_num-1))
done
fi
After
Code: Select all
if [ "$type" = "FAT32" ] || [ "$type" = "FAT16" ] ; then
mkdir -p "/tmp/usb_mount/$id"
chmod 777 "/tmp/usb_mount/$id"
umount "/tmp/usb_mount/$id" 2>/dev/null
err=$(mount -t vfat -o umask=0,dmask=0 "$d" "/tmp/usb_mount/$id")
elif [ "$type" = "NTFS" ] ; then
mkdir -p "/tmp/usb_mount/$id"
chmod 777 "/tmp/usb_mount/$id"
umount "/tmp/usb_mount/$id" 2>/dev/null
err=$(ntfs-3g "$d" "/tmp/usb_mount/$id")
elif [ -n "$type" ] ; then
mkdir -p "/tmp/usb_mount/$id"
chmod 777 "/tmp/usb_mount/$id"
umount "/tmp/usb_mount/$id" 2>/dev/null
err="tmp"
ext_num=4
while [ -n "$err" ] && [ $ext_num -ge 2 ] ; do
type="ext$ext_num"
err=$(mount -t $type -o noatime "$d" "/tmp/usb_mount/$id" 2>&1)
ext_num=$(($ext_num-1))
done
else
err="not mountable partition"
fi
Note the else/err= assignment, this will cause the next if to not try to do any calculation with such useless partitions.
hope this helps someone
Re: USB Storage = No USB disks connected
Posted: Thu May 05, 2011 7:02 pm
by Eric
I just added your fix, it will be included in the next release. Thanks!