Skip to content

Installation steps of kvdo + vdo on Debian 11(.4) #64

@tigerblue77

Description

@tigerblue77

Hello everyone,

I create this clean new issue following a bug solved in previous one + clean version of Debian's installation script.
I wrote this little script to install kvdo + vdo on Debian 11(.4) (tested with 5.10.0-14-amd64 Linux kernel)

install_dependencies() {
    (( ${#} > 1 )) && {
        apt update && \
        apt install -y "$@"
    } || echo "No dependency to install"
}

clean_dependencies() {
    (( ${#} > 1 )) && {
        apt autoremove --purge -y "$@"
    } || echo "No dependency to remove"
}

clone_repo() {
    (( ${#} == 1 )) && {
        local TEMPORARY_DIRECTORY=$(mktemp -d "/tmp/${1/*\/}.XXX") && \
        git clone "$1" "${TEMPORARY_DIRECTORY}" && \
        cd "${TEMPORARY_DIRECTORY}" && \
        pwd -P
    }
}

# Usage: clean $WORK_DIRECTORY $DEPENDENCIES $OTHERS $...
clean() {
    (( ${#} >= 1 )) && {
        clean_dependencies "${*:2}" > /dev/null 2>&1 &
        rm -Rf "$1" &
        wait
    }
}

# First part : KVDO module
DEPENDENCIES="make linux-headers-$(uname -r)"
install_dependencies $DEPENDENCIES dkms > /dev/null 2>&1
KVDO_module_version_to_install="8.2.1.2.fixed"
KVDO_ARCHIVE_NAME="kvdo.tar.gz"
KVDO_ARCHIVE_PATH="/tmp/$KVDO_ARCHIVE_NAME"
KVDO_MODULE_PATH="/usr/src"
wget -O $KVDO_ARCHIVE_PATH "https://github.com/tigerblue77/kvdo/archive/refs/tags/$KVDO_module_version_to_install.tar.gz" && \
tar -xf $KVDO_ARCHIVE_PATH -C $KVDO_MODULE_PATH

echo "PACKAGE_NAME=\"kvdo\"
PACKAGE_VERSION=\"$KVDO_module_version_to_install\"
AUTOINSTALL=\"yes\"

BUILT_MODULE_NAME[0]=\"kvdo\"
BUILT_MODULE_LOCATION[0]=\"vdo\"
DEST_MODULE_LOCATION[0]=\"/kernel/drivers/block/\"
STRIP[0]=\"no\"" > "$KVDO_MODULE_PATH/kvdo-$KVDO_module_version_to_install/dkms.conf"
dkms add "kvdo/$KVDO_module_version_to_install"
dkms build "kvdo/$KVDO_module_version_to_install"
dkms install "kvdo/$KVDO_module_version_to_install"

clean $DEPENDENCIES $KVDO_ARCHIVE_PATH

# Second Part: VDO Module
DEPENDENCIES="git make gcc uuid-dev libz-dev libdevmapper-dev libblkid-dev"
install_dependencies $DEPENDENCIES > /dev/null 2>&1
WORK_DIRECTORY="$(clone_repo https://github.com/dm-vdo/vdo.git)"
(
    cd "${WORK_DIRECTORY}" && \
    make -j"$(nproc)" && \
    make -j"$(nproc)" install
) > vdo_build.log 2>&1
clean "${WORK_DIRECTORY}" $DEPENDENCIES

depmod --quick

VDO's part questions (second part) :
- Can anyone tell me if lines 32-34 are needed ?
- Don't hesitate to suggest any improvment !

  • Once improved, maybe we could add this script to repository's README.md ?

I tested this script with the following LVM volume creation script :

pvcreate /dev/sdb
vgcreate vgdo /dev/sdb
# I set the slab size to 8GB because my server will have between 20 to 60TB of usable space
lvcreate --type vdo --name vdolv --extents 100%VG --virtualsize 100G --config 'allocation/vdo_slab_size_mb=128' vgdo
mkfs.ext4 -E nodiscard /dev/vgdo/vdolv

# If you want your VDO volumes to mount successfully at next boot :
# 1. add necessary /etc/fstab entries
MOUNTPOINT="/mnt/vdolv"
echo "/dev/vgdo/vdolv   $MOUNTPOINT  ext4    defaults    0   0" >> /etc/fstab
# 2. Run the following command :
echo -e "\tevent_activation = 0" >> /etc/lvm/lvm.conf
# 3. Create mount point directory
mkdir $MOUNTPOINT

lvs
lsblk

# List errors :
journalctl -p 3 -xb

I wrote this script with help of those forum topics :

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions