ext4 defragmentation
This commit is contained in:
parent
73eb2d8146
commit
a1a448088d
|
@ -106,11 +106,21 @@ function install_tomb {
|
||||||
function defrag_filesystem {
|
function defrag_filesystem {
|
||||||
fs_type=$(stat -f /)
|
fs_type=$(stat -f /)
|
||||||
|
|
||||||
if [[ "$fs_type" == *"btrfs"* ]]; then
|
if [[ "$fs_type" != *"btrfs"* && "$fs_type" != *"ext4"* ]]; then
|
||||||
echo $'Defragmenting root directory'
|
return
|
||||||
btrfs filesystem defragment -r /
|
|
||||||
echo $'Defragmentation completed'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo $'Defragmenting root directory'
|
||||||
|
|
||||||
|
if [[ "$fs_type" == *"btrfs"* ]]; then
|
||||||
|
btrfs filesystem defragment -r -clzo /
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$fs_type" == *"ext4"* ]]; then
|
||||||
|
e4defrag /
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $'Defragmentation completed'
|
||||||
}
|
}
|
||||||
|
|
||||||
# NOTE: deliberately no exit 0
|
# NOTE: deliberately no exit 0
|
||||||
|
|
Loading…
Reference in New Issue