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-08-27 20:26:48

bkim
Member
Registered: 2008-08-20
Posts: 20

Running ffp off usb drive?

I'm running fun_plug 0.5 on my DNS-323 off the HD.  What are the pros and cons of moving it and running it off a usb drive?

Offline

 

#2 2008-08-27 23:23:21

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: Running ffp off usb drive?

if you search the forums there are lots of posts about running it of USB.  It is also commonly done to have a fun_plug which attempts to run ffp off the usb stick, but in case of failure, to fallback to a copy stored on the hdd (such as the usb stick is disconnected).  I think that I am right that you won't get e2fsck hdd errors reported in dmesg if you run ffp of a usb, because all of the non-standard services (that the dns-323 doesn't know about, and therefore doesn't terminate gracefully when you shut down the unit) run off usb.  Do you just plan to have one stick directly connected, or connected via a usb hub?  I am not sure whether you can use the usb print server if you also have a usb stick - if not that may be a con, depending on what you want to do, but I am sure others can give a fuller answer.
lu

Offline

 

#3 2008-08-28 00:51:49

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

Re: Running ffp off usb drive?

If you put a usb hub on the DNS it will run multiple USB devices. 

It is not true about the errors.  The errors in dmesg are because of the problems in the DNS's shutdown procedure, not because of ffp.  What it can allow is to be able to stop enough services to unmount the hard drives and run e2fsck on the drives properly.


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

 

#4 2008-08-28 01:13:49

bkim
Member
Registered: 2008-08-20
Posts: 20

Re: Running ffp off usb drive?

I wasn't planning on using a usb hub and I don't need to use the print server capability.  I was thinking more along the lines of still being able to run ffp incase a HD fails... but now that I think of it, RAID 1 should be more reliable than a single usb drive.  Plus, im not sure what the performance implications are of running an OS off a usb drive.

Offline

 

#5 2008-08-28 02:18:01

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: Running ffp off usb drive?

I haven't noticed any performace problems, plus you won't be running an OS off the usb drive, just whatever services you care to load via ffp (such as telnet or ssh etc).  The OS of the unit runs off flash not one of the installed hdds or the usb.  I am running raid1 on the unit, with ffp running off usb stick drive quite happily.  As to the error messages, that is what I meant, I didn't mean to imply that it was the fault of ffp, but just that the unit on shutdown will only know to terminate 'in-built' services like webs, mt-daap, ftp etc.
lu

Offline

 

#6 2008-08-28 19:10:08

bkim
Member
Registered: 2008-08-20
Posts: 20

Re: Running ffp off usb drive?

Thanks for the info.  Are there instructions on what I need to do to migrate ffp to a usb drive?  I'd prefer not to reinstall everything if possible.

Offline

 

#7 2008-08-28 19:36:05

luusac
Member
Registered: 2008-04-29
Posts: 360

Re: Running ffp off usb drive?

bkim wrote:

Thanks for the info.  Are there instructions on what I need to do to migrate ffp to a usb drive?  I'd prefer not to reinstall everything if possible.

I don't think that it has been written up on the wiki.  search the forum for "part_table.sh" - this was contained in the thread I followed to get ffp on usb stick.  basically (and from memory) you do:

0. download the usb driver usb-storage.ko (do a search on this forum for it)
1. connect stick, edit and run usbdisk.sh in /ffp/start
2. copy /ffp to usbstick
3. run part_table.sh
4. edit usbmount.sh
5. edit fun_plug
this assumes that you have already formatted the usb stick.  As I said this is from memory, and I may have put the steps in the wrong order, the post I mentioned has a much fuller explanation.  Also, note that this is just one way of doing it, there are several methods and scripts on this forum.
lu

Last edited by luusac (2008-08-28 19:37:23)

Offline

 

#8 2008-08-28 19:46:47

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Running ffp off usb drive?

Recently, I made some changes to the fun_plug script to simplify the usb setup. For the details, you need to read the script yourself. In summary, you can create a hidden directory /mnt/HD_a2/.bootstrap and put a 'setup.sh' script inside. In theory, the script only needs to load the kernel module, mount the usb drive and adjust FFP_PATH.

Offline

 

#9 2008-08-29 13:13:58

jainoxi
Member
Registered: 2008-05-08
Posts: 7

Re: Running ffp off usb drive?

I've upgraded my NAS to 1.04RC5 firmware, and reset it to defaults. I began creating a new fun_plug (as the old one was a mess).

I seem to be unable to load the usbstorage.ko module:

Code:

root@NAS:/mnt/HD_a2# insmod usb-storage.ko
insmod: chdir(2.6.12.6-arm1): No such file or directory

I think this is because the firmware is using a different kernel then the module expects, but I do not have enough knowledge to actually confirm this. Are there any workarounds I can do to make usb-storage working again?

Offline

 

#10 2008-08-29 13:20:01

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Running ffp off usb drive?

jainoxi wrote:

I think this is because the firmware is using a different kernel

You should provide output of 'uname -a', then. Also try insmod with the full path to the module.

Offline

 

#11 2008-08-29 13:33:40

jainoxi
Member
Registered: 2008-05-08
Posts: 7

Re: Running ffp off usb drive?

uname -a give me 2.6.12.6-arm1. Insmod with full path gives me the same error.

'Modprobe -l' gives me the same error, leading me to believe that the problem isn't with the module usb-storage.ko, but with either the firmware or ffp.

Last edited by jainoxi (2008-08-29 13:55:44)

Offline

 

#12 2008-08-29 14:20:29

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Running ffp off usb drive?

jainoxi wrote:

'Modprobe -l' gives me the same error, leading me to believe that the problem isn't with the module usb-storage.ko, but with either the firmware or ffp.

I suppose you're running busybox 1.12.0? Could be a problem with the new insmod. It changed significantly. You might want to try creating the path it's missing:

Code:

mkdir -p /lib/modules/2.6.12.1.6-arm1/
cp usb-storage.ko /lib/modules/2.6.12.1.6-arm1/

Or try the firmware insmod:

Code:

/usr/sbin/insmod /full/path/to/module.ko

PS: Seems to work if you copy the module to /lib/modules/..., run depmod and finally modprobe. Still, looks like a bug.

Last edited by fonz (2008-08-29 14:30:28)

Offline

 

#13 2008-09-01 16:10:40

jainoxi
Member
Registered: 2008-05-08
Posts: 7

Re: Running ffp off usb drive?

Yeah, it still looks like a bug, but with your workaround, everything is working fine. I've got my ffp running from USB again.

Offline

 

#14 2008-11-09 23:48:27

bkim
Member
Registered: 2008-08-20
Posts: 20

Re: Running ffp off usb drive?

Ok, I've finally managed to get FFP to run off my usbdrive.  I used the latest fun_plug with setup.sh to get it working.

I still can't umount /dev/md0.  It says that its busy.  Do I need to run the kernel off the usb as well?

Here is my ffp.log:

Code:

**** fun_plug script for DNS-323 (2008-08-11 tp@fonz.de) ****
Sun Nov  9 13:33:02 GMT 2008
* Running /mnt/HD_a2/.bootstrap/setup.sh ...
Installing USB module and sleeping for 30 seconds
/dev/sdc1 mountable and mounted on /mnt/usb
Either /dev/sdc6 is already the root partition
     or /mnt/usb/.usb-root not accessible
     or /ffp/boot/reload.sh doesn't exist
So skipping reloading kernel...
Running FFP from *USB* and linking /ffp -> /mnt/usb...
ln -snf /mnt/usb/ffp /ffp
* Running /ffp/etc/fun_plug.local ...

Offline

 

#15 2008-11-12 09:01:09

bkim
Member
Registered: 2008-08-20
Posts: 20

Re: Running ffp off usb drive?

Anyone know why I can't umount /dev/md0?

Offline

 

#16 2008-11-12 13:00:15

silversurfer
Member
Registered: 2008-07-20
Posts: 95

Re: Running ffp off usb drive?

You can try running "lsof | grep HD".
This should show you which process is accessing your disks. Usually you will find smbd or the media servers in the output.

Offline

 

#17 2008-11-13 04:45:56

bkim
Member
Registered: 2008-08-20
Posts: 20

Re: Running ffp off usb drive?

That worked thanks!!  It was transmission and lighttpd running.

Now to figure out how to setup a cronjob to backup /ffp from my usb to HD

Offline

 

#18 2008-11-13 22:02:29

silversurfer
Member
Registered: 2008-07-20
Posts: 95

Re: Running ffp off usb drive?

bkim wrote:

Now to figure out how to setup a cronjob to backup /ffp from my usb to HD

Now that's pretty easy. Just add a little script to the /ffp/start folder with contents like these:

Code:

#!/bin/sh

CRONTEXT=/mnt/HD_a2/crontab.txt

#start with existing crontab
/bin/crontab -l > $CRONTEXT

#add backup job for ffp at 03:00 o'clock on Saturday
/bin/echo "00 03 * * 6 /ffp/bin/rsync -av --delete /mnt/usb/ffp /mnt/HD_a2/backup_ffp" >> $CRONTEXT

#install new crontab
/bin/crontab $CRONTEXT

#clean up
/bin/rm $CRONTEXT

This will install a cronjob that runs on Saturday at 03:00 o'clock. You will probably need to adjust the folders for backup. These are just examples. Don't forget to "chmod 755" the script to make it executable.
Once you have rebooted the NAS or run the script manually you should see the new job using the command "crontab -l".

Offline

 

#19 2008-11-13 22:38:07

jesbo
Member
From: Falls Church, VA
Registered: 2008-08-28
Posts: 101

Re: Running ffp off usb drive?

I actually include similar code in my own fun_plug script.  The fun_plug script detects whether the correct USB stick is present, mounts it if it finds it, checks if ffp resides on it, and if so sets the DNS to run ffp off the USB stick. It finally adds the crontab job to back it up periodically.  If the USB stick is not inserted, or its not the correct one, ffp just runs off the hard disk and crontab is not updated.

Last edited by jesbo (2008-11-13 22:39:05)


DNS-323 (H/W ver. B1) |  2 x 1 TB WD Caviar Black (Raid 1) | Corsair Flash Voyager - 16 GB USB | FW 1.08 | fun_plug 0.5

Offline

 

#20 2008-11-14 05:50:21

bkim
Member
Registered: 2008-08-20
Posts: 20

Re: Running ffp off usb drive?

Yep I found a similar script that runs another script inorder to log the results.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB