|
@@ -106,11 +106,21 @@ function install_tomb {
|
106
|
106
|
function defrag_filesystem {
|
107
|
107
|
fs_type=$(stat -f /)
|
108
|
108
|
|
|
109
|
+ if [[ "$fs_type" != *"btrfs"* && "$fs_type" != *"ext4"* ]]; then
|
|
110
|
+ return
|
|
111
|
+ fi
|
|
112
|
+
|
|
113
|
+ echo $'Defragmenting root directory'
|
|
114
|
+
|
109
|
115
|
if [[ "$fs_type" == *"btrfs"* ]]; then
|
110
|
|
- echo $'Defragmenting root directory'
|
111
|
|
- btrfs filesystem defragment -r /
|
112
|
|
- echo $'Defragmentation completed'
|
|
116
|
+ btrfs filesystem defragment -r -clzo /
|
113
|
117
|
fi
|
|
118
|
+
|
|
119
|
+ if [[ "$fs_type" == *"ext4"* ]]; then
|
|
120
|
+ e4defrag /
|
|
121
|
+ fi
|
|
122
|
+
|
|
123
|
+ echo $'Defragmentation completed'
|
114
|
124
|
}
|
115
|
125
|
|
116
|
126
|
# NOTE: deliberately no exit 0
|