Create Hive FS archive failed or FS size too small

I’m trying to use Deploy PXE following the instructions on the page forum. hiveos. farm/t/ hive-os-deploy-pxe/12444 … (I separated the links with spaces because new users here on the forum can only post 2 links in the threads)

The installation was successful but I’m having problems running hive-upgrade.sh, the text output of the run follows:

guilhermep96@debianproxmoxgp96:/pxeserver$ sudo ./pxe-config.sh
[sudo] senha para guilhermep96:
Install needed package. Plese wait
Done

Workers config
FARM_HASH: ****************************************************
Press ENTER to continue with this FARM_HASH or type a new one

Hive server URL: http://api. hiveos. farm
Press ENTER to continue with this URL or type a new one

++++++++++++++++++
Server config
Hive repo URL: http:// download. hiveos. farm/ repo/ binary/
Press ENTER to continue with this URL or type a new one

Current server IP-address: 192.168.1.17
Press ENTER to continue with this IP-address or type a new one

TMPFS size: 1300 Mb
Press ENTER to continue with this TMPFS size or type a new one (in MB)
8096
New TMPFS size: 8096 Mb
FS archive name: hiveramfs.tar.xz
Press ENTER to continue with this FS archive name or type a new one

Config complete
++++++++++++++++++
net.core.somaxconn = 65535

Restart DNSMASQ server. OK
Restart Nginx server. OK
Restart Atftp server. OK
grub-mkimage: erro: não foi possível abrir ‘/usr/lib/grub/x86_64-efi//moddep.lst’: Arquivo ou diretório inexistente.

Server ready to work

Do you want to upgrade HiveOS [Y/n]?y

Upgrading HiveOS FS

Extract Hive FS to tmp dir
353MiB 0:31:59 [ 188KiB/s] [========================================================================>] 100%

Chrooting to Hive FS

