DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-04-02 05:16:52

diamond187
Member
Registered: 2008-03-30
Posts: 6

fonz addon: Script to mount all USB drives

I've cobbled together a script to insert usbstorage and ntfs.ko and mount all USB drives currently attached to the DNS-323 as an additional start item for fonz's great fun_plug. I'm using .5 on 1.04 at the moment, but I really can't see any reason why it wouldn't work elsewhere provided you use the right usb-storage.ko and ntfs.ko modules for your respective kernels.  I take little credit for this script, as much of it was lifted from other (documented in the script) places, I just wanted it for me but thought that I'd share.

Notes:

Your (you provide) usb-storage.ko and ntfs.ko files should be in the standard directory for fonz's script:  /ffp/lib/modules/$(uname -r)/   The $(uname -r) portion for the linux-less out there means your kernel version.  If you don't know it, type "uname -r" (without ""s) at a telnet prompt to find it out, create the directory accordingly.  If you upgrade firmware, there's a good chance your kernel may upgrade as well, 'breaking' the script intentionally until you get a proper version of the .ko files for the new kernel.

In playing around here, I've got a few usb hubs, some of which the DNS likes and some of which it doesn't.  For some reason if it doesn't like the USB hub attached, running fdisk -l will hang, making the script appear to quit.  Before making this autostart, it is HIGHLY advised that you test your particular hardware by manually starting the script.  If it doesnt like your hub or hardware, that's an issue with the kernel driver...

To make this start up automatically, it works just like any other fonz startup

cd/mnt/HD_a2/ffp/start
chmod a+x usb_all.sh


**If you only have a single drive in your DNS-323, you can edit the script to remove the filter for /sdb, it's documented in the script.  Just remember as with any script, either use vi if you know how in the telnet session, or edit it with something like Notepad2 or another program that allows saving files in unix format (CR, not CR+LF). **

...
or to start/stop/status, same thing:

cd /mnt/HD_a2/ffp/start
sh ./usb_all.sh start
sh ./usb_all.sh stop
sh ./usb_all.sh status


Instructions:

Drop usb_all.sh in /mnt/HD_a2/ffp/start
download proper kernel modules (usb-storage.sh and ntfs.ko if you need it)
TEST YOUR EQUIPMENT FOR COMPATIBILITY by typing
sh /mnt/HD_a2/ffp/start/usb_all.sh start

if you get a prompt back, it's good.  It will also tell you the drives it mounted to /mnt/HD_a2/{DRIVE}
If it just 'hangs', it's not compatible.  CTRL+[ will escape from microsoft telnet, then quit, then try other hardware

Once successfully tested, chmod a+x /mnt/HD_a2/ffp/start/usb_all.sh to autostart.

I was able to test FAT formatted and EXT2 formatted drives, but I don't have any HFS or NTFS drives, if they don't work please let me know!

--Diamond187

[edit to put proper firmware version in.. my typo!]

Last edited by diamond187 (2008-04-02 05:18:11)


Attachments:
Attachment Icon usb_all.sh, Size: 3,754 bytes, Downloads: 1,427

Offline

 

#2 2008-04-02 17:40:19

pwvandeursen
Member
Registered: 2007-07-04
Posts: 112

Re: fonz addon: Script to mount all USB drives

thanks for this nice explanation. just a few questions.

my linux version according to the method above is 2.6.12.6-arm1
do I thus make dir /ffp/lib/modules/2.6.12.6-arm1/  (in my case the modules dir also did not exist, can that be a problem?

where do I get the correct usb-storage.ko and ntfs.ko modules

what do I do with usb-storage.sh

thanks for the help

Patrick

Offline

 

#3 2008-04-03 00:14:16

diamond187
Member
Registered: 2008-03-30
Posts: 6

Re: fonz addon: Script to mount all USB drives

pwvandeursen wrote:

thanks for this nice explanation. just a few questions.

my linux version according to the method above is 2.6.12.6-arm1
do I thus make dir /ffp/lib/modules/2.6.12.6-arm1/  (in my case the modules dir also did not exist, can that be a problem?

where do I get the correct usb-storage.ko and ntfs.ko modules

what do I do with usb-storage.sh

thanks for the help

Patrick

On the kernel version/directory name, that is correct.  Also note that if you upgrade your kernel (can happen easily with a firmware upgrade) that you will need to find the right modules for the new kernel, make the new directory, and put the modules there.  It's simply there to prevent a kernel upgrade from accidentally making more problems... You can't tell what inserting a mod into a kernel that doesn't exist yet will do. smile

I got my modules at http://dev.skcserver.de/dns323/, and I used the 1.03 module posted and it works great on 1.04.  of course, unless it matches - test it before adding it to an auto-startup script.  It wouldn't be the end of the world, but it would add a pain in the rear factor trying to rename fun_plug before it's harks the kernel and you have to reboot (a single for instance, there are many other ways of course)

usb-storage.sh comes with fun_plug by fonz and this is just an alternative.  His script is great and everything, but it requires either manual modification to add a device, or it just mounts a single device.  Figured this was an evolutionary upgrade.

Hope this helps,

diamond187

Offline

 

#4 2008-04-03 18:04:49

bq041
Member
From: USA
Registered: 2008-03-19
Posts: 709

Re: fonz addon: Script to mount all USB drives

See also:

http://dns323.kood.org/forum/t1957-scri … vices.html

These scripts can be used to make sure your mounts are the same each reboot, for example, if you plug devices into different ports of your hub, or don't always plug in a device.


DNS-323     F/W: 1.04b84  H/W: A1  ffp: 0.5  Drives: 2X 400 GB Seagate SATA-300
DNS-323     F/W: 1.05b28  H/W: B1  ffp: 0.5  Drives: 2X 1 TB  WD SATA-300
DSM-G600   F/W: 1.02       H/W: B                Drive:  500 GB WD ATA

Offline

 

#5 2010-08-09 06:58:20

m5a5l3m
New member
Registered: 2010-08-09
Posts: 1

Re: fonz addon: Script to mount all USB drives

Hi,
Not sure if this is still active forum.
While trying this script, I noticed that the fdisk command cannot read the attached usb drive while the machine is rebooting. So the drives are not available unless I manually type the command after logging in.

  drivesfat=`fdisk -l | grep -i 'FAT' | awk -F '/| ' '{print $3}'`
  driveshfs=`fdisk -l | grep -i 'FAT32' | awk -F '/| ' '{print $3}'`

  echo "dfat: ${drivesfat}"

The above results in following line:
dfat:

Offline

 

#6 2010-08-10 00:19:51

vishnumrao
Member
Registered: 2010-08-09
Posts: 16

Re: fonz addon: Script to mount all USB drives

Is the mount usb storage the same as the shareport addon that Dlink provides?

Now that Dlink provides a method to connect to usb storage connected to usb port of the DNS-323, is there any specifice advantage to this method mentioned above?

Offline

 

#7 2010-08-11 11:47:26

wortelsoft
Member
From: Netherlands
Registered: 2009-06-08
Posts: 52

Re: fonz addon: Script to mount all USB drives

The shareport is something different it's more like USB port forwarding.
A device connected to the DNS-323 usb is forwarded like it's fysicaly attached to the pc.

Offline

 

#8 2010-09-21 09:16:06

vishnumrao
Member
Registered: 2010-08-09
Posts: 16

Re: fonz addon: Script to mount all USB drives

I have a 2 TB Hitachi Lifestudio External Drive formatted as NTFS.

Product link: http://www.hitachigst.com/lifestudio-desk-plus

I have tried a bunch of usb_storage.ko and ntfs.ko files from a variety of sources. I can see that the usb_all.sh script tries to mount it. But it is unable to. The different .ko files that I have found on the web were all had timestamps from 2007 to 2008. Can someone please point me to a .ko file that works. Especially on the newer External drives like the Hitachi one which are of 2 TB capacity!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB