OS Live Replacement

Ultimate way to replace running Linux with Hive.

hive-replace

With this script you can replace your running Linux with Hive on the fly. You can run this on any standard Ubuntu, or other competitor mining OS (like e**os, s*os, …). Or this can be used to replace/upgrade system on a running Hive installation.

After successful writing you will reboot with a new system. This is how it looks like.

Before you start

Ideally you should download system image ZIP file and VERSIONS.txt. Then make them available on your local network via HTTP, FTP, NFS, SMB (Windows). Yes, it’s possible to provide image URL from official repository but the download speed will be slow and as it was said it’s better to store it in local network.

If you run this from Hive then current rig.conf will be preserved. In other Linuxes FARM_HASH will be asked.

The best way to run this command is to use direct SSH connection (from other Linux/Mac or with Putty from Windows). ShellInABox should work. OpenVPN connection is also OK. Teleconsole connection will be closed so you will not see the progress.

WARNING: This command can potentially ruin your system installation. So please do some experiments when you are close the rig physically.

Usage Instructions

You need to update Hive form from web to get the latest script version.

If you are running other Linux then the script should be downloaded form Git repository.

cd /tmp
wget https://raw.githubusercontent.com/minershive/hiveos-linux/master/hive/sbin/hive-replace
chmod +x hive-replace

Here are the general usage instructions

Usage: hive-replace [option] <Path or URL to ZIP file with Hive OS image>

Options:
  -y|--yes                    Do not ask for confirmation, answer yes to all questions
  -f|--force                  Forced replace. Do not check the checksum of ZIP archive. Use with caution!
  --nfs                       To use NFS Shared resource. e.g.: IP_NFS_server:/shared_dir/hive_zip
  --smb                       To use Windows Shared resource. e.g.: //IP_Windows_comp/shared_folder/hive_zip
  --smbuser=Windows user      UserName for Windows Shared resource. Do not set this option for guest/anonymous access
  --smbpass=Windows password  Password for Windows Shared resource. Do not set this option for guest/anonymous access
  --hash=FARM_HASH            FARM_HASH from Web-interface
  -h|--help                   Show this message

Examples

Get image via HTTP

  hive-replace http://192.168.0.100/hiveos-0.6-01@181121.zip

Use locally downloaded file (though this has little sense it’s possible)

  hive-replace /tmp/hiveos-0.6-01@181121.zip

NFS network share

  hive-replace -y -f --hash=46e9602837d0bda99f0 --nfs 192.168.0.100:/home/john/hive/hiveos-0.6-01@181121.zip

Windows SMB share

  hive-replace -y -f --hash=46e9602837d0bda99f0 --smb --smbuser=winuser --smbpass=secret //192.168.0.100/shared_folder/hiveos-0.6-01@181121.zip
9 Likes

– reserved —

Хочу обратить особое внимание на использование данной утилиты через Teleconsole.

В связи с особенностями работы Teleconsole - вывод на экран прекратится перед началом записи нового образа.
После фразы
“Creating temporary root filesystem”

Но это не означает, что процесс окончен или прервался. Паниковать не надо. Если скрипт отработал до этого момента, то сюрпризов уже не будет, и вероятнее всего, все завершится успешно.
Нужно просто дождаться автоматической перезагрузки рига. Процесс может занимать довольно длительное время, особенно если запись идет на флешку.

1 Like

Насколько долго будет идти запись на флешку ? жду уже час и десять минут

Кто же вам ответит? Все зависит от флешки и ее состояния. Если флешка полуживая - процесс может вообще завершится неудачей.

Вчера человек написал - что флешка у него писалась около двух часов.

Поивет, напишите инструкцию как например записав на флешку образ приэтом разместить ее в одном риге дать команду остальным ригам обновить образ!?
Все риги работают через коммутатор, опыта в настройке сетевого диска особенно в линукс нет. Спасибо

С работающего хайва обновить образ на других ригах - вряд ли получится.
но вы вполне можете положить образ на один из ригов в zip архиве. В том же виде в котором он и раздается. И эту директорию расшарить по сети средствами NFS.
И на остальных ригах использовать этот образ по сети.
О том, как настроить сетевой доступ к директории средствами NFS под Ubuntu - гугл даст исчерпывающий ответ.

Just to be sure. Running “hive-replace http://192.168.x.xxx/hiveos-0.6-0x@xxxxxxx.zip” will replace the current install of Hive with the newest, including new Kernel and Drivers?

Yep, but if something goes wrong and you only have teleconsole u re screwed, also use real address to download hive from internet

возможно использовать эту утилиту для установки хайва на чистую ubuntu server ?

ну если вы понимаете что после этого получите на выходе HiveOS

Trying to start script hive-replace in Ubuntu 18.04
hive-replace command does’t work
when trying:
./hive-replace …
it works, but the answer is:
This script does not work in the local console. Exit

Any ideas?

The best way to run this command is to use direct SSH connection (from other Linux/Mac or with Putty from Windows). ShellInABox should work. OpenVPN connection is also OK. Teleconsole connection will be closed so you will not see the progress.

No ideas.
So conceived. The script has protection from launching from the local console.

PS:
If you have physical access to the rig (to the local console) - there are many other ways to write HiveOS

I have a physical access to the rig. I tried to set root password in Ubuntu - sudo passwd root.
But result the same.
This script does not work in the local console. Exit

I m tried to connect via ssh username@myrigip from MAC computer, but result the same:
This script does not work in the local console. Exit

1 Like

the script stripes all digit in DISK_NAME and my system drive is a nvme drive with digit causing it to fail.

I found by disabling X11 forwarding on my ssh client resolved this issue.

Doubt about something strange that occurred.
I was using version 4.13.16/AMD 18.10 and it was fine.
I was curious :rage: to see if there was any stability/hash improvement with newer drivers (20.30) and used the replace command to update the version.
What a nonsense, 20.30 is much worse/unstable and higher consumption for Polaris (RX580).
I re-recorded a new pendrive with the good old version, but strangely there was an increase in system consumption of exactly 80W on the wall.
Not cards, they are consuming exactly the same. Only the system has increased.
Same cards, same settings, same BIOS/settings on the motherboard.
Is there any adjustment to reduce consumption of the system that I had made on the old USB stick and forgot?