Giter Club home page Giter Club logo

kamino's Introduction

Kamino

About

Kamino is an integrity-based disk imaging utility for Linux.

Kamino Screenshot

Features

  • Drive-To-Drive Cloning
  • Capture Image File from Drive
  • Deploy Image File to a Single Drive
  • Deploy Image File to Multiple Drives Simultaneously
  • Wipe a Single Drive
  • Wipe Multiple Drives Simultaneously
  • Automated Integrity Checking of Image Files
  • Image File Manager

Compatibility

Operating System

Kamino is written in bash and will run on most modern Linux distributions with a kernel version of 2.6 or higher. Kamino relies mainly on dd, gzip, and sha256sum which are bundled with most distros. Kamino has been verified to work on Ubuntu 16.04 thru 18.04, Arch, Debian, RHEL 6.7, and Fedora 25 but will likely run on many others.

Supported Devices

Kamino supports most block devices such as USB Drives, SATA HDDs and SSDs, SD Cards, etc. The rule of thumb is if it shows up under /dev as sda through sdz, the device will most likely be supported. Optical devices (CD/DVD/BD) are not supported at this time.

Installation

Step 1: Download the latest Kamino tarball from the release folder.

Step 2: Verify the integrity of the Kamino tarball by running the following command and comparing the output to the expected hash totals:

sha256sum kamino-1.x.y.tgz (where x.y corresponds to the version that you downloaded)

If the sha256sum output matches the expected hash totals, proceed to Step 3.

Step 3: Extract the tarball with the following command:

tar -xzvf kamino-1.x.y.tgz -C <destination directory>(where x.y corresponds to the version that you downloaded)

This will create a folder titled "kamino" inside the <destination directory>

Example: tar -xzvf kamino-1.0.1.tgz -C /home/mike

Usage

Running Kamino

From a terminal, cd into the "kamino" folder. Execute kamino via sudo or as root:

sudo ./kamino

Kamino will start and you will be brought to the Main Menu.

Main Menu Screenshot

Important: On your first run of Kamino, make sure you set the directory you'd like to use for image files via "Manage Images" by entering m into the Main Menu selection followed by c to configure the directory.

Note: If you cloned this repo and are running Kamino from the src directory, make sure the execute bit is set for the scripts:

