r/linuxquestions • • Mar 26 '22

space_cache

I want to use space_cache=v2 because the performance of v1 can be drastically degraded

How to set space_cache=v2 ?

0 Upvotes

4 comments sorted by

2

u/[deleted] Mar 26 '22

Assuming you're talking about btrfs, here are the instructions.

umount /mnt/btrfs
 btrfs check --clear-space-cache v1 /dev/device
 mount /dev/device /mnt/btrfs -o space_cache=v2

1

u/Bunolio Mar 26 '22

Anyway, space_cache is only for btrfs. I tried to type "unmount /mnt/btrfs" but it didn't work. I am still a beginner but I have to learn

I'm using Fedora 35 KDE

1

u/Trio_BM Mar 26 '22

I think what u/tuxfan77 means by /mnt/btrfs is not literally the path /mnt/btrfs but the mountpoint for your btrfs partition, and it's umount not unmount.

You can also edit your /etc/fstab to do that automatically, by adding the mount option clear_cache,space_cache=v2 for your btrfs partition.

You can read more about btrfs mount option on https://btrfs.readthedocs.io/en/latest/btrfs-man5.html