Giter Site home page Giter Site logo

systemd-ephemeral-drives's Introduction

systemd-ephemeral-drives

Systemd thinks it knows best, and getting ephemeral data partitions correctly configured isn't a single command.

This is based off of some work from bhuisgen put together with a much more focused purpose. Scripts have been refactored and any unnecessary cruft for the use case has been eliminated. The instructions are basically the same to get started.

Dependencies

# apt install make parted lvm2

If you have multiple ephemeral disks, you can use software RAID to increase IO performance:

# apt install mdadm

## ephemeral-disk

This script prepares the ephemeral disks of an EC2 instance at each system boot by creating a swap partition (if enabled in configuration) and a data partition wich will be mounted in the directory /mnt/data. If the partitions are already created, nothing is done except mounting them. After mounting, the service starts by dependency all required services.

LVM is used like this:

  • a LVM volume group ephemeral of all disks
  • a LVM logical volume swap for the swap partition
  • a LVM logical volume data for the data partition

The LVM volume group will have sufficient free space to allow snapshot creation and backup with the script ephemeral-backup.

Installation

# cd ephemeral-disk/

# cp ephemeral-disk.dist ephemeral-disk
# vim ephemeral-disk

# cp ephemeral-units.service.dist ephemeral-units.service
# vim ephemeral-units.service

# make install

### Usage

Start the ephemeral disk services:

# make enable
# make start
# lvs
# cd /mnt/data

To be sure verify your bootorder after a system restart:

# systemd-analyze plot > bootorder.svg

The unit ephemeral-units.service must be started before all units using the ephemeral storage.

systemd-ephemeral-drives's People

Contributors

jeredding avatar

Stargazers

Luis Jesús Díaz avatar

Watchers

James Cloos avatar  avatar

Forkers

salekseev kgutwin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.