Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Community Discussions > The Community Cafe
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

The Community Cafe
The Community Chat area is for lighthearted and enjoyable discussions, like you might find around a water cooler at work.

Almost any non-tech-support topic may be discussed here. Discussions on religion and politics are not allowed, except for politics directly related to free and open source issues. Any topic or discussion that causes problems or drama will be closed. This area is intended for fun and community building, not arguments. Please take those elsewhere. Thanks!

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old July 20th, 2008   #1
solarwind
Has an Ubuntu Drip
 
solarwind's Avatar
 
Join Date: Jan 2006
Location: Ontario, Canada
Beans: 708
Send a message via MSN to solarwind
fiDefrag

=== fiDefrag ===
Author: solarwind
Email: x.solarwind.x@gmail.com
Language: Python - Requires Python 2.4 or greater.
Dependencies:
Libraries:
* Standard Python libraries
* python-psyco - Not a requirement, but greatly improves performance.

Executables:
* find
* du
* filefrag
* rsync
* lsof


--- Introduction: ---

fiDefrag is a filesystem independent file defragmenter written in Python. It is loosely based on John Dong's pyFragTools
but is cleaner, faster, more efficient and newer. The structure of the code is also easier to understand and more organized.

It can be run on any Unix-like system which meets with the above dependencies. It was originally written to minimize the
file fragmentation on JFS filesystems but can be run on ANY Unix-like system with any filesystem which meets the above
dependencies. It was tested on and works very well on JFS filesystems. It's also useful on ext2 or ext3 filesystems and even ReiserFS.

--- Usage: ---

* fiDefrag requires root privileges to run.

sudo python fiDefrag.py -h | -a <dir> | -d <dir> [-p <passes>]

* Run sudo fiDefrag.py for more usage information.

--- Project: ---

* The project is hosted at https://launchpad.net/fidefrag
* The project is a bzr tree, so you can branch it by typing the following. This will always get the latest version.
$ bzr branch lp:fidefrag
* The project directory is an Eclipse Pydev project, so you can use Eclipse and Pydev to edit/test the project.
* If you have any fixes/improvements for the project, please register a blueprint or a bug at the launchpad project page.
* You can also submit a patch or push your own branch and request a merge.

--- What the output means: ---

Here is a sample output when I defragged my .mozilla folder.

Code:
=== Defragmenting /home/vg/.mozilla/ - 137M - 824 Files - 5 Passes ===

=== Building File List...
=== Building Extended File Info...
        824 /     824 - 100%

--- Pass 1 / 5 ---

   0.09 MB    4 P   44.26 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Improved:    4.00 P -->    3.00 P
   0.03 MB    4 P  127.22 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    4.00 P -->    1.00 P. Appending to blacklist.
   0.03 MB    4 P  128.35 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Improved:    4.00 P -->    3.00 P
   0.03 MB    6 P  221.57 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    6.00 P -->    1.00 P. Appending to blacklist.
   0.09 MB    3 P   32.99 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P
   0.08 MB   11 P  129.81 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:   11.00 P -->    1.00 P. Appending to blacklist.
   0.11 MB    3 P   26.97 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    4.00 P
   0.02 MB    3 P  134.38 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    3.00 P -->    1.00 P. Appending to blacklist.
   0.13 MB    4 P   30.71 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Improved:    4.00 P -->    3.00 P
   0.28 MB    3 P   10.67 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P
   0.08 MB    6 P   70.76 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    6.00 P -->    1.00 P. Appending to blacklist.
   0.10 MB    3 P   28.86 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P
   0.32 MB    8 P   25.01 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    8.00 P -->    1.00 P. Appending to blacklist.
   0.03 MB    3 P   99.57 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P
   0.05 MB    7 P  154.30 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    7.00 P -->    1.00 P. Appending to blacklist.
   0.02 MB    3 P  179.22 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P
  12.11 MB   26 P    2.15 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement   26.00 P -->   27.00 P
   0.13 MB    7 P   55.88 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Improved:    7.00 P -->    3.00 P
   2.31 MB   14 P    6.07 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Improved:   14.00 P -->    5.00 P
   0.31 MB    6 P   19.16 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Improved:    6.00 P -->    3.00 P

