2021-03-22 13:10:20 +01:00
|
|
|
defragfs/fragmentation - Linux file-system defragmenter & tool for calculate the fragmentation
|
|
|
|
==============================================================================================
|
|
|
|
|
|
|
|
### Authors:
|
|
|
|
|
|
|
|
* CanHao Xu <xucanhao@gmail.com>
|
|
|
|
* John Robson <john.robson@usp.br>
|
|
|
|
|
|
|
|
### Tools:
|
|
|
|
|
2021-03-22 13:21:11 +01:00
|
|
|
* [defragfs](https://github.com/q3aql/defragfs-fragmentation/blob/master/src/defragfs) - File-system defragmenter tool.
|
|
|
|
* [fragmentation](https://github.com/q3aql/defragfs-fragmentation/blob/master/src/fragmentation) - Tool for calculate fragmentation.
|
2021-03-22 13:10:20 +01:00
|
|
|
|
|
|
|
_Dependencies: `perl`, `coreutils`, `e2fsprogs`._
|
|
|
|
|
|
|
|
### Installation:
|
|
|
|
|
|
|
|
* Open the terminal and type the following comands:
|
|
|
|
|
2021-03-22 13:15:16 +01:00
|
|
|
```shell
|
2022-10-22 16:54:29 +02:00
|
|
|
$ git clone https://gitlab.com/q3aql/defragfs-fragmentation
|
2021-03-22 13:21:11 +01:00
|
|
|
$ cd defragfs-fragmentation
|
2021-03-22 13:15:16 +01:00
|
|
|
$ sudo make install
|
|
|
|
````
|
2021-03-22 13:10:20 +01:00
|
|
|
|
|
|
|
_Note: You must install `git` previously._
|
|
|
|
|
2021-03-22 13:15:16 +01:00
|
|
|
### Syntax (defragfs):
|
2021-03-22 13:10:20 +01:00
|
|
|
|
|
|
|
```shell
|
|
|
|
$ sudo defragfs <partition or directory> [option]
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
|
|
|
-a Automatically defrag (configure: $max_fragrate and $max_avgfrags
|
2021-03-22 13:11:32 +01:00
|
|
|
according to your preference).
|
|
|
|
Use this in your crontab. e.g. sudo crontab -e (and add this line)
|
|
|
|
0 0 1 */2 * defragfs / -a
|
2021-03-22 13:10:20 +01:00
|
|
|
|
|
|
|
-f Force defrag if there is at least one fragmented file.
|
|
|
|
|
|
|
|
-h Display this Help.
|
|
|
|
|
|
|
|
````
|
|
|
|
|
2021-03-22 13:15:16 +01:00
|
|
|
### Syntax (fragmentation):
|
2021-03-22 13:10:20 +01:00
|
|
|
|
|
|
|
```shell
|
|
|
|
$ sudo fragmentation <directory>
|
|
|
|
````
|
|
|
|
|
|
|
|
### External links:
|
|
|
|
|
|
|
|
* [Perl website](https://www.perl.org/)
|
|
|
|
* [Coreutils](https://www.gnu.org/software/coreutils/coreutils.html)
|
|
|
|
* [E2fsprogs](http://e2fsprogs.sourceforge.net/)
|
|
|
|
* [ThomasCX/defragfs](https://github.com/ThomasCX/defragfs)
|