From Fedora Project Wiki

No edit summary
No edit summary
Line 30: Line 30:
# remove any rd.lvm=0 occurrence
# remove any rd.lvm=0 occurrence
# now start the modified grub entry
# now start the modified grub entry
If all goes well, your system now boots fine and it's running on bcache!
If all goes well, your system now boots fine and it's running on LVM on bcache! Now we have to do some final housekeeping:
# create a new /etc/grub2.cfg file: <code>grub2-mkconfig > /etc/grub2.cfg</code>
# create a new /etc/grub2.cfg file: <code>grub2-mkconfig > /etc/grub2.cfg</code>
# rename your current initramfs (again): <code>mv /boot/initramfs...img /boot/initramfs...img.sav</code>
# rename your current initramfs (again): <code>mv /boot/initramfs...img /boot/initramfs...img.sav</code>
# build a new initramfs with <i>only</i> the needed drivers included: <code>dracut</code>
# build a new initramfs with <i>only</i> the needed drivers included: <code>dracut</code>
Now  your system should be ready!
Now  your system should be ready!
# reboot your system to see if it boots OK.
# reboot your system to see if it boots OK
# apply updates: <code>yum update</code>. Specifically try to update the kernel, because it depens on the proper interaction between dracut, bcache-tools and util-linux,
# do some other testing if you like.
# do some other testing if you like.
|results=
|results=
# All steps complete without errors
# All steps complete without errors
}}
}}

Revision as of 12:49, 12 October 2013


Description

This page describes a test case for bcache-tools: "/ on bcache 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, dracut and lvm2.

Starting with a stable 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 (LVM). Furthermore it requires the volume group BCACHE to have at least 2 GB free space!

Setup

If you haven't done so, you should first execute the use case /home on bcache (LVM).

How to test

To get / on bcache:

  1. create a Logical Volume: lvcreate -L 2G -n ROOTFS BCACHE
  2. create a filesystem: mkfs -t ext4 -L ROOTFS /dev/BCACHE/ROOTFS
  3. mount it: mount /dev/BCACHE/ROOTFS /mnt
  4. copy your current root filesystem to /mnt: cp -ax / /mnt
  5. edit /mnt/fstab so your root fs is mounted like: LABEL=ROOTFS / ext4 defaults 1 1

Now we have a duplicate root filesystem on /dev/BCACHE/ROOTFS. 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: 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. remove any rd.lvm=0 occurrence
  3. now start the modified grub entry

If all goes well, your system now boots fine and it's running on LVM on bcache! Now we have to do some final housekeeping:

  1. create a new /etc/grub2.cfg file: grub2-mkconfig > /etc/grub2.cfg
  2. rename your current initramfs (again): mv /boot/initramfs...img /boot/initramfs...img.sav
  3. build a new initramfs with only the needed drivers included: dracut

Now your system should be ready!

  1. reboot your system to see if it boots OK
  2. apply updates: yum update. Specifically try to update the kernel, because it depens on the proper interaction between dracut, bcache-tools and util-linux,
  3. do some other testing if you like.

Expected Results

  1. All steps complete without errors