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

#101 2008-05-15 18:15:21

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Fan does run all the time :-(

I've come to this late, but why is fragmentation an issue? Because it takes extra time to move from piece to piece to gather a complete whole file?

How long does it take to move from piece to piece of a file? That depends on how quickly your storage device can address the different locations. On a hard disk that is related to how quickly the heads can be moved between the physical locations. On a flash drive you would expect to be able to address non-contiguous areas just as quickly as contiguous locations (well, within the few CPU cycles it takes to write a new address anyway). So it's fair to say that "fragmentation is not an issue" (which is different from "the drive doesn't get fragmented").

Sorry, I've not read the link, BTW.

Fordem, have you done experiments on this issue?

Offline

 

#102 2008-05-15 20:30:04

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Fan does run all the time :-(

sjmac - no I have not done my own tests - and if you read the link you'll see that dependent on the file size, read/write performance on fragmented flash memory does take a significant performance hit.

Offline

 

#103 2008-05-15 21:34:01

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Fan does run all the time :-(

Oxygen - having never heard of Andrew Morton, the name rang no bells (my apologies to all linux afficionados - this is the first linux box I own - and I'm still learning, with you guys as teachers) - I've since read briefly on linux and it's use of swap files and re-read his post.

You might want to do as I did and read the thread post by post, since it becomes easier to follow that way - his response to the first question is quoted below - the discussion becomes even more interesting as you approach the end and it turns to the use of additional swap files as a method of increasing swap space - and of course, since, these swap files are not likely to be adjacent to one another, the entire swap space can now be considered fragmented.

Mike Richards <mrmikerich@gmail.com> wrote:
>
> Given this situation, is there any significant performance or stability advantage to using a swap partition instead of a swap file?

In 2.6 they have the same reliability and they will have the same performance unless the swapfile is badly fragmented.

He pretty much states that ...

1) swap files can become fragmented
2) if the swap file is badly fragmented, the perfomance will be less than that of a swap partition.

Offline

 

#104 2008-05-16 03:37:09

raid123
Member
Registered: 2008-04-30
Posts: 22

Re: Fan does run all the time :-(

It appears that the link only showed the characteristics of a 256 MB Sandisk using an old Pocket PC, so other Flash systems may differ.  The other thing is that many flash drives have built-in controllers that does wear-leveling, which tries to wear the different blocks evenly.  In that case, not only can defragmenting not have an impact on performance, but the USB drive can get worn out faster.

Just want to throw this out there, that defragging flash drives is not always a good thing.

Last edited by raid123 (2008-05-16 03:38:22)

Offline

 

#105 2008-05-16 09:52:37

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Fan does run all the time :-(

fordem wrote:

He pretty much states that ...
1) swap files can become fragmented
2) if the swap file is badly fragmented, the perfomance will be less than that of a swap partition.

No he doesn't.

AndrewMorton wrote:

> 2. Is it possible for the swapfile to become fragmented over time, or
> does it just keep using the same blocks over and over? i.e. if it's
> all contiguous when you first create the swapfile, will it stay that
> way for the life of the file?

The latter.  Create the swapfile when the filesystem is young and empty,
it'll be nice and contiguous.  Once created the kernel will never add or
remove blocks.

(Quote from http://lkml.org/lkml/2005/7/7/326)

Think about a swap file or a swap partition as a container. A swap partition (on a physical disk) will never be fragmented. A swap file on a filesystem might be fragmented when it is created. Once the container is created it never changes size or moves on disk, so a swap file (container) will not *become* fragmented if it wasn't to start with. The kernel keeps an index of offsets inside the swap and seeks around *inside* it reading and writing pages of memory.

Are you worried about swap file performance degrading over time? That is not an issue on the DNS-323.

Before in this thread I said that a flash drive would not suffer noticeably from fragmentation. Another link in this thread starts from the same point, and summaries the issues in the last four paragraphs: http://searchwincomputing.techtarget.co … 72,00.html

Bringing the summary down to two sentances:

1/ reading or writing from a fragmented file system requires a larger number of IO operations, so fragmentation will have some effect on speeds (filesystem dependant, you'd need to know the details of your filesystem and drive random seek times, or do some experiments to quantify this).

2/ Different flash drives can have different times for random vs sequential seeks, and some even have different timings for different memory locations in the same device.

So I was wrong in general, fragmentation *might* be an issue for a filesystem on a flash drive, but

In short, defragmenting flash memory is probably not worth it unless you can demonstrate that there is a perceptible speed improvement by doing so.

(From the searchwincomputing link)

Offline

 

#106 2008-05-16 14:50:38

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

Re: Fan does run all the time :-(

You are misreading the information.  No, the swapfile itself will not become fragmented, as it has a fixed size and location on the disk.  The fragmentation we're talking about it the fragmentation of data within the file.  If you have a swap file that has 100 blocks and you want to write data of 25 blocks into it.  The file will still occupy the same 100 contiguous block on the disk (not fragmented), however, the 25 block of data that are now written to it could end up anywhere within the 100 block and could be fragmented. 

Let me draw an analogy.  Think of the swapfile as its own hard drive.  If you have 4 hard drives in a computer, data you write to 1 drive won't magically become fragmented over all 4 drives, becaust it is contained within that one drive (just like the swap file and its data).  Even though it will be confined to just the one drive, data can still be fragmented within that hard drive (same as a swapfile).


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

 

#107 2008-05-16 15:59:41

sjmac
Member
Registered: 2008-01-21
Posts: 222

Re: Fan does run all the time :-(

bq041 wrote:

You are misreading the information.  No, the swapfile itself will not become fragmented, as it has a fixed size and location on the disk.  The fragmentation we're talking about it the fragmentation of data within the file.  If you have a swap file that has 100 blocks and you want to write data of 25 blocks into it.  The file will still occupy the same 100 contiguous block on the disk (not fragmented), however, the 25 block of data that are now written to it could end up anywhere within the 100 block and could be fragmented.

Yes, I understand exactly what you are saying, and I agree with it. I don't think it is important.

The swap partition/file is not used like a normal file system. It doesn't have to hold a tree of folders with files in it, and every "file" in the swap space is exactly the same size: 1 page of memory. It is relatively easy for the kernel virtual memory manager to grab the pages of RAM from swap. There is no need to making lots of extra IO calls to find the next block of data in the fragmented vs unfragmented cases. On a hard disk there would be a penalty grabbing two pages at either end of a swap file because the disk head has to be physically moved, but there is not necessarily any such penalty on flash. (I'm surprised that there is any, but that's what the searchwincomputing link article says).

Also the swap file is effectively emptied each time you boot the device, so fragmentation won't build up in the same way as it will on a real file system.

That is not to say that it is better to have your swap on a flash drive because the data transfer rates might be a lot lower than from a hard disk. YMMV!

Sorry to the thread starter - all this is nothing to do with fan speed control, but the topic was interesting - should there be another thread? Or two new threads as about Swap file vs Swap partition, and fragmentation on flash vs fragmentation on HDD? And another for Swap file on flash vs swap file on flash, and ...   :-)

Offline

 

#108 2008-06-14 02:30:54

bunzinator
New member
Registered: 2008-06-03
Posts: 3

Re: Fan does run all the time :-(

hey guys,

  I'm having a little trouble getting the ctrl_fanspeed script to run in the background.  I've read the forum and have seen that you have to incorporate

  /path/to/your/script >/dev/null 2>/dev/null </dev/null &

  into the fun_plug to prevent the script from hanging telnet.

  I've stored my script in /mnt/HD_a2/fun_plug.d/bin (so the above line would then read /mnt/HD_a2/fun_plug.d/bin >/dev/null 2>/dev/null </dev/null &)

  Q1 : where do I put this in funplug ?
  Q2 : I read on the forum also, can I just put the ctrl_fanspeed.sh as is in the fun_plug.d/start and chmod a+x so it auto runs each time? (will I have problems with it hanging the terminal?)

  Thanks for the help guys!

Offline

 

#109 2008-06-28 21:38:28

skaamu1
Member
Registered: 2008-06-28
Posts: 5

Re: Fan does run all the time :-(

Hi everybody,

my CH3SNAS is new and I am quite a linux noob, so I'd appreciate a short answer if I did everything ok:

1. Installed the fun_plug 0.5 as described in the wiki
2. Disabled telnet, enabled SSH
3. Created the crtl_fanspeed.sh in /mnt/hd_a2 by copy & paste the long fancontrol script from the wiki
4. set chmod to 777 for the file, owner is 'root'
5. added /mnt/hd_a2/crtl_fanspeed.sh to the fun_plug startup file
6. restarted the system

I lost track in the thread somewhere, so I am not sure if there are modifications needed for the .sh file?

Thanks in advance,

Steffen

Offline

 

#110 2008-06-29 01:26:04

skaamu1
Member
Registered: 2008-06-28
Posts: 5

Re: Fan does run all the time :-(

gartylad wrote:

All is working now, FanSpeed, Telnet, and Twonky

Ok - I took the script from the Wiki and I am calling it from the fun_plug startup file, AFTER the starttwonky.sh. Twonky is set to scan for new files every two days, HDD spin down time is 10 minutes.

I am not sure if it will work, could you tell some more about your config?

Offline

 

#111 2008-06-29 17:50:09

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: Fan does run all the time :-(

At 06:48:38 on May 29 2007 fonz wrote

DNS-323 Talker wrote:

(I wasn't totally sure that I wanted to mess around with the fan w/out more info.

That's why I'm asking, since I don't want to include a flawed script. So far I don't think it's ready:
- leper's script is nicely commented, but could use some cleanup (remove unused code)
- lovgren's drive status detection is an interesting idea, though I'm not sure whether stopping the fan - without checking the actual temperature - is the right thing (TM)!?
- I'm also not sure about the parameters, do they work for summer and winter?
- the celius/fahrenheit issue needs to be solved

I'm considering installation of FIB's (Or a similar) script. Before doing so I would like to know why this script didn't become part of fun_plug .5? Are there issues that I need to watch for?

Bob Blackwell
Pickering, ON

Last edited by rcblackwell (2008-06-29 17:52:40)


Bob Blackwell
Pickering, ON

Offline

 

#112 2008-06-29 18:17:33

DeLaCroix
Member
Registered: 2007-08-18
Posts: 91
Website

Re: Fan does run all the time :-(

bunzinator wrote:

Q1 : where do I put this in funplug ?

At the End, last line

bunzinator wrote:

Q2 :

Put it in the fun_plug, really wink

@all: Not everyone wants to switch off the fan, so this is not implemented in the fun_plug yet wink

Offline

 

#113 2008-06-30 00:14:47

skaamu1
Member
Registered: 2008-06-28
Posts: 5

Re: Fan does run all the time :-(

It is, indeed, implemented in the spindown script avilable at the wiki. After spinning down the harddisks by the function incorporated in the FW, the script keeps running in the background and stops the fan as soon as the given temperature limit is reached. May take some time, it seems that the box cools out relatively slow.

For me, it works fine now. I can post both files (fun_plug and ctrl_fanspeed.sh) if anybody thinks that it will help. The next step is getting the whole thing running smoothly with mldonkey called at startup.

Offline

 

#114 2008-06-30 17:42:48

marinalink
Member
Registered: 2008-04-13
Posts: 56

Re: Fan does run all the time :-(

Just for info to anyne who might be interested. If you set the fan speed using "fanspeed w ..."  to a value below 1935rpm, you will get an error message in the /var/log/messages:

Jun 29 05:36:13 mydlink-dns-323 user.warn kernel: <Wrong rpm speed>
Jun 29 05:36:28 mydlink-dns-323 user.warn kernel: <Wrong rpm speed>

It seems to make no harm, but a script which checks every 15s the temperature will flood your /var/log/messages (if you use the log daemon). But I have found no clean way to put the fan to stop, without sending a rpm value below these 1935rpm. So maybe we just have to live with it.

marinalink

Offline

 

#115 2008-07-03 05:29:18

leftkidney
Member
Registered: 2007-12-26
Posts: 54

Re: Fan does run all the time :-(

you know I just modded the fan to connect to the 12v where the power plug goes into and used a connector to connect the white wire to the board just in case there would be a stupid error message due to fan stoppage or something

yea it runs all the time even when it is off, but its not loud and the drives are sure always cool - before they could get up to 55deg C or more when under heavy loads on both drives, now it is never over 40deg C

Offline

 

#116 2008-07-07 01:18:03

douma
New member
Registered: 2008-07-07
Posts: 2

Re: Fan does run all the time :-(

This "mod" seems to me the easiest for non-linux programmers like me. No problem with the mechanic/electronic side of things.

Do you happen to have some pictures of what you did?

thanks
doede

Offline

 

#117 2008-07-08 12:35:34

chaicl
New member
Registered: 2008-07-01
Posts: 4

Re: Fan does run all the time :-(

I am new to UNIX.  Where do I find the RAM Disk log file? 

Also after locating it, how to I read it?  Since FTP does not show files expect those in  /mnt/HD_a2/

Offline

 

#118 2008-07-08 13:51:18

marca
Member
Registered: 2007-10-13
Posts: 64

Re: Fan does run all the time :-(

I recieve errors when "sh fan_control.sh" copied from wiki. Can someone please link to a working "fan_control.sh" script for celcius and FFP,

Thanks,

Martin

Offline

 

#119 2008-07-08 14:53:00

DeLaCroix
Member
Registered: 2007-08-18
Posts: 91
Website

Re: Fan does run all the time :-(

I've posted one on my Website: http://wolf-u.li/757/lueftersteuerung-f … c-ch3snas/

You are probably searching for the Script below the following Sentence:

Das Skript wurde auf auf beide Festplatten ausgerichtet, es werden keine Aktivitäten geloggt:

Just click download and you'll get a working Skript (hopefully)

Offline

 

#120 2008-07-08 14:57:40

hell0
Member
From: .de
Registered: 2008-05-13
Posts: 81

Re: Fan does run all the time :-(

This one works for me...
CH3SNAS with fw 1.03 and fun_plug 0.5


Attachments:
Attachment Icon ctrl_fanspeed.sh, Size: 1,671 bytes, Downloads: 565

CH3SNAS firmware 1.05 with WD1000FYPS and ffp 0.5 on USB Stick

Offline

 

#121 2008-07-08 16:12:14

marca
Member
Registered: 2007-10-13
Posts: 64

Re: Fan does run all the time :-(

what am i doing wrong.
1. I take the script download straight to volume1.
2. move script to ffp/start
3. chown to root and chmod 0777
4. execute "sh ctrl_fanspeed.sh"

/mnt/HD_a2/ffp/start # sh ctrl_fanspeed.sh
: not founded.sh: line 10:
: not founded.sh: line 15:
: not founded.sh: line 20:
'h: bad pid '1417
: nonexistent directory23: cannot create /log
: not founded.sh: line 24:
: not founded.sh: line 33:
ctrl_fanspeed.sh: line 52: syntax error: "done" unexpected (expecting "then")
/mnt/HD_a2/ffp/start #

Offline

 

#122 2008-07-08 18:15:27

hell0
Member
From: .de
Registered: 2008-05-13
Posts: 81

Re: Fan does run all the time :-(

do NOT put in in /ffp/start!
put it somewhere else and add something like sh ctrl_fanspeed.sh to the end of your fun_plug.
then cd to this location and do md5sum ctrl_fanspeed.sh. If you did not change anything in this script the md5 sum should be fedd79a337c3ef491ddc9618ef1d3c26. if you didnt change anything and it differs, it became corrupted during download/upload.


CH3SNAS firmware 1.05 with WD1000FYPS and ffp 0.5 on USB Stick

Offline

 

#123 2008-07-08 18:16:38

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

Re: Fan does run all the time :-(

hell0 wrote:

put it somewhere else and add something like sh ctrl_fanspeed.sh to the end of your fun_plug.

do NOT change fun_plug! smile
write a proper start script instead.

Offline

 

#124 2008-07-08 22:00:40

marca
Member
Registered: 2007-10-13
Posts: 64

Re: Fan does run all the time :-(

hell0 wrote:

do NOT put in in /ffp/start!
put it somewhere else and add something like sh ctrl_fanspeed.sh to the end of your fun_plug.
then cd to this location and do md5sum ctrl_fanspeed.sh. If you did not change anything in this script the md5 sum should be fedd79a337c3ef491ddc9618ef1d3c26. if you didnt change anything and it differs, it became corrupted during download/upload.

1. Using FF 3.0 (Vista 32) right click and save target to volume1.
2. executing "md5sum ctrl_fanspeed.sh" using telnet gives me a checksum that differs

/mnt/HD_a2 # md5sum ctrl_fanspeed.sh
8019517efb226492b40bab1271137a85  ctrl_fanspeed.sh
/mnt/HD_a2 # sh ctrl_fanspeed.sh
: not founded.sh: line 10:
: not founded.sh: line 15:
: not founded.sh: line 20:
'h: bad pid '
: nonexistent directory23: cannot create /log
: not founded.sh: line 24:
: not founded.sh: line 33:
ctrl_fanspeed.sh: line 52: syntax error: "done" unexpected (expecting "then")
/mnt/HD_a2 #


3. And gives me same errror when trying to execute.

What am i doing wrong?
(about the "bad pid", i have manually killed the process. But still gives me the other errors when have fancontrol running)

Offline

 

#125 2008-07-08 22:23:59

DeLaCroix
Member
Registered: 2007-08-18
Posts: 91
Website

Re: Fan does run all the time :-(

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB