From Fedora Project Wiki

No edit summary
No edit summary
Line 15: Line 15:
# if needed restore your bachup to the /home directory
# if needed restore your bachup to the /home directory
Now your /home is in your root filesystem. Next:
Now your /home is in your root filesystem. Next:
|actions=
# 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>
Line 24: Line 23:
# build a new initramfs with <code>dracut -N</code>
# build a new initramfs with <code>dracut -N</code>
Now reboot your system.
Now reboot your system.
* while in grub replace the root=UUID=... parameter in the "linux" line by: root=LABEL=ROOTFS
# while in grub replace the root=UUID=... parameter in the "linux" line by: root=LABEL=ROOTFS
* boot your system.
# boot your system.
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!
* Edit your /etc/grub2.cfg file..
# Edit your /etc/grub2.cfg file..
* .. duplicate the first "menuentry ... { ...}" (about 15 lines).
# .. duplicate the first "menuentry ... { ...}" (about 15 lines).
* Now change the first one and replace the root=UUID=... parameter in the "linux" line by root=LABEL=ROOTFS
# Now change the first one and replace the root=UUID=... parameter in the "linux" line by root=LABEL=ROOTFS
* reboot again
# reboot again
|results=
|actions=
# All steps complete without errors
# All steps complete without errors
# reboot your system to see if it boots OK.
# reboot your system to see if it boots OK.
# do some other testing if you like.
# do some other testing if you like.
|results=
}}
}}

Revision as of 17:21, 10 October 2013


Description

/ on bcache (no LVM)

Now we have a stable system with /home on bcache, we can go forward and have / on bcache. Consider though that bcache is EXPERIMENTAL!

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

Setup

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

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/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 dracut -N

Now reboot your system.

  1. while in grub 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. Edit your /etc/grub2.cfg file..
  2. .. duplicate the first "menuentry ... { ...}" (about 15 lines).
  3. Now change the first one and replace the root=UUID=... parameter in the "linux" line by root=LABEL=ROOTFS
  4. reboot again

How to test

  1. All steps complete without errors
  2. reboot your system to see if it boots OK.
  3. do some other testing if you like.

Expected Results