From Fedora Project Wiki

No edit summary
No edit summary
Line 13: Line 13:
# Note the set uuid and attach /dev/sdb1 to /dev/sda2: <code>echo <set uuid> > /sys/block/bcache0/bcache/attach</code>
# Note the set uuid and attach /dev/sdb1 to /dev/sda2: <code>echo <set uuid> > /sys/block/bcache0/bcache/attach</code>
Now you have a bcache device: /dev/bcache0
Now you have a bcache device: /dev/bcache0
|actions=
# use "bcache-status -s" to see details about your bcache device.
# use "bcache-status -s" to see details about your bcache device.
# create a Physical Volume: pvcreate /dev/bcache0
# create a Physical Volume: pvcreate /dev/bcache0
Line 28: Line 27:
## <code>cp -ax /home.old/* /home</code>
## <code>cp -ax /home.old/* /home</code>
## <code>umount /home.old</code>
## <code>umount /home.old</code>
# build a new initramfs with <code>dracut -N</code>
# build a new initramfs with <code>dracut -N</code>
Now you have a system with /home on LVM2 on bcache.
Now you have a system with /home on LVM2 on bcache.
|actions=
# reboot your system to see if it boots OK.
# do some other testing if you like.
|results=
|results=
# All steps complete without errors
# All steps complete without errors
# reboot your system to see if it boots OK.
# do some other testing if you like.
}}
}}

Revision as of 17:24, 10 October 2013


Description

/home on bcache (LVM)

Once your fresh Fedora 20 system is running, we will "move" /home to a Logical Volume (LVM) on a bcache device. Because of the flexibility that LVM provides the approach is quite different from page 1.A, for example we'll start by using sda4! Do the following steps:

Setup

  1. Open terminal
  2. Switch to root user: su -
  3. Install bcache tools: yum install bcache-tools
  4. Make /dev/sda4 a bcache backing device: make-bcache -B /dev/sda4
  5. Make /dev/sdb1 a bcache caching device: make-bcache -C /dev/sdb1
  6. Note the set uuid and attach /dev/sdb1 to /dev/sda2: echo <set uuid> > /sys/block/bcache0/bcache/attach

Now you have a bcache device: /dev/bcache0

  1. use "bcache-status -s" to see details about your bcache device.
  2. create a Physical Volume: pvcreate /dev/bcache0
  3. create a Volume Group: vgcreate BCACHE /dev/bcache0
  4. create a Logical Volume: lvcreate -L 2G -n HOME BCACHE
  5. create a filesystem: mkfs -t ext4 -L HOME /dev/BCACHE/HOME

This will be our new /home device. To use it first move the current /home to another mount point:

  1. replace /home entry in your /etc/fstab: LABEL=HOME /home ext4 defaults 1 2
  2. commands step by step:
    1. mkdir /home.old
    2. umount /home
    3. mount /dev/sda2 /home.old
    4. mount /home
    5. cp -ax /home.old/* /home
    6. umount /home.old
  3. build a new initramfs with dracut -N

Now you have a system with /home on LVM2 on bcache.

How to test

  1. reboot your system to see if it boots OK.
  2. do some other testing if you like.

Expected Results

  1. All steps complete without errors