diff --git a/src/freedombone-utils-filesystem b/src/freedombone-utils-filesystem index f88d6548..f2bd79a3 100755 --- a/src/freedombone-utils-filesystem +++ b/src/freedombone-utils-filesystem @@ -124,7 +124,11 @@ function defrag_filesystem { } function optimise_filesystem { - sed -i 's|btrfs subvol=@|btrfs defaults,subvol=@,compress=lzo,ssd|g' /etc/fstab + if grep -q "btrfs" /etc/fstab; then + if ! grep -q "btrfs defaults,subvol=@,compress=lzo,ssd" /etc/fstab; then + sed -i 's|btrfs subvol=@|btrfs defaults,subvol=@,compress=lzo,ssd|g' /etc/fstab + fi + fi } # NOTE: deliberately no exit 0