--- Pass 2 / 5 ---

   0.09 MB    3 P   33.19 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    3.00 P -->    1.00 P. Appending to blacklist.
   0.03 MB    3 P   96.26 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P
   0.09 MB    3 P   32.99 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    3.00 P -->    1.00 P. Appending to blacklist.
   0.11 MB    3 P   26.97 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    4.00 P
   0.13 MB    3 P   23.03 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    3.00 P -->    1.00 P. Appending to blacklist.
   0.28 MB    3 P   10.67 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    4.00 P
   0.10 MB    3 P   28.86 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P
   0.03 MB    3 P   99.57 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    3.00 P -->    1.00 P. Appending to blacklist.
   0.02 MB    3 P  179.22 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P
  12.11 MB   26 P    2.15 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Improved:   26.00 P -->   25.00 P
   0.13 MB    3 P   23.95 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P
   2.31 MB    5 P    2.17 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    5.00 P -->    7.00 P
   0.31 MB    3 P    9.58 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P

--- Pass 3 / 5 ---

   0.03 MB    3 P   96.26 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Fully defragmented:    3.00 P -->    1.00 P. Appending to blacklist.
   0.11 MB    3 P   26.97 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Too many consecutive no-improvements. Appending to blacklist.
   0.28 MB    3 P   10.67 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Too many consecutive no-improvements. Appending to blacklist.
   0.10 MB    3 P   28.86 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Too many consecutive no-improvements. Appending to blacklist.
   0.02 MB    3 P  179.22 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Too many consecutive no-improvements. Appending to blacklist.
  12.11 MB   25 P    2.06 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement   25.00 P -->   25.00 P
   0.13 MB    3 P   23.95 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P
   2.31 MB    5 P    2.17 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    5.00 P -->    5.00 P
   0.31 MB    3 P    9.58 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement    3.00 P -->    3.00 P

--- Pass 4 / 5 ---

  12.11 MB   25 P    2.06 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> No improvement   25.00 P -->   25.00 P
   0.13 MB    3 P   23.95 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Too many consecutive no-improvements. Appending to blacklist.
   2.31 MB    5 P    2.17 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Too many consecutive no-improvements. Appending to blacklist.
   0.31 MB    3 P    9.58 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Too many consecutive no-improvements. Appending to blacklist.

--- Pass 5 / 5 ---

  12.11 MB   25 P    2.06 P/MB 	 /home/vg/.mozilla/firefox/tfmpeoug.defau...
	--> Too many consecutive no-improvements. Appending to blacklist.


=== DEFRAG OPERATION COMPLETE.
Let's take this line for example:
Note that the term "fragment" and "part (P)" have the same meaning as far as we're concerned and refer to the number of fragments, parts or pieces a certain file is split into.
Quote:
0.05 MB 7 P 154.30 P/MB /home/vg/.mozilla/firefox/tfmpeoug.defau...
The first number shows the size of the file (0.05 MB). The second number (7 P) shows that this file has 7 fragments. The third number (154.30 P/MB) shows that this file has an average per megabyte fragmentation of 154.30 fragments per megabyte.
The line after it:
Quote:
--> Improved: 7.00 P --> 3.00 P
Shows the result of the defragmentation process for that file. In this case, the file has improved from 7 fragments to 3 fragments. This is a pretty good improvement, but the program think that it can do better so it so it defragments it again on the next pass.
__________________
http://solar-blogg.blogspot.com

Last edited by solarwind; July 23rd, 2008 at 03:55 PM..
solarwind is offline   Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

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

Forum Jump


All times are GMT -4. The time now is 03:15 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry