QA:Testcase bcache-tools mock on bcache (no LVM)
This page describes a test case for bcache-tools; "mock on bcache without using LVM".
Bcache is a Linux kernel block layer cache. It allows one or more fast disk drives such as flash-based solid state drives (SSDs) to act as a cache for one or more slower hard disk drives. The bcache-tools package contains the utilities for manipulating bcache
Testing covers not only bcache-tools but also the interaction between bcache-tools and other packages: kernel, util-linux and dracut.
Assuming you have a fresh Fedora 20 system is running, we will recreate mock partitions to a bcache device. To do this it's convenient to have a minimum amount of data on /home.
The prerequisites for running the bcache-tools testcases can be found on this page
- Open terminal
- Switch to root user:
First of all we have to make sure no traces of bcache superblocks are left on /dev/sdb1 from earlier experiments. So before installing bcache-tools do the following:
- update util-linux to the latest version (2.24 is required):
yum update util-linux
- Wipe whatever is on the /dev/sdb1 partition:
wipefs -a /dev/sdb1
- Wipe whatever is on the /dev/sdb2 partition:
wipefs -a /dev/sdb2
- Next install bcache-tools:
yum install bcache-tools
- comment /var/lib/mock and /var/cache/mock out in your /etc/fstab
- unmount /var/lib/mock (which is on /dev/sda2)
- unmount /var/cache/mock (which is on /dev/sda3)
- reboot so bcache-tools is processed well
How to test
- Erase the old /var/lib/mock from /dev/sda2:
wipefs -a /dev/sda2
- Erase the old /var/cache/mock from /dev/sda3:
wipefs -a /dev/sda3
- Make /dev/sda2 a bcache backing device:
make-bcache -B /dev/sda2
- Make /dev/sda3 a bcache backing device:
make-bcache -B /dev/sda3
- Make /dev/sdb1 a bcache caching device:
make-bcache -C /dev/sdb1
- Make /dev/sdb2 a bcache caching device:
make-bcache -C /dev/sdb2
- Retrieve the cset.uuid from your /dev/sdb1 caching device:
- Attach /dev/sdb1 to /dev/bcache0:
echo <cset.uuid> > /sys/block/bcache0/bcache/attach
- Retrieve the cset.uuid from your /dev/sdb2 caching device:
- Attach /dev/sdb1 to /dev/bcache1:
echo <cset.uuid> > /sys/block/bcache1/bcache/attach
Now you have a bcache device: /dev/bcache0 and /dev/bcache1
- use "
bcache-status -s" to see details about your bcache device.
- create a filesystem:
mkfs -t ext4 -L MOCK_LIB /dev/bcache0
- create a filesystem:
mkfs -t ext4 -L MOCK_CACHE /dev/bcache1
- create a /var/lib/mock entry in your /etc/fstab:
LABEL=MOCK_LIB /var/lib/mock ext4 defaults 1 2
- create a /var/cache/mock entry in your /etc/fstab:
LABEL=MOCK_CACHE /var/cache/mock ext4 defaults 1 2
- mount partitions:
- reboot your system to see if it boots OK.
- do some other tests generating I/O on mock partitions (two or more times).
$ fedpkg clone gnome-shell $ cd gnome-shell $ fedpkg srpm $ mock -r fedora-20-`arch` --rebuild *.src.rpm --verbose
- All steps complete without errors
- Last step after second replay should installing packages too much faster