ext4 defragmentation
This commit is contained in:
parent
73eb2d8146
commit
a1a448088d
|
@ -106,11 +106,21 @@ function install_tomb {
|
|||
function defrag_filesystem {
|
||||
fs_type=$(stat -f /)
|
||||
|
||||
if [[ "$fs_type" == *"btrfs"* ]]; then
|
||||
echo $'Defragmenting root directory'
|
||||
btrfs filesystem defragment -r /
|
||||
echo $'Defragmentation completed'
|
||||
if [[ "$fs_type" != *"btrfs"* && "$fs_type" != *"ext4"* ]]; then
|
||||
return
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue