From 41ee154d2ce7fcd1170cc2a343b12875fa802df2 Mon Sep 17 00:00:00 2001 From: asche <47307281+asche77@users.noreply.github.com> Date: Thu, 8 Apr 2021 21:38:46 +0200 Subject: [PATCH] Update INSTALL.md Add installation instructions for OmniOS; cleaned up description somewhat. --- INSTALL.md | 88 +++++++++++++++++++++++------------------------------- 1 file changed, 38 insertions(+), 50 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index dd65501..72fed7b 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -171,10 +171,9 @@ For Alpine Linux this can be done with: `apk --no-cache add procps` - ## OmniOS / Illumos based distributions -Used with OmniOS r34, r36 and r37 with napp-it installed. Hence, we presume you have a standard perl installation etc. +Used with OmniOS r34, r36 and r37 (with napp-it installed). Hence, we presume you have a standard perl installation etc. 1. Install prerequisites: Perl module Config::IniFiles, ssh, pv, gzip, lzop, and mbuffer @@ -184,83 +183,72 @@ pfexec pkg install openssh gzip mbuffer pipe-viewer # include OpenCSW repository pfexec pkg set-publisher -G '*' -g https://sfe.opencsw.org/localhostomnios localhostomnios -# install LZOP from OpenCSW +# install LZOP (from OpenCSW) pfexec pkg install lzop # install Perl modules -# do this as root -perl -MCPAN -e shell - -install CPAN ## update CPAN -reload cpan ## reload - -install inc::latest ## not sure if required -install IO::Scalar ## not sure if required -install Config::IniFiles -install Capture::Tiny -install Data::Dumper ## not sure if required, may be installed already -install File::Path ## not sure if required, may be installed already -install Getopt::Long ## not sure if required -install Pod::Usage ## not sure if required -install Time::Local ## not sure if required -exit -``` -Optionally, to update your perl installation (use with care!): +pfexec perl -MCPAN -e shell + install CPAN ## update CPAN + reload cpan ## reload -```# OPTIONALLY install cpanm (CPAN Minus) and cpan-outdated -# do this as root -curl -L http://cpanmin.us | perl - --sudo App::cpanminus -/usr/perl5/5.32/bin/cpanm App::cpanoutdated -# update using cpanm / cpan-outdated -# do this as root -/usr/perl5/5.32/bin/cpan-outdated -p | /usr/perl5/5.32/bin/cpanm + install inc::latest ## not sure if required + install IO::Scalar ## not sure if required + install Config::IniFiles + install Capture::Tiny + install Data::Dumper ## not sure if required, may be installed already + install File::Path ## not sure if required, may be installed already + install Getopt::Long ## not sure if required + install Pod::Usage ## not sure if required + install Time::Local ## not sure if required + exit ``` -2. Download the Sanoid repo: +2. Download and clone the Sanoid repo: ``` -# do this as root # install git pfexec pkg install git -# Download the repo as root to avoid changing permissions later + +# Tip: download the repo as root to avoid changing permissions later pfexec git clone https://github.com/jimsalterjrs/sanoid.git cd sanoid + # checkout latest stable release or stay on master for bleeding edge stuff (but expect bugs!) pfexec git checkout $(git tag | grep "^v" | tail -n 1) -# patch syncoid re: regexp check for zfs resume (https://github.com/jimsalterjrs/sanoid/issues/554) + +# patch syncoid, so that it correctly recognises the "zfs resume" capability under OmniOS (see https://github.com/jimsalterjrs/sanoid/issues/554) << $avail{'sourceresume'} = system("$sourcessh $resumechkcmd $srcpool 2>/dev/null | grep '\\(active\\|enabled\\)' >/dev/null 2>&1"); >> $avail{'sourceresume'} = system("$sourcessh $resumechkcmd $srcpool 2>/dev/null | grep -E '^(active|enabled)' >/dev/null 2>&1"); << $avail{'targetresume'} = system("$targetssh $resumechkcmd $dstpool 2>/dev/null | grep '\\(active\\|enabled\\)' >/dev/null 2>&1"); >> $avail{'targetresume'} = system("$targetssh $resumechkcmd $dstpool 2>/dev/null | grep -E '^(active|enabled)' >/dev/null 2>&1"); -# Install the executables + +# most likely not required, but make the executables eXecutable +pfexec chmod +x sanoid syncoid findoid sleepymutex + +# Install the executables into /opt/sanoid pfexec mkdir /opt/sanoid pfexec cp sanoid syncoid findoid sleepymutex /opt/sanoid -# link executables to path -pfexec ln -s /opt/sanoid/sanoid /usr/bin/sanoid & pfexec ln -s /opt/sanoid/syncoid /usr/bin/syncoid & pfexec ln -s /opt/sanoid/findoid /usr/bin/findoid & pfexec ln -s /opt/sanoid/sleepymutex /usr/bin/sleepymutex + +# add symbolic links to executables to a directory in $path +pfexec ln -s /opt/sanoid/sanoid /usr/bin/sanoid & pfexec ln -s /opt/sanoid/syncoid /usr/bin/syncoid & pfexec ln -s /opt/sanoid/findoid /usr/bin/findoid & pfexec ln -s /opt/sanoid/sleepymutex /usr/bin/sleepymutex ``` -3. Create the config directory /etc/sanoid and put sanoid.defaults.conf in there, and create sanoid.conf in it too: +3. Create the config directory /etc/sanoid, put default sanoid files there, and create and edit sanoid.conf: ```# Create the config directory pfexec mkdir /etc/sanoid -# Install default config -pfexec cp sanoid.defaults.conf /etc/sanoid + +# Copy default config and sample config +pfexec cp sanoid.defaults.conf sanoid.conf /etc/sanoid/sanoid.example.conf + # Create a blank config file pfexec touch /etc/sanoid/sanoid.conf -# Place the sample config in the conf directory for reference -pfexec cp sanoid.conf /etc/sanoid/sanoid.example.conf -## ... and do not forget to edit the empty(!) sanoid.conf file! (we are using nano as editor): +## and edit it (using e.g. nano as editor): pfexec nano /etc/sanoid/sanoid.conf ``` -4. Set up SSH connections between two remote hosts - - # missing !!!!!!!!!!!!!!!! - -5. Create a cron job or a systemd timer that runs sanoid --cron once per [every 30 min] - - # missing !!!!!!!!!!!!!!!! - - napp-it --> Jobs --> Other --> Create Other Job "/usr/bin/sanoid --cron --quiet" +Further steps (not OmniOS specific): +- set up SSH connections between two remote hosts +- create a cron job that runs sanoid --cron --quiet periodically ## Other OSes