Rolffokkens (talk | contribs) No edit summary |
No edit summary |
||
(30 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Package bcache-tools test cases]] | [[Category:Package bcache-tools test cases]] | ||
{{QA/Test_Case | {{QA/Test_Case | ||
|description=/ on bcache | |description= | ||
This page describes a test case for bcache-tools: "/ 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. | |||
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: [[QA:Testcase_bcache-tools_home_on_bcache_(no_LVM)|/home on bcache (no LVM)]] | |||
|setup= | |setup= | ||
If you haven't done so, you should first execute the use case [[QA:Testcase_bcache-tools_home_on_bcache_(no_LVM)|/home on bcache (no LVM)]]. | |||
Next we'll stop using /home on bcache first: | |||
# Open terminal | # Open terminal | ||
# Switch to root user: <code>su -</code> | # Switch to root user: <code>su -</code> | ||
# if needed make a | # if needed make a backup of /home on your root filesystem: <code>cp -a /home /home.backup</code> | ||
# comment /home out in your /etc/fstab | # comment /home out in your /etc/fstab | ||
# unmount /home: <code>umount /home</code> | # unmount /home: <code>umount /home</code> | ||
# if | # if applicable restore your bachup to the /home directory: <code>cp -a /home.backup/* /home</code> | ||
|actions= | |||
Now your /home is in your root filesystem. Next: | Now your /home is in your root filesystem. Next: | ||
# create a new filesystem on /dev/bcache0: <code>mkfs -t ext4 -L ROOTFS /dev/bcache0</code> | # create a new filesystem on /dev/bcache0: <code>mkfs -t ext4 -L ROOTFS /dev/bcache0</code> | ||
# mount it: <code>mount /dev/bcache0 /mnt</code> | # mount it: <code>mount /dev/bcache0 /mnt</code> | ||
# copy your current root filesystem to /mnt: <code>cp -ax / /mnt</code> | # copy your current root filesystem to /mnt: <code>cp -ax / /mnt</code> | ||
# edit /mnt/fstab so your root fs is mounted like: <code>LABEL=ROOTFS / ext4 defaults 1 1</code> | # edit /mnt/etc/fstab so your root fs is mounted like: <code>LABEL=ROOTFS / ext4 defaults 1 1</code> | ||
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 | # rename your current initramfs: <code>mv /boot/initramfs-`uname -r`.img /boot/initramfs-`uname -r`.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 | # while booting edit the default grub entry and replace the root=UUID=... parameter in the "linux" line by: root=LABEL=ROOTFS | ||
# | # 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 bcache! Now we have to do some final housekeeping: | ||
# | # update grub config: <code>grub2-mkconfig -o /boot/grub2/grub.cfg</code> for BIOS systems and <code>grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg</code> for UEFI systems | ||
# | # rename your current initramfs (again): <code>mv /boot/initramfs-`uname -r`.img /boot/initramfs-`uname -r`.img.sav</code> | ||
# build a new initramfs with <i>only</i> the needed drivers included: <code>dracut</code> | |||
# | 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, | ||
# <code>wget http://dl.fedoraproject.org/pub/alt/stage/20-Beta-TC2/Fedora/x86_64/iso/Fedora-20-Beta-TC2-x86_64-DVD.iso</code> | |||
|results= | |results= | ||
# All steps complete without errors | # All steps complete without errors | ||
# wget should have the same speed of all time | |||
|optional= | |||
The only partitions used on the /dev/sda device are /dev/sda1 and /dev/sda2. We can add the rest of the disk space to the root filesystem: | |||
# start <code>fdisk /dev/sda</code> | |||
# note the starting start position of /dev/sda2 | |||
# remove partitions /dev/sda2, /dev/sda3 and /dev/vda4 | |||
# recreate /dev/sda2 and make sure the start position is the number you noted before | |||
# write the new partition table to disk | |||
# reboot | |||
After the reboot the new partation table is used by the kernel. /dev/bcache0 automatically is resized because the underlying /dev/sda2 has been resized. | |||
# resize the root filesystem: <code>resiz2fs /dev/bcache0</code> | |||
# use df to check the filesystem's size | |||
}} | }} |
Latest revision as of 23:32, 13 October 2013
Description
This page describes a test case for bcache-tools: "/ 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.
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)
Setup
If you haven't done so, you should first execute the use case /home on bcache (no LVM).
Next we'll stop using /home on bcache first:
- Open terminal
- Switch to root user:
su -
- if needed make a backup of /home on your root filesystem:
cp -a /home /home.backup
- comment /home out in your /etc/fstab
- unmount /home:
umount /home
- if applicable restore your bachup to the /home directory:
cp -a /home.backup/* /home
How to test
Now your /home is in your root filesystem. Next:
- create a new filesystem on /dev/bcache0:
mkfs -t ext4 -L ROOTFS /dev/bcache0
- mount it:
mount /dev/bcache0 /mnt
- copy your current root filesystem to /mnt:
cp -ax / /mnt
- 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:
- rename your current initramfs:
mv /boot/initramfs-
uname -r
.img /boot/initramfs-uname -r
.img.sav - build a new initramfs with all drivers (including bcache) included:
dracut -N
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
- now start the modified grub entry
If all goes well, your system now boots fine and it's running on bcache! Now we have to do some final housekeeping:
- update grub config:
grub2-mkconfig -o /boot/grub2/grub.cfg
for BIOS systems andgrub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
for UEFI systems - rename your current initramfs (again):
mv /boot/initramfs-
uname -r
.img /boot/initramfs-uname -r
.img.sav - build a new initramfs with only the needed drivers included:
dracut
Now your system should be ready!
- reboot your system to see if it boots OK.
- apply updates:
yum update
. Specifically try to update the kernel, because it depens on the proper interaction between dracut, bcache-tools and util-linux, wget http://dl.fedoraproject.org/pub/alt/stage/20-Beta-TC2/Fedora/x86_64/iso/Fedora-20-Beta-TC2-x86_64-DVD.iso
Expected Results
- All steps complete without errors
- wget should have the same speed of all time
Optional
The only partitions used on the /dev/sda device are /dev/sda1 and /dev/sda2. We can add the rest of the disk space to the root filesystem:
- start
fdisk /dev/sda
- note the starting start position of /dev/sda2
- remove partitions /dev/sda2, /dev/sda3 and /dev/vda4
- recreate /dev/sda2 and make sure the start position is the number you noted before
- write the new partition table to disk
- reboot
After the reboot the new partation table is used by the kernel. /dev/bcache0 automatically is resized because the underlying /dev/sda2 has been resized.
- resize the root filesystem:
resiz2fs /dev/bcache0
- use df to check the filesystem's size