Ask Ubuntu Asked on December 29, 2021
I made a fresh install of ubuntu 20.04 on my desktop, and then, from within the installation, created a bcache device to put my /home
sudo make-bcache -C /dev/sdb4 -B /dev/sda1
Where /dev/sdb is the ssd and /dev/sda is the hdd.
But after doing so, editing fstab, and transferring the data into the partition, I realized that I never set it to –writeback mode or specified the cache replacement policy
make-bcache --help Usage: make-bcache [options] device -C, --cache Format a cache device -B, --bdev Format a backing device -b, --bucket bucket size -w, --block block size (hard sector size of SSD, often 2k) -o, --data-offset data offset in sectors --cset-uuid UUID for the cache set --writeback enable writeback --discard enable discards --cache_replacement_policy=(lru|fifo) -h, --help display this help and exit
Is it possible to change the configuration of my existing bcache to do that without losing data or would I be better starting over?
You can change both replacement policy and cache mode via the /sys interfaces while the system is running. Just echo the appropriate setting word to the file and it changes the setting.
The control file contents show the available options and current setting when you read them - for example:
# cat /sys/fs/bcache/[you cache id]/cache0/cache_replacement_policy [lru] fifo random
# cat /sys/block/[your bcache device]/bcache/cache_mode writethrough writeback [writearound] none
Answered by Rob AKA on December 29, 2021
0 Asked on December 1, 2020 by mlstudent33
2 Asked on December 1, 2020 by zee
4 Asked on December 1, 2020 by deepsidhu1313
1 Asked on December 1, 2020 by gana-dube
3 Asked on November 30, 2020 by nyambaa
0 Asked on November 30, 2020 by dbc_xl
1 Asked on November 29, 2020 by niols
0 Asked on November 29, 2020 by edgardo
1 Asked on November 28, 2020 by astral-axiom
1 Asked on November 28, 2020 by ch325
0 Asked on November 28, 2020 by junaid-farooq
0 Asked on November 28, 2020 by pranto
1 Asked on November 28, 2020 by guillaume
0 Asked on November 28, 2020
1 Asked on November 28, 2020 by franois-requet
1 Asked on November 27, 2020 by carlos-andres-zapata-cuervo
Get help from others!