LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-25-2012, 07:11 AM   #1
BeniBela2
LQ Newbie
 
Registered: Dec 2012
Posts: 4

Rep: Reputation: Disabled
defragmentation-of-linux-filesystems


Quote:
Originally Posted by robert.wolfe View Post
:

polishlinux.org/apps/cli/defragmentation-of-linux-filesystems/

Just remember that it is a good idea to have a least 10% of the filesystem you want defragmented available for the entire process to be successful. And don't forget, UNMOUNT THE AFFECTED FILESYSTEM BEFORE YOU RUN DEFRAGMENT!

That link links to download.tuxfamily.org/optimization/OptimizationKit/v0.1/tmp/ for ok_defrag, which returns 404.

Does anyone has a new link?


I think I desperately need to defrag my file system:

Code:
$ ls -Alh hg/programs/internet/VideLibri/videlibri
-rwxr-xr-x 1 benito benito 26M Dec 24 14:17 hg/programs/internet/VideLibri/videlibri
$ filefrag hg/programs/internet/VideLibri/videlibri
hg/programs/internet/VideLibri/videlibri: 747 extents found, perfection would be 1 extent

$ ls -AlrSh ~
[...]
-rw-r--r--   1 benito benito   13M Jan 15  2011 project1.exe
-rw-r--r--   1 benito benito   13M May 31  2010 Stein.pdf
-rw-r--r--   1 benito benito   13M Mar 25  2010 xxx.flv
-rw-r--r--   1 benito benito   23M Mar  2  2010 vogeldatabase.tar.bz2
-rw-r--r--   1 benito benito  3.3G Jul 26 10:23 9200.16384.WIN8_RTM.120725-1247_X64FRE_ENTERPRISE_EVAL_EN-US-HRM_CENA_X64FREE_EN-US_DV5.ISO?lcid=1033
$ filefrag 9200.16384.WIN8_RTM.120725-1247_X64FRE_ENTERPRISE_EVAL_EN-US-HRM_CENA_X64FREE_EN-US_DV5.ISO\?lcid\=1033  vogeldatabase.tar.bz2 xxx.flv Stein.pdf project1.exe 
9200.16384.WIN8_RTM.120725-1247_X64FRE_ENTERPRISE_EVAL_EN-US-HRM_CENA_X64FREE_EN-US_DV5.ISO?lcid=1033: 7344 extents found, perfection would be 1 extent
vogeldatabase.tar.bz2: 160 extents found, perfection would be 1 extent
xxx.flv: 230 extents found, perfection would be 1 extent
Stein.pdf: 7 extents found, perfection would be 1 extent
project1.exe: 8 extents found, perfection would be 1 extent

$ ls -AlrSh /tmp
...
-rw-r--r--   1 firefox firefox 844K Aug  3 00:53 hC29318.fmt
-rw-r--r--   1 firefox firefox 844K Aug 17 21:21 hZb7071.fmt
-rw-r--r--   1 firefox firefox 845K Aug 17 21:21 hBC7071.fmt
-rw-r--r--   1 benito  benito  847K Oct 11 22:36 crap
-rw-------   1 firefox firefox 1.5M Dec 24 23:36 clipboardcache
-rw-r--r--   1 benito  benito  1.7M Dec 24 15:05 videlibri-1.301.src.tar.gz

$ sudo filefrag hBC7071.fmt hZb7071.fmt hC29318.fmt crap clipboardcache videlibri-1.301.src.tar.gz 
hBC7071.fmt: 14 extents found, perfection would be 1 extent
hZb7071.fmt: 25 extents found, perfection would be 1 extent
hC29318.fmt: 5 extents found, perfection would be 1 extent
crap: 3 extents found, perfection would be 1 extent
clipboardcache: 10 extents found, perfection would be 1 extent
videlibri-1.301.src.tar.gz: 15 extents found, perfection would be 1 extent

$ df
Filesystem     1K-blocks      Used Available Use% Mounted on
rootfs         192251960 182113376    372680 100% /

Last edited by BeniBela2; 12-25-2012 at 07:34 AM.
 
Old 12-25-2012, 04:32 PM   #2
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,215
Blog Entries: 3

Rep: Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437Reputation: 1437
Moderator Response

Moved: This thread is more suitable in <Linux-General> and has been moved accordingly to help your thread/question get the exposure it deserves.

-----

Correct link: http://polishlinux.org/apps/cli/defr...x-filesystems/
 
Old 12-25-2012, 07:05 PM   #3
John VV
Guru
 
Registered: Aug 2005
Posts: 12,953

Rep: Reputation: 1720Reputation: 1720Reputation: 1720Reputation: 1720Reputation: 1720Reputation: 1720Reputation: 1720Reputation: 1720Reputation: 1720Reputation: 1720Reputation: 1720
Also ect3 and 4 and even the old ext2 file systems do not need to be "defraged"
that is a issue with Microsoft and there operating system

except is very rare occasions
 
Old 12-30-2012, 05:34 PM   #4
dru8274
Member
 
Registered: Oct 2011
Location: New Zealand
Distribution: Debian
Posts: 105

Rep: Reputation: 36
I'm not sure exactly which filesystem you are using. But if it is ext4, then you might use e4defrag, which is part of the e2fsprogs package.
Quote:
e4defrag - online defragmenter for ext4 filesystem

e4defrag reduces fragmentation of extent based file. The file targeted by e4defrag is created on ext4 filesystem made with "-O extent" option (see mke2fs(8)). The targeted file gets more contiguous blocks and improves the file access speed.
Happy with ur solution... then tick "yes" and mark as Solved!
 
Old 12-31-2012, 03:23 AM   #5
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
There is also a defrag program for XFS.

For other filesystems try my script:
http://www.linuxquestions.org/questi...7/#post4841091
 
Old 12-31-2012, 06:26 PM   #6
BeniBela2
LQ Newbie
 
Registered: Dec 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Sound nice.

But I use ext3
 
Old 01-01-2013, 06:03 PM   #7
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,381

Rep: Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109
Quote:
Originally Posted by John VV View Post
... that is a issue with Microsoft and there operating system
And even then, only for FATx filesystems, and then only if and when you really care anymore. (As mass-storage devices become semiconductor based, you won't care anymore...) Microsoft's later filesystems like NTFS have better space-allocation mechanisms, and disk drives and controllers are considerably smarter and faster.
 
Old 01-02-2013, 12:08 PM   #8
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,089

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
On a drive that had been intensively used for 8 years, fsck revealed 14% non-contiguous files. A check on the web shows people saying that you needed to defrag a Windows drive if that figure gets to 35%. Is your data ominous? Frankly, I can't make much sense of the program output!
 
Old 01-02-2013, 12:34 PM   #9
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Quote:
Originally Posted by BeniBela2 View Post
Sound nice.

But I use ext3
My script should work with any filesystem, but use it at your own risk. I have been using it for a while.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Test: Do Linux filesystems need defragmentation? LXer Syndicated Linux News 0 12-10-2007 06:41 PM
why no defragmentation in linux daedalusonlinux Linux - General 5 12-02-2005 03:56 AM
defragmentation in linux linuxbh Linux - Newbie 2 03-24-2005 12:31 PM
windows filesystems vs. linux filesystems irfanhab General 8 05-25-2004 07:21 AM
defragmentation in linux ramu_ak Linux - General 6 01-27-2004 06:18 PM


All times are GMT -5. The time now is 07:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration