D-Link Forums

The Graveyard - Products No Longer Supported => D-Link Storage => DNS-323 => Topic started by: ocedoc on September 14, 2010, 05:28:12 PM

Title: defragment network drives for d-link 323?
Post by: ocedoc on September 14, 2010, 05:28:12 PM
How can I defrag my DNS323 network drives? Thanks.
Title: Re: defragment network drives for d-link 323?
Post by: dosborne on September 14, 2010, 05:41:26 PM
You don'tneed to defrag drives running linux like you do a windows file system.
Title: Re: defragment network drives for d-link 323?
Post by: gunrunnerjohn on September 14, 2010, 05:41:47 PM
The short answer is, you don't. :)  There is no native defrag in the NAS.  It's possible to do it with 3rd party tools, but it's a bit complex.
Title: Re: defragment network drives for d-link 323?
Post by: gunrunnerjohn on September 14, 2010, 05:42:54 PM
You don'tneed to defrag drives running linux like you do a windows file system.
Well, this isn't really true.  While it's true that EXT2/3 do a better job with fragmentation than the Windows filesystems. they are not immune to fragmentation.

However, it's a moot point with this product. :)
Title: Re: defragment network drives for d-link 323?
Post by: tentimes on September 15, 2010, 12:06:53 PM
It's easy to do. GEt funplug installed and google it. If you are totally new to linux then don't bother and just leave them alone (is my advice ;)) They don't really need defragged. Especiialy if files aren't being constantly deleted and replaced with new ones.

Even if you did manage to defrag it, the difference in speed (which would be negligible at best) would not affect the speed you get the data from the 323 as it is limited to way way slower than the speed of the disk.

Title: Re: defragment network drives for d-link 323?
Post by: fordem on September 15, 2010, 12:28:03 PM
It's easy to do. GEt funplug installed and google it. If you are totally new to linux then don't bother and just leave them alone (is my advice ;)) They don't really need defragged. Especiialy if files aren't being constantly deleted and replaced with new ones.

Even if you did manage to defrag it, the difference in speed (which would be negligible at best) would not affect the speed you get the data from the 323 as it is limited to way way slower than the speed of the disk.



I have to assume that you speak from a point of NO experience in this regard ...

First - and - I will admit to not having checked recently, the last time I looked there were NO defraggers available for either the ext2 or ext3 formats, much less ones ported to the arm platform.

Second - simply using the torrent clients on the DNS-323 will cause fragementation, and a noticeable decline in performance.

There are many who simply regurgitate the hype of ext2/3 not cause fragmentation and not needing to be defragmented - others, like gunrunnerjohn, in his post above, state correctly that it's less of a problem than it is with a windows file system, but the truth of the matter is, that under certain circumstances, which by the way, I can duplicate at will, and ext file system will fragment, and in the case of ext2 on a DNS-323, the resulting performance hit IS significant.

Feel free to let us know what you experience you have with a fragmented disk in your DNS-323, and also how you used fun_plug to defrag it - as far as I am aware, the only way to deal with a fragemented disk on a DNS-323, is to back up the data, and reformat the drive.
Title: Re: defragment network drives for d-link 323?
Post by: gunrunnerjohn on September 15, 2010, 01:20:03 PM
There are Linux defrag programs mentioned, which in itself points out that it must be considered to be an issue. :)

A quote from http://en.wikipedia.org/wiki/Ext3#Defragmentation (http://en.wikipedia.org/wiki/Ext3#Defragmentation):

Quote
Defragmentation

There is no online ext3 defragmentation tool that works on the filesystem level. An offline ext2 defragmenter, e2defrag, exists but requires that the ext3 filesystem be converted back to ext2 first. But depending on the feature bits turned on in the filesystem, e2defrag may destroy data; it does not know how to treat many of the newer ext3 features.[14]

There are userspace defragmentation tools like Shake[15] and defrag.[16][17] Shake works by allocating space for the whole file as one operation, which will generally cause the allocator to find contiguous disk space. It also tries to write files used at the same time next to each other. Defrag works by copying each file over itself. However they only work if the filesystem is reasonably empty. A true defragmentation tool does not exist for ext3.[18]

That being said, as the Linux System Administrator Guide states, "Modern Linux filesystem(s) keep fragmentation at a minimum by keeping all blocks in a file close together, even if they can't be stored in consecutive sectors. Some filesystems, like ext3, effectively allocate the free block that is nearest to other blocks in a file. Therefore it is not necessary to worry about fragmentation in a Linux system."[19]

While ext3 is more resistant to file fragmentation than the FAT filesystem, nonetheless ext3 filesystems can get fragmented over time or on specific usage patterns, like slowly-writing large files.[20][21] Consequently the successor to the ext3 filesystem, ext4, is planned to eventually include an online filesystem defragmentation utility[22], and currently supports extents (contiguous file regions).

Title: Re: defragment network drives for d-link 323?
Post by: fordem on September 15, 2010, 06:06:10 PM
There are Linux defrag programs mentioned, which in itself points out that it must be considered to be an issue. :)

A quote from http://en.wikipedia.org/wiki/Ext3#Defragmentation (http://en.wikipedia.org/wiki/Ext3#Defragmentation):



Yes - they are mentioned in wikipedia, and other places - try to actually locate that one, rather than just a mention of it.  I'm not going to say you can't, but I will say that I gave up trying.
Title: Re: defragment network drives for d-link 323?
Post by: gunrunnerjohn on September 16, 2010, 05:12:48 AM
I'm not saying you can locate the defrag, my sole point was that it's obvious that there is a perceived need for a defrag capability for EXT2/EXT3 volumes.  Apparently, there is a defrag for EXT2, but not for EXT3.

I found references to defrag and performance hits all over the web, it's not a secret. :)
Title: Re: defragment network drives for d-link 323?
Post by: fordem on September 16, 2010, 07:15:05 AM
Oh - I have no problem finding references, or even fanbois who say it doesn't fragment - on the other hand, actually getting my hands on a defrag utility has proven infintely more challenging.

Title: Re: defragment network drives for d-link 323?
Post by: gunrunnerjohn on September 16, 2010, 07:21:51 AM
I admit, it would be nice to defrag my EXT3 disks in these NAS units, but since it's not an option... :)
Title: Re: defragment network drives for d-link 323?
Post by: chriso on September 16, 2010, 11:36:42 AM
Has anyone actually looked at how much fragmentation is on their drives?  It has been my experience (about 35 years) that Unix/Linux file systems have less then 5% fragmentation.  As a matter of fact defrag programs where first introduced for the terrible DOS/Window files systems of the past (not current ones).  Once that was embedded in the thinking of people then some companies tried to sell defrag programs to people on Unix/Linux and it was a complete failure because any Unix/Linux administrator with experience wouldn't buy it, they just didn't see the need.

If you go to a large company with hundreds of Unix/Linux machines you will see that they don't run defrag programs.

The performance gains are just not there, and depending on how often you defrag you may be causing your disk heads to move more to do the defrag then they save doing normal reads.
Title: Re: defragment network drives for d-link 323?
Post by: gunrunnerjohn on September 16, 2010, 01:28:44 PM
Well, the comment about moving the disk heads more is pointless, I don't care how much they move when the machine is otherwise idle.

I truthfully don't know how much fragmentation my drives have, and I'm not sure I have an easy way to find out.
Title: Re: defragment network drives for d-link 323?
Post by: dosborne on September 18, 2010, 09:09:36 PM
ffp includes the standard linux 'filefrag' utility that reports on file fragmentation. Haven't tried it myself, just came across it.
Title: Re: defragment network drives for d-link 323?
Post by: gunrunnerjohn on September 19, 2010, 07:12:08 AM
Don't think this is going to be much help.  From the description.


Quote
DESCRIPTION
       filefrag  reports  on  how badly fragmented a particular file might be.
       It makes allowances for indirect blocks for ext2 and ext3  filesystems,
       but can be used on files for any filesystem.



Title: Re: defragment network drives for d-link 323?
Post by: blizzak on October 16, 2010, 08:58:06 AM
I'm convinced that my 323 is fragmented to all hell.  Files that have been on it for a long time transfer really fast over the network (30 MB/s read) whereas newer files put on there when I had the least free space (20 GB free out of 1 TB) go like 8-9 MB/s.  There really can't be any other explanation for it.  I'll be testing some defrag utilities very soon.
Title: Re: defragment network drives for d-link 323?
Post by: gunrunnerjohn on October 16, 2010, 09:08:41 AM
Please post your results, I'm curious as to what you find. :)
Title: Re: defragment network drives for d-link 323?
Post by: blizzak on October 16, 2010, 09:09:42 AM
Heh, you get what you ask for.  Don't have much time now, but I did run that fragfile tool on a 3 GB file that was transferring slow for me.  Here was the result:

200519 extents found, perfection would be 25 extents.

That file only transfers at like 8-9 MB/s.  Now, here's an 700 MB iso that transfers at 25-30 MB/s:

15 extents found, perfection would be 6 extents.

So I think it just might be possible that fragmentation is an issue on the DNS-323, and will affect transfer speeds.
Title: Re: defragment network drives for d-link 323?
Post by: gunrunnerjohn on October 16, 2010, 09:16:49 AM
We had a lively discussion about fragmentation on EXT2/EXT3 filesystems here a couple of months ago, some are convinced that Linux filesystems need no defrag.  I pointed out that a defrag was planned for EXT4, so it seems that someone feels it is. :D

Those results are interesting, but I wonder how you defrag that in the box?
Title: Re: defragment network drives for d-link 323?
Post by: blizzak on October 17, 2010, 09:57:20 AM
Yeah, there are tools for defragging, but I don't think that the drives can be mounted while you do that.  Seems like more of a pain than anything.  One thing I wonder if it would work (I'm using RAID1) is pulling out a drive, formatting it, sticking it back in and turning it on and allowing the array to rebuild.  Then pulling out the other drive and doing the same thing.  Would the files be copied over in a linear fashion, or does it do it like 1:1? (which would make the rebuilt drive have the same fragmentation as the good drive).

Either way, I'm copying a bunch of data off and probably gonna format and copy it back.  But not sure yet...