[Solved] USB Hub + Drive Mounting

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
sagar777
DD-WRT Novice


Joined: 02 Jan 2011
Posts: 17

PostPosted: Fri Jan 14, 2011 4:01    Post subject: Reply with quote
then you should change pn=1 in the script
_________________
ASUS RT-N16.
DD-WRT v24-sp2 (12/19/10) mega - build 15943M NEWD-2 K2.6 Eko.
Optware the Right way.
USB1=8GB Transcend Flash
USB2=2TB HDD (Not working yet)

----
USB1 partitioning:
* /opt 2048 megabytes
* swap 256 megabytes
* /jffs 1024 megabytes
* data remainder of the disk (/mnt 4.4GB)
---
Sponsor
twig123
DD-WRT User


Joined: 02 Oct 2010
Posts: 56

PostPosted: Fri Jan 14, 2011 4:32    Post subject: Reply with quote
Ah! (This is all a little above my head...)
I was going by the code frater had posted and just changed my block size as was suggested.

If the script is looking for the 2nd partition, that would make since why it wasn't working on mine. I haven't had much time in the last couple days, so once I get a free second I'll re-edit the script and try it again.

Thanks for the heads up! Smile
twig123
DD-WRT User


Joined: 02 Oct 2010
Posts: 56

PostPosted: Sat Jan 15, 2011 3:48    Post subject: Reply with quote
Awesome, the below script works mounting my /opt now!
Code:
ord() {
  printf '%d' "'$1"
}
insmod mbcache
insmod jbd
insmod ext2
insmod ext3
pn=1
prt="4192933 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

Next hurdle...
How do we mount the rest of the partitions?
I have a data partition on the same drive as OPT that is ext3 and was previously mounted to /mnt. I also have my 2TB Drive that is NTFS formatted (not sure where this needs to be mounted to, /mnt/2TB ?).

I can mount /mnt from telnet with this:
mount -U -0ad975bd-aac6-4d98-8063-d230dede6d93 /mnt
but doesn't seem to work from startup script in WebIF... Feel free to interject what I'm doing wrong :P

Also, just messing around tried to mount the 2TB to /mnt with a similar command via telnet and get an error: "mount: unknown filesystem type 'ntfs'"
Does it not know what NTFS is??

Thanks for all the help so far guys!
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sat Jan 15, 2011 4:37    Post subject: Reply with quote
The startup script is only meant as a bootstrap replacement for the automounting in DD-WRT.

It should only mount a specific ext partition to /opt. After that you should load OTRW on that partition and reboot.

OTRW will kick in after that partition is mounted. S01fixparts will create all the possible nodes in /dev (/dev/sda, /dev/sda1 .... /dev/sdh15 ) and S35automount will mount all the mountable partitions.

Tell me where things don't run according to this scenario?

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sat Jan 15, 2011 4:45    Post subject: Reply with quote
twig123 wrote:
I can mount /mnt from telnet with this:
mount -U -0ad975bd-aac6-4d98-8063-d230dede6d93 /mnt
but doesn't seem to work from startup script in WebIF... Feel free to interject what I'm doing wrong Razz

mount -U doesn't work in DD-WRT's busybox. OTRW will change the $PATH and use /opt/bin/mount which is the full GNU util (part of util-linux-ng)

Code:
~# ipkg-opt list | grep util-linux-ng
getopt - 2.15-2 - The getopt utility from the util-linux-ng package.
util-linux-ng - 2.15-2 - A suite of essential utilities for any Linux system, this version is a fork of util-linux.



Code:
~# which mount
/opt/bin/mount
~# ls -l /bin/mount
lrwxrwxrwx 1 root root 7 Dec 15 23:12 /bin/mount -> busybox
~# ls -l /opt/bin/mount
lrwxrwxrwx 1 root root 28 Jul 25 13:30 /opt/bin/mount -> /opt/bin/util-linux-ng-mount

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
twig123
DD-WRT User


Joined: 02 Oct 2010
Posts: 56

PostPosted: Sat Jan 15, 2011 5:44    Post subject: Reply with quote
frater wrote:
OTRW will kick in after that partition is mounted. S01fixparts will create all the possible nodes in /dev (/dev/sda, /dev/sda1 .... /dev/sdh15 ) and S35automount will mount all the mountable partitions.

Tell me where things don't run according to this scenario?

With 'Automatic Drive Mount' disabled in WebIF and the 'automount' service disabled, the script mounts /opt with no hitch (no other partitions, but /opt works great)

If I enable the 'automount' service (with only 1 drive connected), all partitions get mounted /opt /mnt swap etc.

If I enable the 'automount' service and connect the second (NTFS) drive, the router never seems to fully boot (I get telnet prompt then it disconnects) and it keeps going in a reboot loop until I remove the 2nd drive.

Perhaps a build issue with my firmware version (maybe something wrong with the NTFS support in it)? I'm not an expert though, just guessing.
Any thoughts?
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sat Jan 15, 2011 11:02    Post subject: Reply with quote
At what moment does it start to loop?
Does it ever start optware?

What's in /opt/var/log/messages?
What happens if you have all drives connected and have an empty rc_startup?

If the cycling reboots occur after optware mounts, you could have 3 telnet sessions.
One with a tail -f /var/log/messages, 1 with tail -f /opt/var/log/messages and a 3rd which starts the script that would normally be in your rc_startup (putty works great for this => right click=paste clipboard).

note: Do use the telnet protocol as the dropbear daemon gets a restart in OTRW to reread the message with 'Enhanced with OTRW' in it and to make sure you are running a shell with the new environment (so, not only cosmetic).

A 2nd drive, even NTFS works fine. I have it working here. I don't have a hub though.

BTW... You do know I intended S35automount to be used with hotmounts? You should be able to start everything, check the mounts and then plugin your 2nd drive. Each 10 minutes, the automount will start....

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
twig123
DD-WRT User


Joined: 02 Oct 2010
Posts: 56

PostPosted: Sun Jan 16, 2011 3:42    Post subject: Reply with quote
frater wrote:
At what moment does it start to loop?
Does it ever start optware?

What's in /opt/var/log/messages?

What happens if you have all drives connected and have an empty rc_startup?

I'm not sure how to tell when it is looping...
I know that the router boots, I get my WiFi connection (no WAN though) for just a minute. I can telnet really quick and it comes up with the "Enhanced with OTRW" (which I've noticed if /opt doesn't start it doesn't have this, of course), but then telnet disconnects and WiFi then shows as limited connectivity and I am no longer able to access the router. Within a few minutes the router seems to reboot, WiFi comes back (still no WAN) and keeps doing this until I disconnect the 2nd drive.

Once the 2nd drive is removed (during the above loop) the router will come back up and work normally (after it reboots itself again).

I attached the log from when I have the above problem.

If I delete the script in rc_startup, the router boots... but /opt is never mounted and as such doesn't start optware...



messages.txt
 Description:
Two Drives connected, then 2nd removed and allowed to recover after a reboot

Download
 Filename:  messages.txt
 Filesize:  54.27 KB
 Downloaded:  484 Time(s)

frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Jan 16, 2011 4:59    Post subject: Reply with quote
twig123 wrote:
If I delete the script in rc_startup, the router boots... but /opt is never mounted and as such doesn't start optware...

That's why I proposed to manually insert the code on the command-line with 3 telnet sessions.
Your 2nd disk will get mounted and you know at which point
But it's not necessary anymore. I checked the /opt/var/log/messages and it seems it crashes the moment you run /opt/bin/ntfs-3g.

You could try the ntfs-3g binary that comes with DD-WRT:
Code:

wget -O /opt/bin/ntfs-3g http://wd.mirmana.com/ntfs-3g.ddwrt
chmod +x /opt/bin/ntfs-3g

To revert this, run
Code:

wget -O /opt/bin/ntfs-3g http://wd.mirmana.com/ntfs-3g.optware


I noticed I didn't have the fuse.ko module in my firmware (only the one downloaded from the dd-wrt website). But I'm running a Kong mod....

It seems you need the flavour 'BIG' to have NTFS-support in DD-WRT.

Please let me know how this one goes.

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
twig123
DD-WRT User


Joined: 02 Oct 2010
Posts: 56

PostPosted: Sun Jan 16, 2011 5:30    Post subject: Reply with quote
frater wrote:
You could try the ntfs-3g binary that comes with DD-WRT:
Code:

wget -O /opt/bin/ntfs-3g http://wd.mirmana.com/ntfs-3g.ddwrt
chmod +x /opt/bin/ntfs-3g
Still no joy. Appears to do the same as before.

frater wrote:
I'm running a Kong mod....
I was interested in the Kong firmware, but I don't believe there is a version formatted for my Linksys E3000. If you know of one, shoot me a link.

frater wrote:
It seems you need the flavour 'BIG' to have NTFS-support in DD-WRT.
I thought the MEGA build included NTFS support, but I guess not. I'll flash a newer BIG build instead of my current MEGA build and then post the results.
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Jan 16, 2011 6:10    Post subject: Reply with quote
twig123 wrote:
Still no joy. Appears to do the same as before.
Crashing and then rebooting sounds more like there's something wrong with the module (fuse.ko) than with anything else...
Maybe there's a better one than the one Eko posted a year ago.

Have you tried another disk with NTFS on it?
Have you ever succeeded to mount an NTFS-partition on your E3000?

I will check if someone else has a more modern fuse.ko

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
twig123
DD-WRT User


Joined: 02 Oct 2010
Posts: 56

PostPosted: Sun Jan 16, 2011 6:16    Post subject: Reply with quote
I have another external drive, but it is not NTFS, and wouldn't be easy to convert it to test.

This would be the first time trying to use NTFS for me. Since I don't have another drive to test (easily), I could always just add a NTFS partition to my main Optware drive and test that...
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Jan 16, 2011 6:46    Post subject: Reply with quote
I loaded the big build on one of my routers.
The fuse.ko seems different...

Try this

Code:
KERNEL=`uname -r`
wget -O /opt/lib/modules/$KERNEL/fuse.ko http://wd.mirmana.com/fuse.ko.ddwrt
chmod +x /opt/lib/modules/$KERNEL/fuse.ko


I did notice there's a special BIG build for E3000.
I don't know why, but I would really try that build if I were you.
I still would like to know if the above module works.
And if you could do a 'diff' between this new fuse you can download at my place and the one in the E3000-flash

after flashing big build and downloading fuse.ko.ddwrt:
Code:
diff /lib/modules/2.6.24.111/kernel/fs/fuse/fuse.ko /opt/lib/modules/2.6.24.111/fuse.ko

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
twig123
DD-WRT User


Joined: 02 Oct 2010
Posts: 56

PostPosted: Sun Jan 16, 2011 8:30    Post subject: Reply with quote
frater wrote:
Code:
KERNEL=`uname -r`
wget -O /opt/lib/modules/$KERNEL/fuse.ko http://wd.mirmana.com/fuse.ko.ddwrt
chmod +x /opt/lib/modules/$KERNEL/fuse.ko
With the above fuse, the router works more as expected with my current MEGA build.
/opt is mounted, optware starts and seems to mount both the EXT3 data partition AND the NTFS data partition on the 2nd drive!

/dev/sdb1 on /opt type ext3 (rw,noatime,data=ordered)
/dev/sdb4 on /mnt type ext3 (rw,noatime,data=ordered)
/dev/sdb3 on /tmp/c type ext3 (rw,noatime,data=ordered)
/dev/sda1 on /mnt type fuseblk (rw,user_id=0,group_id=0,default_permissions,allow_other)

I noticed both Data partitions show as mounted to /mnt. When I browse to /mnt I see only the data on the 2nd (NTFS) drive...
Shouldn't the 2nd drive be mounted to a different folder (within /mnt) instead of just the root of /mnt?

frater wrote:
I did notice there's a special BIG build for E3000.
I don't know why, but I would really try that build if I were you.
The builds for the E3000 (and E2000) are specialized, I think it's due to something about the memory on the units or something (but I'm never really read into exactly what was different. I just know the wiki and the forums say to always use the builds specificly made for the e2k-e3k units.
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sun Jan 16, 2011 9:17    Post subject: Reply with quote
Well, it seems that's solved.
The fuse.ko offered on the dd-wrt website is not good (anymore?). The proper module will now be downloaded when you install optware. That module is the same as the one in the big build....

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next Display posts from previous:    Page 3 of 7
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum