fix storage
This commit is contained in:
90
docs/alpha/components/mhvtl/INSTALLATION.md
Normal file
90
docs/alpha/components/mhvtl/INSTALLATION.md
Normal file
@@ -0,0 +1,90 @@
|
||||
# mhvtl Installation and Configuration Guide
|
||||
|
||||
This guide details the steps to install and configure the `mhvtl` (Virtual Tape Library) on this system, including compiling from source and setting up custom paths.
|
||||
|
||||
## 1. Prerequisites
|
||||
|
||||
Ensure the necessary build tools are installed on the system.
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y git make gcc
|
||||
```
|
||||
|
||||
## 2. Download and Compile Source Code
|
||||
|
||||
First, clone the `mhvtl` source code from the official repository and then compile and install both the kernel module and the user-space utilities.
|
||||
|
||||
```bash
|
||||
# Create a directory for the build process
|
||||
mkdir /src/calypso/mhvtl_build
|
||||
|
||||
# Clone the source code
|
||||
git clone https://github.com/markh794/mhvtl.git /src/calypso/mhvtl_build
|
||||
|
||||
# Compile and install the kernel module
|
||||
cd /src/calypso/mhvtl_build/kernel
|
||||
make
|
||||
sudo make install
|
||||
|
||||
# Compile and install user-space daemons and utilities
|
||||
cd /src/calypso/mhvtl_build
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
## 3. Configure Custom Paths
|
||||
|
||||
By default, `mhvtl` uses `/etc/mhvtl` for configuration and `/opt/mhvtl` for media. The following steps reconfigure the installation to use custom paths located in `/opt/calypso/`.
|
||||
|
||||
### a. Create Custom Directories
|
||||
|
||||
Create the directories for the custom configuration and media paths.
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /opt/calypso/conf/vtl/ /opt/calypso/data/vtl/media/
|
||||
```
|
||||
|
||||
### b. Relocate Configuration Files
|
||||
|
||||
Copy the default configuration files generated during installation to the new location. Then, update the `device.conf` file to point to the new media directory. Finally, replace the original configuration directory with a symbolic link.
|
||||
|
||||
```bash
|
||||
# Copy default config files to the new directory
|
||||
sudo cp -a /etc/mhvtl/* /opt/calypso/conf/vtl/
|
||||
|
||||
# Update the Home directory path in the new device.conf
|
||||
sudo sed -i 's|Home directory: /opt/mhvtl|Home directory: /opt/calypso/data/vtl/media|g' /opt/calypso/conf/vtl/device.conf
|
||||
|
||||
# Replace the original config directory with a symlink
|
||||
sudo rm -rf /etc/mhvtl
|
||||
sudo ln -s /opt/calypso/conf/vtl /etc/mhvtl
|
||||
```
|
||||
|
||||
### c. Relocate Media Data
|
||||
|
||||
Move the default media files to the new location and replace the original data directory with a symbolic link.
|
||||
|
||||
```bash
|
||||
# Move the media contents to the new directory
|
||||
sudo mv /opt/mhvtl/* /opt/calypso/data/vtl/media/
|
||||
|
||||
# Replace the original media directory with a symlink
|
||||
sudo rmdir /opt/mhvtl
|
||||
sudo ln -s /opt/calypso/data/vtl/media /opt/mhvtl
|
||||
```
|
||||
|
||||
## 4. Start and Verify Services
|
||||
|
||||
With the installation and configuration complete, start the `mhvtl` services and verify that they are running correctly.
|
||||
|
||||
```bash
|
||||
# Load the kernel module (this service should now work)
|
||||
sudo systemctl start mhvtl-load-modules.service
|
||||
|
||||
# Start the main mhvtl target, which starts all related daemons
|
||||
sudo systemctl start mhvtl.target
|
||||
|
||||
# Verify the status of the main services
|
||||
systemctl status mhvtl.target vtllibrary@10.service vtltape@11.service
|
||||
```
|
||||
102
docs/alpha/components/mhvtl/mhvtl-Installation-Guide.md
Normal file
102
docs/alpha/components/mhvtl/mhvtl-Installation-Guide.md
Normal file
@@ -0,0 +1,102 @@
|
||||
|
||||
# mhvtl Installation and Configuration Guide for Ubuntu 24.04
|
||||
|
||||
## 1. Introduction
|
||||
|
||||
This guide provides step-by-step instructions for installing the mhvtl (Virtual Tape Library) from source on Ubuntu 24.04. The configuration files will be moved to a custom directory: `/opt/calypso/conf/mhvtl`.
|
||||
|
||||
**Disclaimer:** Installing `mhvtl` involves compiling a kernel module. This process is complex and can be risky. If your kernel is updated, you will need to recompile and reinstall the `mhvtl` kernel module. Proceed with caution and at your own risk.
|
||||
|
||||
## 2. Prerequisites
|
||||
|
||||
First, update your package lists and install the necessary build tools and libraries.
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y git build-essential lsscsi sg3-utils zlib1g-dev liblzo2-dev linux-headers-$(uname -r)
|
||||
```
|
||||
|
||||
## 3. Shell Environment
|
||||
|
||||
Ubuntu uses `dash` as the default shell, which can cause issues during the `mhvtl` compilation. Temporarily switch to `bash`.
|
||||
|
||||
```bash
|
||||
sudo rm /bin/sh
|
||||
sudo ln -s /bin/bash /bin/sh
|
||||
```
|
||||
|
||||
## 4. Download and Compile
|
||||
|
||||
### 4.1. Download the Source Code
|
||||
|
||||
Clone the `mhvtl` repository from GitHub.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/markh794/mhvtl.git
|
||||
cd mhvtl
|
||||
```
|
||||
|
||||
### 4.2. Compile and Install the Kernel Module
|
||||
|
||||
```bash
|
||||
cd kernel
|
||||
make
|
||||
sudo make install
|
||||
sudo depmod -a
|
||||
sudo modprobe mhvtl
|
||||
```
|
||||
|
||||
### 4.3. Compile and Install User-Space Daemons
|
||||
|
||||
```bash
|
||||
cd ..
|
||||
make
|
||||
sudo make install
|
||||
```
|
||||
|
||||
## 5. Configuration
|
||||
|
||||
### 5.1. Create the Custom Configuration Directory
|
||||
|
||||
Create the new configuration directory and move the default configuration files.
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /opt/calypso/conf/mhvtl
|
||||
sudo mv /etc/mhvtl/* /opt/calypso/conf/mhvtl/
|
||||
sudo rm -rf /etc/mhvtl
|
||||
```
|
||||
|
||||
### 5.2. Systemd Service Configuration
|
||||
|
||||
The `mhvtl` installation includes a systemd service file. We need to create an override file to tell the service to use the new configuration directory. The `mhvtl` service file typically uses an environment variable `VTL_CONFIG_PATH` to specify the configuration path.
|
||||
|
||||
```bash
|
||||
sudo mkdir -p /etc/systemd/system/mhvtl.service.d
|
||||
sudo bash -c 'cat > /etc/systemd/system/mhvtl.service.d/override.conf <<EOF
|
||||
[Service]
|
||||
Environment="VTL_CONFIG_PATH=/opt/calypso/conf/mhvtl"
|
||||
EOF'
|
||||
```
|
||||
|
||||
## 6. Starting and Verifying Services
|
||||
|
||||
Reload the systemd daemon, start the `mhvtl` services, and check their status.
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable mhvtl.target
|
||||
sudo systemctl start mhvtl.target
|
||||
sudo systemctl status mhvtl.target
|
||||
```
|
||||
|
||||
You can also use `lsscsi -g` to see if the virtual tape library is recognized.
|
||||
|
||||
## 7. Reverting Shell
|
||||
|
||||
After the installation is complete, you can revert the shell back to `dash`.
|
||||
|
||||
```bash
|
||||
sudo dpkg-reconfigure dash
|
||||
```
|
||||
|
||||
Select "No" when asked to use `dash` as the default shell.
|
||||
Reference in New Issue
Block a user