On 4/6/20 4:24 AM, Zygo Blaxell wrote:
Of course btrfs is slower than ext4 when a lot of sync/flush are involved. Using
apt on a rotational was a dramatic experience. And IMHO this should be replaced
by using the btrfs snapshot capabilities. But this is another (not easy) story.
flushoncommit and eatmydata work reasonably well...once you patch out the
noise warnings from fs-writeback.
You wrote flushoncommit, but did you mean "noflushoncommit" ?
Regarding eatmydata, I used it too. However I was never happy. Below my script:
----------------------------------
ghigo@venice:/etc/apt/apt.conf.d$ cat 10btrfs.conf
DPkg::Pre-Invoke {"bash /var/btrfs/btrfs-apt.sh snapshot";};
DPkg::Post-Invoke {"bash /var/btrfs/btrfs-apt.sh clean";};
Dpkg::options {"--force-unsafe-io";};
---------------------------------
ghigo@venice:/etc/apt/apt.conf.d$ cat /var/btrfs/btrfs-apt.sh
btrfsroot=/var/btrfs/debian
btrfsrollback=/var/btrfs/debian-rollback
do_snapshot() {
if [ -d "$btrfsrollback" ]; then
btrfs subvolume delete "$btrfsrollback"
fi
i=20
while [ $i -gt 0 -a -d "$btrfsrollback" ]; do
i=$(( $i + 1 ))
sleep 0.1
done
if [ $i -eq 0 ]; then
exit 100
fi
btrfs subvolume snapshot "$btrfsroot" "$btrfsrollback"
}
do_removerollback() {
if [ -d "$btrfsrollback" ]; then
btrfs subvolume delete "$btrfsrollback"
fi
}
if [ "$1" = "snapshot" ]; then
do_snapshot
elif [ "$1" = "clean" ]; then
do_removerollback
else
echo "usage: $0 snapshot|clean"
fi
--------------------------------------------------------------
Suggestion are welcome how detect automatically where is mount the btrfs root (subvolume=/) and my root subvolume name (debian in my case). So I will avoid to wrote directly in my script.
BR
G.Baroncelli
--
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5