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 2009-01-12 16:52:02

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Funplug on USB - nearly there but I can't copy the ffp directory

Am in the process of setting up the Funplug on a USB but when I go to copy the ffp files I keep getting:

"cp: cannot create .blah de blah .Operation not Permitted"

I am using command "cp -a /mnt/HD_a2/ffp /mnt/USB/"

Permission bits are 777 for /mnt/USB

Should I be using some other command?

thx
Tony

Last edited by flashman1207 (2009-01-12 17:00:17)

Offline

 

#2 2009-01-12 18:11:30

kennedy101
Member
Registered: 2008-09-16
Posts: 48

Re: Funplug on USB - nearly there but I can't copy the ffp directory

Curious if /mnt/USB is mounted. Can you post the following

lsmod #(expect to see usb-storage.ko loaded)
fdisk -l /dev/sd[cde] #(expect to see ext2 filesystem on one of the partitions)
mount #(expect to see the USB partition mounted to /mnt/USB)

If you see all good results when running the above commands then I'd "cd /mnt/USB" then "touch test_file" this will create a test file on the usb stick. To see if it's there "ls" and see if the file you just created is there.


DNS 323 (Hardware B1, Firmware 1.06). 2x 1.5TB Seagate HDs.
Chroot Debain (Lenny) on USB (not reloaded). Edna server. USB print server. USB drives added to samba share. All init.d scripts in place.
Future projects: FFP reloaded then chroot on B1 hardware.

Offline

 

#3 2009-01-13 00:48:06

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

kennedy101 wrote:

Curious if /mnt/USB is mounted. Can you post the following

lsmod #(expect to see usb-storage.ko loaded)
fdisk -l /dev/sd[cde] #(expect to see ext2 filesystem on one of the partitions)
mount #(expect to see the USB partition mounted to /mnt/USB)

If you see all good results when running the above commands then I'd "cd /mnt/USB" then "touch test_file" this will create a test file on the usb stick. To see if it's there "ls" and see if the file you just created is there.

lsmod # gives:

Module                  Size  Used by    Not tainted
usb_storage            29956  1
lltd                   43072  0
usblp                  10976  0
sd_mod                 14484  10

fdisk -l /dev/sdc gives:

Disk /dev/sdc: 1027 MB, 1027603968 bytes
255 heads, 63 sectors/track, 124 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sdc1   *           1         125     1003488   6 FAT16
Partition 1 has different physical/logical endings:
     phys=(123, 254, 63) logical=(124, 237, 48)
mount gives:

rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw)
proc on /proc type proc (rw,nodiratime)
/dev/loop0 on /sys/crfs type cramfs (ro)
/dev/md0 on /mnt/HD_a2 type ext2 (rw)
/dev/md1 on /mnt/HD_b2 type ext2 (rw)
none on /proc/bus/usb type usbfs (rw)
/dev/sdc1 on /mnt/USB type vfat (rw,nodiratime,fmask=0000,dmask=0000,codepage=cp850,iocharset=iso8859-1)
devpts on /dev/pts type devpts (rw)


   Device Boot      Start         End      Blocks  Id System
/dev/sdc1   *           1         125     1003488   6 FAT16
Partition 1 has different physical/logical endings:
     phys=(123, 254, 63) logical=(124, 237, 48)

Did a "cd /mnt/USB" and touch file as suggested and this worked......

Have attached my usbdisk.sh


Attachments:
Attachment Icon usbdisk.sh, Size: 2,064 bytes, Downloads: 240

Offline

 

#4 2009-01-13 00:49:21

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

and here is my setup.sh


Attachments:
Attachment Icon setup.sh, Size: 1,782 bytes, Downloads: 236

Offline

 

#5 2009-01-13 00:53:31

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

And here is the ffp.log (my apologies for the individual posts but I couldn't work out how to add multiple attachments...)

Last edited by flashman1207 (2009-01-13 11:28:44)


Attachments:
Attachment Icon ffp.log, Size: 4,107 bytes, Downloads: 350

Offline

 

#6 2009-01-13 14:11:51

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

Re: Funplug on USB - nearly there but I can't copy the ffp directory

flashman1207 wrote:

fdisk -l /dev/sdc gives:

Disk /dev/sdc: 1027 MB, 1027603968 bytes
255 heads, 63 sectors/track, 124 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sdc1   *           1         125     1003488   6 FAT16
Partition 1 has different physical/logical endings:
     phys=(123, 254, 63) logical=(124, 237, 48)

My guess is that the file system is the problem. FAT doesn't support Linux file attributes and links. I would suggest to format your USB disk as ext2.

Offline

 

#7 2009-01-13 15:02:25

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

silversurfer wrote:

flashman1207 wrote:

fdisk -l /dev/sdc gives:

Disk /dev/sdc: 1027 MB, 1027603968 bytes
255 heads, 63 sectors/track, 124 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sdc1   *           1         125     1003488   6 FAT16
Partition 1 has different physical/logical endings:
     phys=(123, 254, 63) logical=(124, 237, 48)

My guess is that the file system is the problem. FAT doesn't support Linux file attributes and links. I would suggest to format your USB disk as ext2.

OK, tried that using:

fdisk /dev/sdc

but get message:

Segmentation Fault

When I run:

fdisk

it shows:
BusyBox v1.12.1

is this correct? How do I fix "segmentation fault"?

Thx
Tony

Offline

 

#8 2009-01-13 15:42:59

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

OK, have downloaded "Partition Manager" and formatted the USB to ext2 using this. Then did:

mke2fs /dev/sdc1

and rebooted....

Now, is "cp -a /mnt/HD_a2/ffp /mnt/USB/" the correct command to copy everything from ffp (including links etc) to the USB?

Thx
Tony

Offline

 

#9 2009-01-13 16:38:13

toolbox
Member
Registered: 2008-12-18
Posts: 83

Re: Funplug on USB - nearly there but I can't copy the ffp directory

cp -a ... command is what I used a while back when I did this. I used http://bfg100k.blogspot.com/2008/11/upg … o-usb.html as a guide.

Offline

 

#10 2009-01-14 01:21:52

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

toolbox wrote:

cp -a ... command is what I used a while back when I did this. I used http://bfg100k.blogspot.com/2008/11/upg … o-usb.html as a guide.

Somewhere I thought I read that a "cp -a" doesn't copy all Symbolic Links etc and that you should use "cp -r".... Is that true.

PS I followed that link you posted too...

Last edited by flashman1207 (2009-01-14 01:22:09)

Offline

 

#11 2009-01-14 02:18:34

kennedy101
Member
Registered: 2008-09-16
Posts: 48

Re: Funplug on USB - nearly there but I can't copy the ffp directory

I use cp -aR and it kept all the links for me.


DNS 323 (Hardware B1, Firmware 1.06). 2x 1.5TB Seagate HDs.
Chroot Debain (Lenny) on USB (not reloaded). Edna server. USB print server. USB drives added to samba share. All init.d scripts in place.
Future projects: FFP reloaded then chroot on B1 hardware.

Offline

 

#12 2009-01-17 14:20:29

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

Re: Funplug on USB - nearly there but I can't copy the ffp directory

If you are not sure about the options of a command, try "<command> --help". This will usually tell you the options and a description of them.

cp --help says:

Code:

root@nas:/# cp --help
BusyBox v1.11.1 (2008-07-13 20:04:00 CEST) multi-call binary

Usage: cp [OPTION]... SOURCE DEST

Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY

Options:
        -a      Same as -dpR
        -d,-P   Preserve links
        -H,-L   Dereference all symlinks (default)
        -p      Preserve file attributes if possible
        -f      Force overwrite
        -i      Prompt before overwrite
        -R,-r   Recurse directories
        -l,-s   Create (sym)links

root@nas:/#

You can see that the option "-a" already includes "-d", "-p" and "-R".

Offline

 

#13 2009-01-17 15:21:38

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

silversurfer wrote:

If you are not sure about the options of a command, try "<command> --help". This will usually tell you the options and a description of them.

cp --help says:

Code:

root@nas:/# cp --help
BusyBox v1.11.1 (2008-07-13 20:04:00 CEST) multi-call binary

Usage: cp [OPTION]... SOURCE DEST

Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY

Options:
        -a      Same as -dpR
        -d,-P   Preserve links
        -H,-L   Dereference all symlinks (default)
        -p      Preserve file attributes if possible
        -f      Force overwrite
        -i      Prompt before overwrite
        -R,-r   Recurse directories
        -l,-s   Create (sym)links

root@nas:/#

You can see that the option "-a" already includes "-d", "-p" and "-R".

Thanks, used "cp -a" and according to ffp.log its loading from USB. Damn disks keep spinning up and down every 15 mins though (same as before) so will be looking at fixing that next (Print Server is disabled, as is DHCP, UPNP, iTunes. Only thing "extra" running is FTP and a fan script).....

Thx

Offline

 

#14 2009-01-17 19:44:39

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

Re: Funplug on USB - nearly there but I can't copy the ffp directory

You can try "lsof | grep HD" to see which process has stuff opened on your disks. Usually you will see smbd there, the samba daemon.

Code:

root@nas:/# lsof | grep HD
smbd       1823  root  cwd       DIR        8,2    4096          2 /mnt/HD_a2
smbd       1877  root  cwd       DIR        8,2    4096          2 /mnt/HD_a2
root@nas:/#

Samba won't bother the disks unless somebody is accessing files in one of the shares.

Your problem is usually caused by running a memory resident script/program from within /mnt/HD_... It could be your fan script but you need to check it yourself.

Offline

 

#15 2009-01-17 22:57:30

JediSthlm
Member
Registered: 2009-01-17
Posts: 19

Re: Funplug on USB - nearly there but I can't copy the ffp directory

I am on the way to try out to get Fun Plug om a USB just to get my discs not to spin up about every 15 minutes.
It would be great to get a wiki article about this for all newbies like me. I saw this article (http://bfg100k.blogspot.com/2008/11/upg … o-usb.html) but it's would be great with a copy and paste article.

Anyone up for it, I would love to help out if I can.

Offline

 

#16 2009-01-18 03:12:02

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

silversurfer wrote:

You can try "lsof | grep HD" to see which process has stuff opened on your disks. Usually you will see smbd there, the samba daemon.

Code:

root@nas:/# lsof | grep HD
smbd       1823  root  cwd       DIR        8,2    4096          2 /mnt/HD_a2
smbd       1877  root  cwd       DIR        8,2    4096          2 /mnt/HD_a2
root@nas:/#

Samba won't bother the disks unless somebody is accessing files in one of the shares.

Your problem is usually caused by running a memory resident script/program from within /mnt/HD_... It could be your fan script but you need to check it yourself.

Heres the output from the lsof | grep HD_ command, there is a lot of stuff in there....... most of it is BT which i don't use. The fan control script i though was supposed to run in RAM ...

Appreciate any help here, am on holidays till 28th so won't be able to reply till then....

Last edited by flashman1207 (2009-01-18 03:22:41)


Attachments:
Attachment Icon output.txt, Size: 2,552 bytes, Downloads: 261

Offline

 

#17 2009-01-18 11:17:17

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

Re: Funplug on USB - nearly there but I can't copy the ffp directory

It looks like torrent is running. If you don't need it you should disable it. It looks like the fan script was started from "/mnt/HD_a2", probably by the funplug script. You need to "cd" out of "/mnt/HD_a2" before starting other scripts via funplug. It even looks like the funplug script didn't finish executing. Maybe you didn't start the fan script in the background.

This is how my funplug script starts the fan script:

Code:

cd /ffp/start
./newfancontrol & >/dev/null 2>/dev/null

The "&" is important there to start the script in the background. Otherwise funplug will keep running as long as the fan script is running.

Offline

 

#18 2009-01-18 13:09:46

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

silversurfer wrote:

It looks like torrent is running. If you don't need it you should disable it. It looks like the fan script was started from "/mnt/HD_a2", probably by the funplug script. You need to "cd" out of "/mnt/HD_a2" before starting other scripts via funplug. It even looks like the funplug script didn't finish executing. Maybe you didn't start the fan script in the background.

This is how my funplug script starts the fan script:

Code:

cd /ffp/start
./newfancontrol & >/dev/null 2>/dev/null

The "&" is important there to start the script in the background. Otherwise funplug will keep running as long as the fan script is running.

Here is my funplug script, its the latest fonz one. Pretty vanilla except the fan script bit at the end... Is it missing something????

I deleted the BT Torrent and here is the latest output from "lsof | grep HD_"

Thx

Last edited by flashman1207 (2009-01-18 13:59:46)


Attachments:
Attachment Icon fun_plug, Size: 1,853 bytes, Downloads: 235

Offline

 

#19 2009-01-18 15:06:05

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

Re: Funplug on USB - nearly there but I can't copy the ffp directory

It is as I expected. You run the fan script from your disk and that is causing the disk access. You need to move your fan script "ctrl_fanspeed.sh" to somewhere else, the USB stick for example or at least the RAM disk and start it from there.  Also you need to add the "&" to the end of the line.

The lines should look like this:

Code:

cd <path to fan script>
<path to fan script>/ctrl_fanspeed.sh &

Substitute <path to fan script> by the real path. This will allow your funplug to complete and will prevent access to your disks by funplug or the fan script.

Offline

 

#20 2009-01-29 17:01:45

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

silversurfer wrote:

It is as I expected. You run the fan script from your disk and that is causing the disk access. You need to move your fan script "ctrl_fanspeed.sh" to somewhere else, the USB stick for example or at least the RAM disk and start it from there.  Also you need to add the "&" to the end of the line.

The lines should look like this:

Code:

cd <path to fan script>
<path to fan script>/ctrl_fanspeed.sh &

Substitute <path to fan script> by the real path. This will allow your funplug to complete and will prevent access to your disks by funplug or the fan script.

I added the following to the funplug script:

cp /mnt/HD_a2/ctrl_fanspeed.sh /ffp/start
cd /ffp/start
./ctrl_fanspeed.sh & >/dev/null 2>/dev/null

Attached is the output from the lsof | grep HD_  command but is the funplug still not ending?

ps -ea shows:

smbd      1758 nobody  cwd       DIR        9,0   4096         2 /mnt/HD_a2
smbd      1758 nobody   23r      DIR        9,1   4096   6897665 /mnt/HD_b2/Media/ISO's
smbd      1758 nobody   25r      DIR        9,0   4096  38518787 /mnt/HD_a2/Linux_Files/Linux stuff
fun_plug  1770   root    1w      REG        9,0 431861        20 /mnt/HD_a2/ffp.log
fun_plug  1770   root    2w      REG        9,0 431861        20 /mnt/HD_a2/ffp.log
fun_plug  1770   root   10r      REG        9,0   1989  33570820 /mnt/HD_a2/fun_plug
rc        1883   root    1w      REG        9,0 431861        20 /mnt/HD_a2/ffp.log
rc        1883   root    2w      REG        9,0 431861        20 /mnt/HD_a2/ffp.log
ctrl_fans 1934   root    1w      REG        9,0 431861        20 /mnt/HD_a2/ffp.log
ctrl_fans 1934   root    2w      REG        9,0 431861        20 /mnt/HD_a2/ffp.log
sleep     1989   root    1w      REG        9,0 431861        20 /mnt/HD_a2/ffp.log
sleep     1989   root    2w      REG        9,0 431861        20 /mnt/HD_a2/ffp.log
grep      1992   root    1w      REG        9,0      0        21 /mnt/HD_a2/output.txt

thx
Tony


Attachments:
Attachment Icon output.txt, Size: 1,108 bytes, Downloads: 219

Offline

 

#21 2009-01-30 12:55:18

flashman1207
Member
Registered: 2008-05-27
Posts: 92

Re: Funplug on USB - nearly there but I can't copy the ffp directory

SilverSurfer,
    Thanks for your help, I don't know if the funplug is ending but my disks are no longer spinning up every 10 minutes or so.... at last !!!!!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB