From Fedora Project Wiki

No edit summary
No edit summary
Line 30: Line 30:
Now we have a duplicate root filesystem on /dev/bcache0. To use it we need to build a new initramfs:
Now we have a duplicate root filesystem on /dev/bcache0. To use it we need to build a new initramfs:
# rename your current initramfs: <code>mv /boot/initramfs...img /boot/initramfs...img.sav</code>
# rename your current initramfs: <code>mv /boot/initramfs...img /boot/initramfs...img.sav</code>
# build a new initramfs with <code>dracut -N</code>
# build a new initramfs with all drivers (including bcache) included: <code>dracut -N</code>
Now reboot your system.
Now reboot your system.
# while booting edit the default grub entry and replace the root=UUID=... parameter in the "linux" line by: root=LABEL=ROOTFS
# while booting edit the default grub entry and replace the root=UUID=... parameter in the "linux" line by: root=LABEL=ROOTFS

Revision as of 07:37, 12 October 2013


Description

This page describes a test case for bcache-tools, 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.

Starting with a stable F20 system with /home on LVM on bcache, we can go forward and have / on bcache. Consider thought that bcache is EXPERIMENTAL!

Prerequisites

This test requires the following test case as preparation: /home on bcache (no LVM)

The prerequisites for running the bcache-tools testcases can be found on this page

Setup

To get / on bcache we'll stop using /home on bcache first:

  1. Open terminal
  2. Switch to root user: su -
  3. if needed make a backup of /home on your root filesystem.
  4. comment /home out in your /etc/fstab
  5. unmount /home: umount /home
  6. if applicable restore your bachup to the /home directory

How to test

Now your /home is in your root filesystem. Next:

  1. create a new filesystem on /dev/bcache0: mkfs -t ext4 -L ROOTFS /dev/bcache0
  2. mount it: mount /dev/bcache0 /mnt
  3. copy your current root filesystem to /mnt: cp -ax / /mnt
  4. edit /mnt/etc/fstab so your root fs is mounted like: LABEL=ROOTFS / ext4 defaults 1 1

Now we have a duplicate root filesystem on /dev/bcache0. To use it we need to build a new initramfs:

  1. rename your current initramfs: mv /boot/initramfs...img /boot/initramfs...img.sav
  2. build a new initramfs with all drivers (including bcache) included: dracut -N

Now reboot your system.

  1. while booting edit the default grub entry and replace the root=UUID=... parameter in the "linux" line by: root=LABEL=ROOTFS
  2. boot your system.

If all goes well, your system now boots fine and it's running on bcache!

  1. Create a new /etc/grub2.cfg file: grub2-mkconfig > /etc/grub2.cfg
  2. reboot your system to see if it boots OK.
  3. do some other testing if you like.

Expected Results

  1. All steps complete without errors