From Fedora Project Wiki

No edit summary
No edit summary
Line 7: Line 7:
# Switch to root user: <code>su -</code>
# Switch to root user: <code>su -</code>
# Install bcache tools: <code>yum install bcache-tools</code>
# Install bcache tools: <code>yum install bcache-tools</code>
* If needed "backup" all data in /home to another place on your root filesystem:
# If needed "backup" all data in /home to another place on your root filesystem:
** comment /home out in your /etc/fstab
## comment /home out in your /etc/fstab
** unmount /home (which is on /dev/sda2)
## unmount /home (which is on /dev/sda2)
** Make /dev/sda2 a bcache backing device: make-bcache -B /dev/sda2
## Make /dev/sda2 a bcache backing device: make-bcache -B /dev/sda2
** Make /dev/sdb1 a bcache caching device: make-bcache -C /dev/sdb1
## Make /dev/sdb1 a bcache caching device: make-bcache -C /dev/sdb1
** Note the set uuid and attach /dev/sdb1 to /dev/sda2: echo <set uuid> > /sys/block/bcache0/bcache/attach
## Note the set uuid and attach /dev/sdb1 to /dev/sda2: echo <set uuid> > /sys/block/bcache0/bcache/attach
|actions=
Now you have a bcache device: /dev/bcache0
Now you have a bcache device: /dev/bcache0
* use "bcache-status -s" to see details about your bcache device.
# use "bcache-status -s" to see details about your bcache device.
* create a filesystem: mkfs -t ext4 -L HOME /dev/bcache0
# create a filesystem: mkfs -t ext4 -L HOME /dev/bcache0
* create a /home entry in your /etc/fstab: LABEL=HOME /home ext4 defaults 1 2
# create a /home entry in your /etc/fstab: LABEL=HOME /home ext4 defaults 1 2
* mount /home: mount -a
# mount /home: mount -a
* If needed restore the /home backup you made earlier.
# If needed restore the /home backup you made earlier.
Now you have a system with /home on bcache.
Now you have a system with /home on bcache.
|actions=
* reboot your system to see if it boots OK.
* do some other testing if you like. Limit the amount of data on /home or accept that it gets lost in the following steps.
|results=
|results=
* All steps completes without error
* All steps completes without error
* reboot your system to see if it boots OK.
* do some other testing if you like. Limit the amount of data on /home or accept that it gets lost in the following steps.
|optional=
}}
}}

Revision as of 17:36, 10 October 2013


Description

/home on bcache (no LVM) Once your fresh Fedora 20 system is running, we will "move" /home to a bcache device. To do this it's convenient to have a minimum amount of data on /home. Do the following steps:

Setup

  1. Open terminal
  2. Switch to root user: su -
  3. Install bcache tools: yum install bcache-tools
  4. If needed "backup" all data in /home to another place on your root filesystem:
    1. comment /home out in your /etc/fstab
    2. unmount /home (which is on /dev/sda2)
    3. Make /dev/sda2 a bcache backing device: make-bcache -B /dev/sda2
    4. Make /dev/sdb1 a bcache caching device: make-bcache -C /dev/sdb1
    5. 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 filesystem: mkfs -t ext4 -L HOME /dev/bcache0
  3. create a /home entry in your /etc/fstab: LABEL=HOME /home ext4 defaults 1 2
  4. mount /home: mount -a
  5. If needed restore the /home backup you made earlier.

Now you have a system with /home on bcache.

How to test

  • reboot your system to see if it boots OK.
  • do some other testing if you like. Limit the amount of data on /home or accept that it gets lost in the following steps.

Expected Results

  • All steps completes without error