Thread (5 messages) 5 messages, 3 authors, 2021-12-21

Re: Recommendation: laptop with SATA HDD, NVMe SSD; compression; fragmentation

From: Vadim Akimov <hidden>
Date: 2021-12-20 10:29:43

Hi!

On Mon, 20 Dec 2021 at 12:11, Jorge Peixoto de Morais Neto
[off-list ref] wrote:
For lifetime and space saving, I intend to install Debian to the SSD
with compress-force=zstd:12, but after installation adopt compress-
force=zstd.  Installation will be slow---I'll do something else while
the installer works---but the installed system will be efficient, right?
From my limited experience, it would be better installing at some
(extra) HDD in "normal" mode and then copying everything to newly
formatted btrfs volume with all options as you like. After that, you
do usual 'chroot, grub-install' thing et voila.
I also have a QEMU-KVM VM with a qcow2 disk image currently weighting 24
GB.  Should I convert the qcow2 image to raw format?  Or should I
convert it to a new qcow2 image with the nocow option?  I do not use
disk encryption and I rarely snapshot the VM disk.
Also from my experience, it's better not to use btrfs for qemu images
at all. If you have to, use raw file format AND prepare image file
like this:
1. touch filename.img
2. chattr +C filename.img
3. dd if=old_img_file.img of=filename.img
That ensures the file will be in 'nodatacow' mode, i.e. data in it
will always be inplace without CoW updates.
Even with such file you'll get synchronous writes in the VM 3-4 times
slower than you'd have with image on ext4.
Not doing 'nodatacow' exercise makes them even slower than that and
degrading over time.

By speaking 'synchronous writes' I mean even the simple things as
doing 'apt upgrade' inside VM. It really becomes slower with image on
btrfs.
The SSD will have 50 GB extra over provisioning and a 200 GB partition,
besides the special UEFI partition.  The SATA HDD will start with 16 GiB
swap partition then a big partition.  I'll put system and /home on the
SSD but all XDG user dirs² on the HDD, and tmpfs on /tmp.  All three
drives will have Btrfs with space_cache=v2, noatime, zstd compression
and reasonable free breathing space.
I'd keep swap on HDD for all times except when swap is extensively
used due to real memory shortage. In all other times swap could nicely
sit on HDD dumping some really not used memory pages in the
background. And anyway, you still can have swap in a file over btrfs,
no need for separate partition.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help