Arch Linux with an SSD Cache using LVM on BCache. Jeremy Runyan

Similar documents
NASA Lab. Partition/Filesystem/Bootloader. TinRay, Yu-Chuan

Adding a block devices and extending file systems in Linux environments

Manage your disk space... for free :)

How to Dual-Boot OS X and Ubuntu

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

CIS UNIX System Administration

Changing user login password on templates

BT Cloud Compute. Adding a Volume to an existing VM running Linux. The power to build your own cloud solutions to serve your specific business needs

(Ubuntu 10.04), the installation command is slightly different.

MFT / Linux Setup Documentation May 25, 2008

DUAL OS INSTALLATION

Turtles all the Way Down. Image 2013 CC-BY-NC-SA by Tony Gray

Ubuntu Manual Disk Partitioning Guide

Installation of Fedora 12 with CD

Ubuntu - How to Create Software RAID 1 in Ubuntu Linux - Tutorial

Lab E2: bypassing authentication and resetting passwords

Grub Manual Install Ubuntu Without >>>CLICK HERE<<<

ABOUT ZEPCAM SOFTWARE INSTALLATION MANAGEMENT AND BACKUPS. Description What is it Installation requirement Server requirement

Installation Guide for Beginners

Linux Kernel Update - from scratch (almost) Platform: Archlinux, UEFI, GRUB2, and initramfs. Prof. Rossano Pablo Pinto

Linux+ Guide to Linux Certification, Third Edition. Chapter 2 Linux Installation and Usage

Setting Up a Linux Operating System

This line defines Therefore, if your windows entry on the GRUB menu is 8 you should set this value to 7.

8 ISSUE 02 SPECIAL EDITION. Installing opensuse Ready to get started? This article shows you how to install opensuse from the disc

CompTIA Linux+ Guide to Linux Certification Fourth Edition. Chapter 2 Linux Installation and Usage

Manual File System Check Linux Command Line

Linux Systems Security. Backup and Change Management NETS Fall 2016

UUID and R1Soft. What is a UUID and what is it used for?

TinyNet. Creating Virtual Machines

Format Hard Drive After Install Ubuntu From Usb To Blank

CIS 191A Final Exam. Fall CIS 191 Final Exam

CST Algonquin College 2

This is Worksheet and Assignment 12. Disks, Partitions, and File Systems

Plexistor SDM User Guide

Manually Mount External Hard Drive Windows 7 Install

SAP HANA Restore Guide (for A2040c SLES) 22 nd of April 2016 NEC SAP Global Competence Center

Build your own NAS with OpenMediaVault

Manual Format Flash Drive Ntfs Windows Xp

File system manager. Single tool to manage your storage. Red Hat. October 24, 2011

iscsi storage is used as shared storage in Redhat cluster, VMware vsphere, Redhat Enterprise Virtualization Manager, Ovirt, etc.

Disks, Filesystems, Booting Todd Kelley CST8177 Todd Kelley 1

Guideline for the installation of C-MOR Video Surveillance Virtual Machine on VMware ESX Server

Linux Manually Mount External Hard Drive Ntfs-3g Could Not

NVDIMM Overview. Technology, Linux, and Xen

SSD Bay U.2 NVMe RAID Enclosure. User Guide V1.00

Installing caos with Cinch on Floppy Disk

How To Reinstall Grub In Windows 7 With Cd Bootcamp Partition

Manual Install Ubuntu Alongside Windows 7 Using Usb

SSD7120. NVMe U.2 RAID Controller. User Guide V1.00

An introduction to Logical Volume Management

Windows 7 Manual Partition Manager Ware Full Version

Linux Hardware Management. Linux System Administration COMP2018 Summer 2017

Course 55187B Linux System Administration

SAP HANA Restore Guide (for A2040d SLES) 23 rd of January 2017 NEC SAP Global Competence Center

Linux Files and the File System

Manual Install Ubuntu Server From Usb Drive

Freeing Disk Space on a Cryptshare Server. Applies to. Purpose. Solution. Freeing Disk Space on a Cryptshare Server. Situation.

environment) and note down the last "End" sector ( as shown in the below example):

Manually Mount Usb Flash Drive Linux Command Line Redhat

Windows Method Using Linux Live CD and Gparted

Ubuntu (Intrepid-Ibex) Installation Manual

Control Center Planning Guide

Managing Disks. Managing Disks in the Cluster. Disk Requirements

Installation Manual. GIT for Industry. Smart DCC Ltd. v1.0 (Draft) 2015/06/29

Sun VirtualBox Installation Tutorial

Fedora Linux Installation Guide

Linux Manually Mount External Hard Drive Ntfs 3g Could Not

Manually Mount Usb Device Linux Command Line Ubuntu 12.04

exam.30q. Number: Passing Score: 800 Time Limit: 120 min File Version: 1 LPI

SSD7101A-1. 4x M.2 Port to PCIe 3.0 x16 NVMe RAID Controller. User Guide V1.00

SLES Linux Installation Guide

Rocket RAID 2644 SAS Controller opensuse Linux Installation Guide

Control Center Planning Guide

Configuring USB 3.0 SSD

How to Back-Up a fit-pc2 Using Only a USB Stick (and some creative partitioning)

RocketRAID 2522 SATA Controller Ubuntu Linux Installation Guide

Back Up (And Restore) LVM Partitions With LVM Snapshots

Recovering GRUB: Dual Boot Problems and Solutions

Enterprise Volume Management System Project. April 2002

Disks, Filesystems Todd Kelley CST8177 Todd Kelley 1

System Administration. Storage Systems

2018/01/30 18:11 1/6 Disks Management HDD Management. Disks must be added before they can be formatted and mounted or configured in a RAID array.

Linux Filesystems Ext2, Ext3. Nafisa Kazi

v5: How to restore a backup image

A. Windows 7 and USB driver installation

Univention Corporate Server. Extended installation documentation

EX200.redhat

Error Creating Partition Table Helper Exited With Exit Code 1

Manually Mount Usb Flash Drive Ubuntu Server

Some reasons to repair your boot-loader might include installing Microsoft Windows after you have installed Ubuntu, adding or removing a hard drive.

Arch Linux Grub You Need To Load The Kernel First

Getting Started with Linux

2018/04/11 18:35 (UTC) 1/13 UEFI dual or more boot using refind

For personnal use only

Privacy and Security in Online Social Networks Department of Computer Science and Engineering Indian Institute of Technology, Madras

Linux Manually Mounting External Hard Drive Mac Terminal

CST8207: GNU/Linux Operating Systems I Lab Nine Disks, Partitions, and File Systems Part 2. Disks, Partitions, and File Systems - Part 2 of 2

Android Bootloader and Verified Boot

EX200.exam.35q. Number: EX200 Passing Score: 800 Time Limit: 120 min. EX200. Red Hat Certified System Administrator RHCSA

RocketRAID 231x/230x SATA Controller Debian Linux Installation Guide

Transcription:

Arch Linux with an SSD Cache using LVM on BCache Jeremy Runyan 1

Table of Contents Introduction 3 Materials. 3 Prepare.... 4 Create Partitions.. 4-6 Format and Mount Partitions.. 6 Install Arch Linux. 7-8 Glossary 9 References.. 10 List of Illustrations i Sample Starting Partition Setup 5 ii Sample Complete Partition Setup. 6 iii Good Output from mkinitcpio. 7 iv Final Working Result.. 8 About Jeremy Runyan Jeremy Runyan is a Computer Science Major at Colorado State University in Fort Collins, Colorado. Computers are a passion for him and he spends a great deal of his time tinkering with them. He has been an avid Linux user for over 6 years and during that time he has used a variety of Linux distributions including Ubuntu and (currently) Arch Linux. 2

Introduction: This is a guide for Arch Linux power users. It is assumed that the reader is familiar with the Arch Linux install process. Once this setup is complete the user will have a fully functioning Arch Linux environment that is backed by a larger HDD with a smaller but faster SSD cache. In many modern operating systems, to get this same setup one would have to purchase expensive software or use RAID technologies that become attached to the motherboard that they were installed on. This guide offers a simple, fast, and robust setup that will migrate wherever the Arch Linux setup may need to as it will not be attached to any motherboard or outdated software. Furthermore, if the Arch Linux user ever wants to add even more data to the setup this only requires a few commands to BCache, LVM, and the user s file system of choice. (This is not covered in this how to.) Materials: At least one HDD for the data backing At least one SSD (or faster drive) for the cache Computer fully capable of running Arch Linux Disk with Arch Linux ISO Flash Drive >1MB 3

Prepare 1. Go into the Arch Linux User Repository and build the BCache Tools package. https://aur.archlinux.org/packages/bcache-tools/ 2. Copy the built package onto the flash drive. 3. Start up the computer using the Arch Linux install disk no extra kernel options or special settings are needed to boot. 4. Install bcache-tools 1. Insert flash drive with bcache-tools and find out what device your is located. One way to do this is lsblk 2. Before installing the package run pacman -Sy to update the package dependency list so bcache-tools can install. 3. Mount the drive and install the bcache-tools package using pacman -U /path/to/package Ignore the errors that are output. This is alright because all that is needed are the tools and the bcache kernel module is enabled in Arch ISO by default. Create Partitions Warning be extra careful in this step. Using the wrong drives could mean needing restarting the install process from the beginning. 1. Create partition tables and delete preexisting partitions for the SSD s and HDD s if necessary. Warning this will destroy all data on these drives! 2. Choose one SSD to be the boot partition and make a boot partition of 500MB. 4

3. The rest of that SSD and all other devices (HDD s and SDD s) will get a partition taking up the full space. These partitions will belong to BCache. Figure 1: Sample partitioning in a VM. Sda is the HDD and Sdb is the SSD. Sdb1 is the boot partition. Sdb2 is the cache partition. 4. Inform bcache of the partitions, instruct bcache to create bcache partitions, and link them together all in a single command. make-bcache -B /dev/backing1 /dev/backing2 -C /dev/cache1 /dev/cache2 If successful, you will get an output with a few UUIDs of the bcache partitions. Furthermore, you will now see a new device: /dev/bcache0. This is the new cache enabled device. 5. Make an LVM partition setup from /dev/bcache0. 1. Create physical LVM volume pvcreate /dev/bcache0 2. Create a volume group. In this example Arch is chosen as the physical group name. vgcreate Arch /dev/bcache0 3. Create swap logical volume. Change 1G to the desired swap size lvcreate -L 1G Arch -n Swap 4. Create root partition. This command will use all remaining space. This may not be suitable for users who want to make use of lvm s partition 5

imaging features or create more partitions after the install. lvcreate -l 100%FREE Arch -n Root 5. These new partitions should now be visible under /dev/arch/ and under /dev/mapper/ Figure 2: If the previous steps were successful, you will be a partition scheme similar to this one shown in a sample VM. Format and Mount Partitions 1. Choose a filesystem to use for root and the boot partition. Ext4 and ext2 are suggested respectively. 2. Format boot partition: mkfs.ext2 /dev/bootpartition 3. Format root partition: mkfs.ext4 /dev/arch/root 4. Create swap partition: mkswap /dev/arch/swap 5. Mount the partitions as per usual in an Arch Install in /mnt/ and /mnt/boot 6. Activate the swap partition. 7. Check results using mount -l and free -h 6

Install Arch Linux 1. Install Arch Linux as normal. It is expected that a power Arch Linux user can do this on their own. If any help is needed see here: https://wiki.archlinux.org/index.php/installation_guide When it comes time to install the bootloader proceed to the following instructions. 2. Install the bcache-tools package in the new Arch Linux install. 3. Edit /etc/mkinitcpio.conf and add bcache to the list of modules. Add bcache lvm2 in that order to the list of hooks before filesystems but after block. (WARNING: The exact placement here is critical!) This is so linux knows how to read the BCache and LVM partitions. Figure 3: Good output of mkinitcpio. 7

4. Regenerate the Linux image in /boot/: mkinitcpio -p linux If successful there will be no errors. (A few warnings is likely fine.) 5. Install grub pacman -S grub 6. Edit /etc/default/grub and add root=/dev/path/to/root/device that way Linux knows where to find the root partition because it needs it early on. 7. Install grub to the disk that has the boot partition: grub-install --recheck /dev/sdx 8. Write grub s configuration files to the boot partition: grub-mkconfig -o /boot/grub/grub.cfg 9. Reboot. If all went well your new cache enabled Arch Linux install will boot and it is ready for tinkering. Figure 4: Arch Linux with a virtual SSD cache and a virtual HDD running successfully in a VM. 8

Glossary BCache: A driver for Linux that is used to combine a set of backing devices and set of caching devices to made a single addressable device. LVM: Stands for Logical Volume Manager. It is a method/driver in Linux to split single or many partitions across devices into many partitions for convenience. Furthermore, it allows adding partitions on the fly and smart partition image management regardless of the file system that was chosen for a particular partition. Backing Device: Stores all of the data of a computer. These devices are typically HDD s and have more space for user data. Caching Device: Stores recently used data of a computer for quick access. This devices are typically SSD s and have smaller, more expensive, but faster data storage. 9

References "Installation Guide." Installation Guide. ArchWiki, n.d. Web. 20 Feb. 2017. <https://wiki.archlinux.org/index.php/installation_guide>. "LVM." LVM. ArchWiki, n.d. Web. 20 Feb. 2017. <https://wiki.archlinux.org/index.php/lvm>. "Bcache." Bcache. ArchWiki, n.d. Web. 20 Feb. 2017. <https://wiki.archlinux.org/index.php/bcache>. 10