cd kamino
chmod +x kamino
chmod +x res/scripts/*

Capture Image

Enter 1 into the Main Menu selection to capture an image of a drive attached to the system.

A list of available drives will be displayed. Choose a source drive by entering the corresponding number into the selection prompt. In the example below, /dev/sdg is selected by entering 5

Capture Image Screenshot 1

Enter a name for the image file. Do not include any file extensions since .img.gz will be automatically appended. In the example below, the name raspberry-pi-backup is entered.

Capture Image Screenshot 2

The command to capture the image will be displayed based off of your input from the previous steps. Carefully review the output from this screen and enter y to begin the image capture process.

Capture Image Screenshot 3

Capturing a drive image can take anywhere from a minute to many hours depending on the size of the drive and the speed of your hardware. During the image capture process, the dd status output will display to show the progress.

Capture Image Screenshot 4

When the image capture is complete, a sha256sum will be generated and saved as <image_name>.img.gz.sha256 in your images_directory. Press enter to return to the main menu.

Capture Image Screenshot 5

Clone Drive

Enter 2 into the Main Menu selection to clone one drive directly to another.

A list of available drives will be displayed. Choose a source drive by entering the corresponding number into the selection prompt. In the example below, /dev/sdb is selected by entering 2

Clone Drive Screenshot 1

Next, choose a target drive by entering the corresponding number into the selection prompt. In the example below, /dev/sdc is selected by entering 2

Clone Drive Screenshot 2

The command to clone the drive will be displayed based off of your input from the previous steps. Carefully review the output from this screen and enter y to begin the drive cloning process.

Clone Drive Screenshot 3

Cloning one drive to another can take anywhere from a minute to many hours depending on the size of the drive and the speed of your hardware. During the drive cloning process, the dd status output will display to show the progress.

Clone Drive Screenshot 4

When the drive clone is complete an !!!INFO!!! message will display. Press enter to return to the main menu.

Clone Drive Screenshot 5

Deploy Image (Single Drive)

Enter 3 into the Main Menu selection to deploy an image file to a single target drive.

A list of available images from your images_directory will be displayed. Choose a source image by entering the corresponding number into the selection prompt. In the example below, the ubuntu_laptop-20190103.img.gz image file is selected by entering 2

Deploy Image Screenshot 1

Next, choose a target drive that you wish to deploy the image to by entering the corresponding number into the selection prompt. In the example below, /dev/sdc is selected by entering 3

Deploy Image Screenshot 2

An integrity check will be performed on the selected image file by running sha256sum and ensuring the output matches the original hash total of the image. If the integrity check passes, the command to deploy the image will be displayed based off of your input from the previous steps. Carefully review the output from this screen and enter y to begin the image deploy process.

Deploy Image Screenshot 3

Deploying an image file to a drive can take anywhere from a minute to many hours depending on the size of the image file and the speed of your hardware. During the image deploy process, the dd status output will display to show the progress.

Deploy Image Screenshot 4

When the image deploy is complete an !!!INFO!!! message will display. Press enter to return to the main menu.

Deploy Image Screenshot 5

Deploy Image (Multi-Drive)

Enter 4 into the Main Menu selection to deploy an image file to multiple target drives at the same time.

Note: For multi-drive operations, the target drives you select must all be the same size.

A list of available images from your images_directory will be displayed. Choose a source image by entering the corresponding number into the selection prompt. In the example below, the ubuntu_laptop-20190103.img.gz image file is selected by entering 2

Multi Deploy Screenshot 1

Next, choose two or more target drives that you wish to deploy the image to by entering the corresponding numbers into the selection prompt. Your input should be comma-separated with no spaces. In the example below, /dev/sdb, /dev/sdc, and /dev/sdd are selected by entering 2,3,4

Multi Deploy Screenshot 2

An integrity check will be performed on the selected image file by running sha256sum and ensuring the output matches the original hash total of the image. If the integrity check passes, the command to deploy the image will be displayed based off of your input from the previous steps. Carefully review the output from this screen and enter y to begin the image deploy process.

Multi Deploy Screenshot 3

Deploying an image file to multiple drives can take anywhere from a minute to many hours depending on the size of the image file and the speed of your hardware. During the image deploy process, the dd status output will display to show the progress.

Multi Deploy Screenshot 4

When the image deploy is complete an !!!INFO!!! message will display. Press enter to return to the main menu.

Multi Deploy Screenshot 5

Zeroize (Single Drive)

Enter 5 into the Main Menu selection to wipe a single target drive by writing all zeroes.

A list of available drives will be displayed. Choose a drive to wipe by entering the corresponding number into the selection prompt. In the example below, /dev/sdd is selected by entering 4

Zeroize Screenshot 1

The command to wipe the drive will be displayed based off of your input from the previous step. Carefully review the output from this screen and enter y to begin the drive wipe process.

Zeroize Screenshot 2

Wiping a drive can take anywhere from a minute to many hours depending on the size of the drive and the speed of your hardware. During the wiping process, the dd status output will display to show the progress.

Zeroize Screenshot 3

When the drive wipe is complete an !!!INFO!!! message will display. Press enter to return to the main menu.

Zeroize Screenshot 4

Zeroize (Multi-Drive)

Enter 6 into the Main Menu selection to wipe multiple target drives at the same time by writing all zeroes.

Note: For multi-drive operations, the target drives you select must all be the same size.

A list of available drives will be displayed. Choose two or more drives to wipe by entering the corresponding numbers into the selection prompt. Your input should be comma-separated with no spaces. In the example below, /dev/sdb, /dev/sdc, and /dev/sdd are selected by entering 2,3,4

Multi Zeroize Screenshot 1

The command to wipe the drives will be displayed based off of your input from the previous step. Carefully review the output from this screen and enter y to begin the drive wipe process.

Multi Zeroize Screenshot 2

Wiping multiple drives can take anywhere from a minute to many hours depending on the size of the drives and the speed of your hardware. During the wiping process, the dd status output will display to show the progress.

Multi Zeroize Screenshot 3

When the drive wipe is complete an !!!INFO!!! message will display. Press enter to return to the main menu.

Multi Zeroize Screenshot 4

Manage Images

Enter m into the Main Menu selection to manage images and configure which directory you would like to use for image files.

Manage Images Screenshot 1

Enter c into the prompt to configure the images directory for Kamino. In the example below, the directory /home/mike/images is entered.

Note: A trailing slash / at the end of the path is not necessary.

Manage Images Screenshot 2

Choose an image to manage by entering the corresponding number into the selection prompt. In the example below, the raspberry-pi-backup.img.gz image file was selected by entering 3 from the Manage Images screen.

Manage Images Screenshot 3

Enter v into the prompt to manually verify the integrity of the image file.

Manage Images Screenshot 4

Enter d into the prompt to delete the image file.

Manage Images Screenshot 5

About Kamino

Enter a into the Main Menu selection to see information about Kamino.

Exiting Kamino

Enter q into the Main Menu selection to exit Kamino.

kamino.config

The kamino.config file is located under the kamino/res directory. The various options (and defaults) are described below.

Note: the images_directory option should be set via "Manage Images" within Kamino. All others can be edited in this file directly.

# Block size which is utilized for dd operations
# Default: 64K
block_size 64K

# Directory where image files are stored
images_directory /path/to/images

# Directory where temporary pids are stored 
# Default: /tmp
tmp_directory /tmp

# gzip compression level [1-9]
# Default: 6
# 1 = fastest, lowest compression (produces largest image files)
# 9 = slowest, highest compression (produces smallest image files)
compression_level 6

License

Kamino Copyright (C) 2019 Mike Del Pozzo

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

See LICENSE for details.

kamino's People

Contributors

delpozzo avatar

Watchers

 avatar

kamino's Issues

Cloning to a drive of smaller capacity

Need to add a restriction that prohibits the user from cloning a drive to one of smaller capacity. For example, Kamino will currently let you clone a 512GB drive to a 128GB one. The dd command will start but will only copy over the first 128GB leading to an incomplete clone.

The dd command finishes immediately without doing anything

In some rare cases the dd command appears to start and finish immediately without actually doing anything. I've narrowed this down to the target or source drive not being "spun up" / "woken up" before dd starts. I think I have a working fix, testing now and will publish an update soon.

Bug on some Red Hat systems

On certain Red Hat systems (including CentOS), Kamino is unable to determine where the rootfs is mounted to. As a result, Kamino doesn't enumerate the drives connected to the system correctly. I'll hopefully have a fix for this shortly, but in the meantime a workaround is to set protect_root_filesystem to no in kamino.config.

Multi-scripts don't check for equal drive size

I need to add a check for equal drive sizes in deployImageMulti and zeroizeDriveMulti. Right now Kamino will let you do multi-drive operations on drives of mismatched sizes. This can be unstable in some circumstances and is not recommended.

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.