root@debianproxmoxgp96:/# export PATH="./:/hive/bin:/hive/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
root@debianproxmoxgp96:/# echo “deb http :// download. hiveos. farm/repo/binary/ /” > /etc/apt/sources.list.d/hiverepo.list
root@debianproxmoxgp96:/# apt update
Hit:1 http :// security. ubuntu. com/ubuntu bionic-security InRelease
Hit:2 http :// archive. ubuntu. com/ubuntu bionic InRelease
Hit:3 http :// archive. ubuntu. com/ubuntu bionic-updates InRelease
Hit:4 http :// archive. ubuntu. com/ubuntu bionic-backports InRelease
Get:5 http :// download. hiveos. farm/repo/binary InRelease [1724 B]
Get:6 http :// download. hiveos. farm/repo/binary Packages [440 kB]
Fetched 442 kB in 23s (19.2 kB/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
3 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
root@debianproxmoxgp96:/# serverupgrade
Current version: 0.6-212@191204
Hit:1 http :// download .hiveos .farm /repo/binary InRelease
Reading package lists… Done

Reading package lists… Done
Building dependency tree
Reading state information… Done
hive-lib is already the newest version (0.6-19).
hive-opt is already the newest version (0.6-52).
Recommended packages:
libgtk2.0-0 openbox menu obmenu lxterminal roxterm tint2 feh x11vnc fonts-inconsolata florence droptcpsock-dkms
The following packages will be upgraded:
hive hive-opt-algomap
2 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
Need to get 6142 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http: // download. hiveos. farm/repo/binary hive-opt-algomap 146 [12.8 kB]
Get:2 http: // download. hiveos. farm/repo/binary hive 0.6-213 [6129 kB]
Fetched 6142 kB in 8s (813 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = “pt_BR:pt:en”,
LC_ALL = (unset),
LANG = “pt_BR.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
(Reading database … 24818 files and directories currently installed.)
Preparing to unpack …/hive-opt-algomap_146_amd64.deb …
Unpacking hive-opt-algomap (146) over (142) …
Preparing to unpack …/hive_0.6-213_amd64.deb …
Unpacking hive (0.6-213) over (0.6-212) …
Setting up hive-opt-algomap (146) …
Setting up hive (0.6-213) …
Running in chroot, ignoring request: daemon-reload
Running in chroot, ignoring request: restart
Running in chroot, ignoring request: stop

Updating grub
/hive/bin/selfupgrade: line 108: update-grub: command not found
System restart is required to get the effect
Checking miners packages
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages will be upgraded:
hive-miners-claymore
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 5534 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 Index of /repo/binary/ hive-miners-claymore 0.6-10 [5534 B]
Fetched 5534 B in 6s (922 B/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = “pt_BR:pt:en”,
LC_ALL = (unset),
LANG = “pt_BR.UTF-8”
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
(Reading database … 24819 files and directories currently installed.)
Preparing to unpack …/hive-miners-claymore_0.6-10_amd64.deb …
Unpacking hive-miners-claymore (0.6-10) over (0.6-09) …

Setting up hive-miners-claymore (0.6-10) …


Reading package lists… Done
Building dependency tree
Reading state information… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Upgrade to 0.6-213@220102 complete. Have a happy mining.
root@debianproxmoxgp96:/# echo 0 > /exitcode
root@debianproxmoxgp96:/# exit

Hive FS upgrade complete

Create FS archive
/bin/sh: 1: pxz: not found
tar: -: Função write falhou: Pipe quebrado
tar: Child returned status 127
tar: Error is not recoverable: exiting now
0,00 B 0:00:00 [0,00 B/s] [> ] 0%

Check FS archive
0,00 B 0:00:00 [0,00 B/s] [<=> ]xz: (stdin): Formato de arquivo não reconhecido
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Create Hive FS archive failed or FS size too small

In the source code of hive-upgrade.sh:

#!/usr/bin/env bash

BLACK=’\033[0;30m’

DGRAY=’\033[1;30m’

RED=’\033[0;31m’

BRED=’\033[1;31m’

GREEN=’\033[0;32m’

BGREEN=’\033[1;32m’

YELLOW=’\033[0;33m’

BYELLOW=’\033[1;33m’

BLUE=’\033[0;34m’

BBLUE=’\033[1;34m’

PURPLE=’\033[0;35m’

BPURPLE=’\033[1;35m’

CYAN=’\033[0;36m’

BCYAN=’\033[1;36m’

LGRAY=’\033[0;37m’

WHITE=’\033[1;37m’

NOCOLOR=’\033[0m’

SCRIPT_PATH=dirname $0

cd $SCRIPT_PATH

mydir=pwd

HIVE_REPO_URL=

SERVER_CONF=$mydir"/server.conf"

TMP_DIR=$mydir"/tmp"

new_ver=

cur_ver=

[[ -f $mydir"/VER" ]] && cur_ver=cat $mydir"/VER"

new_ver=curl -j -f -s https :// raw.githubusercontent .com/ minershive /hiveos-pxe-diskless /master /pxeserver /VER

if [[ $? -ne 0 || -z $new_ver || -z $cur_ver || $new_ver != $cur_ver ]]; then

echo "You package of Hiveos PXE server is outdate."

echo "Need upgrade Hiveos PXE server. Otherwise correct work is not guaranteed"

upgrade="y"

echo -n "Do you want to upgrade Hiveos PXE server package [Y/n]?"

read upg

[[ ! -z $upg ]] && upgrade=$(echo ${upg,,} | cut -c 1)

if [[ $upgrade == "y" ]]; then

    current_dir=`dirname $mydir`

    sudo curl -j -f -s https :// raw. githubusercontent. com/ minershive/ hiveos-pxe-diskless /master / pxe-setup.sh -o "/tmp/pxe-setup.sh"

    [[ $? -ne 0 ]] && "Download install script failed! Exit" && exit 1

    chmod +x /tmp/pxe-setup.sh

    exec sudo /tmp/pxe-setup.sh $current_dir

    exit 0

fi

fi

source $SERVER_CONF > /dev/null 2>&1

FS="$mydir/hiveramfs/$ARCH_NAME"

echo “> Upgrading HiveOS FS”

if [[ -z $HIVE_REPO_URL ]];then

echo -e "${RED}Hive repo URL not set. Run pxe-config.sh first${NOCOLOR}"

exit 1

fi

if [[ ! -f $FS ]];then

echo -e "${RED}Hive FS archive not found${NOCOLOR}"

exit 1

fi

dpkg -s pv > /dev/null 2>&1

if [[ $? -ne 0 ]]; then

apt update

apt install -y pv

fi

[[ -d $TMP_DIR ]] && rm -R $TMP_DIR

mkdir -p ${TMP_DIR}/root

cd ${TMP_DIR}/root

echo

arch_size=$(wc -c < $FS )

echo -e “> Extract Hive FS to tmp dir”

pv $FS | tar --lzma -xf -

echo

echo -e “> Chrooting to Hive FS”

echo

mount --bind /proc ${TMP_DIR}/root/proc

mount --bind /sys ${TMP_DIR}/root/sys

mount --bind /dev ${TMP_DIR}/root/dev

mount --bind /run ${TMP_DIR}/root/run

#exit

mv ./etc/resolv.conf{,.bak}

cp /etc/resolv.conf ./etc/resolv.conf

cat << EOF | chroot ${TMP_DIR}/root

export PATH="./:/hive/bin:/hive/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

echo “deb $HIVE_REPO_URL /” > /etc/apt/sources.list.d/hiverepo.list

apt update

serverupgrade

echo $? > /exitcode

EOF

umount ${TMP_DIR}/root/proc

umount ${TMP_DIR}/root/sys

umount ${TMP_DIR}/root/dev

umount ${TMP_DIR}/root/run

[[ $(cat ${TMP_DIR}/root/exitcode) != 0 ]] && echo -e “${RED}Hive FS upgrade failed${NOCOLOR}” && exit 1

rm ${TMP_DIR}/root/exitcode

touch ${TMP_DIR}/root/hive-config/.DISKLESS_AMD > /dev/null 2>&1

cd ${TMP_DIR}

rm -R ${TMP_DIR}/root/var/lib/apt/lists/*

echo

echo -e “${GREEN}Hive FS upgrade complete${NOCOLOR}”

echo

echo -e “> Create FS archive”

tar -C root -I pxz -cpf - . | pv -s $arch_size | cat > $ARCH_NAME

res=$?

#tar -C root --lzma -cpf - . | pv -s $(du -sb root | awk ‘{print $1}’) | cat > $ARCH_NAME

echo

echo -e “> Check FS archive”

pv $ARCH_NAME | tar -v -Jtf - | awk ‘{size+=$3} END {print size}’ > size

size=$(cat size)

if [[ $res -ne 0 || $size < 1000000000 ]];then

echo -e "${RED}Create Hive FS archive failed or FS size too small${NOCOLOR}"

cd $mydir

rm -R ${TMP_DIR}

exit 1

fi

size=$(echo $size | awk ‘{ $1 = $1/1024**2}1’)

echo

echo -e “${GREEN}Create FS archive successfull. Size of FS:${YELLOW} “$size” Mb${NOCOLOR}”

echo -e “${GREEN}Recommended size of tmpfs on the rigs: ${YELLOW}Not less than “$(( ${size%.*} + 250 ))” Mb${NOCOLOR}”

echo

back=$mydir"/backup_fs/"$(basename $FS)"."TZ=UTC date +'%y%m%d'".bak"

echo -e "> Backup old FS archive to "$back

[[ ! -d $mydir/backup_fs ]] && mkdir -p $mydir/backup_fs

pv $FS > $back

echo

echo -e “> Replacing old FS archive”

pv $ARCH_NAME > $FS

cd $mydir

rm -R ${TMP_DIR}

echo

echo -e “${GREEN}Update Hive FS successfull. To use updated HiveOS, reboot you rigs${NOCOLOR}”

exit 0

I solved with line 120.

This topic was automatically closed 416 days after the last reply. New replies are no longer allowed.