More
referral
Increase your income with Hive. Invite your friends and earn real cryptocurrency!

Hive OS Diskless PXE

,

@david1
I “solved” this issue because I had made a backup of the entire PXE server install directory before performing the upgrade to the PXE server, so I just restored from that backup and that was how I “fixed”/“solved” the issue.

It is rather unfortunate because I am not a programmer and I don’t really understand code when I read it (or even shell scripts for that matter), so I can’t even begin to remotely pin-point the source nor the root cause of the problem.

If I didn’t have my backup copy of the folder before performing the upgrade, I’m pretty sure that I’d be screwed and that I would need to use the disk image to bring the system back online until the PXE server update could be fixed so as to NOT cause a kernel panic.

It’s also a pity that the PXE server update DOESN’T automatically ask you if you want to backup your server first BEFORE running the upgrade, even if running the backup make take a while (it depends A LOT on how many files you have in your backup_fs folder.)

But yeah, that was the only way that I was able to “restore” or “fix” my system, was to restore from backup that I had made a while ago before I ran this PXE server update.

Hello. We have same problem here. First time using this method then no save or backup available…
Are you OK to share your backup folder with your farm config hide?
Thanks in advance for sharing @alpha754293 :pray:

Let me see what I can do about that.

I’ll have to figure out all of the various places where information specific to my setup/configuration is stored and I’ll have to figure out how to strip all of that information out from it as well.

In addition to that, the current state of my backup file right now is about 7.3 GB in size (which will likely be a bit too large for people to be able to download in a reasonable and/or sensible fashion), so I’ll have to delete some of the backups from the backup_fs folder to make it smaller and more portable for people to download and use as a way to restore their PXE server as the current and temporary fix to this kernel panic issue, unless someone knows of a way to unpack it and maybe patch the kernel that they’re using or whatever might be the root cause/issue that’s causing said kernel panic.

Either way, let me see what I can do.

I’ll also have to figure out a way to publish the file (e.g. a site or location where I can publish a multi-GB 7-zip file). (If people have suggestions, I’ll gladly entertain them/take a look at those said suggestions.)

Thanks.

edit
Here is the link to the file, which I’ll host on my Google drive for about a week:
https://drive.google.com/file/d/1sZmf2hgC_vp_ohA4V2WMHQpDBxpKa7Kc/view?usp=sharing

SHA256:
e6032a7b43e8cccfc6c2aec76ee9c1d21d7ea3de2261d2a7097821ccebc8b8b8

Total file size:
1,439,864,662 bytes

I think that I stripped out all of my own personal, config-specifc information out from there, so it should be sanitized now.

You will need to download 7-zip/p7zip for your system/distro and I trust that you guys can figure out how to do that for your specific installation/distro/etc. (Google it.)

I would recommend that you download it and extract it on your Desktop (e.g. ~/Desktop) for your OS and then you can move the files to wherever they need to go for your specific installation.

You SHOULD be able to overwrite your existing files (which is causing the kernel panic anyways), but if you want to be safe, you can always backup your files (7-zip/p7zip is GREAT for that) before moving the files from my archive/backup and overwriting your own files.

Once you’ve confirmed that you are able to get your PXE server back up and running, then you can probably safely delete the bad copy of the PXE server files anyways.

Also, I will note for everybody here that after you download and extract the files, and you move them to where they need to go – you WILL need to run pxe-config.sh again to set up your farm hash, PXE server IP address, and anything else that you might need to setup/re-configure.

The server should be as recent as 2021-07-30, at which point, you can run sudo ./hive-upgrade.sh and when it asks you if you want to update the PXE server, select No and you should be able to proceed with upgrading the OS itself without upgrading the software that runs the PXE server itself.

I will also recommend that you check the dnsmasq.conf file because I also found that when I ran the hive-upgrade.sh multiple times, it will append the settings to your /etc/dnsmasq.conf multiple times. So, you might have to also go in there and make sure that’s cleaned up as well. (Not sure WHY it’s doing that, but it was just a behaviour that I observed that has popped up recently.)

Last but not least, also before you reboot your mining rigs, you’ll also want to make sure that atftpd, nginx, and dnsmasq servers/services are running properly by checking their status with sudo systemctl status and make sure that there aren’t any issues with any of those services otherwise, your mining rig may not work.

For example, because I had the issues where hive-upgrade.sh apparently seemed to keep appending to my /etc/dnsmasq.conf file, so when I rebooted my mining rig, it would say something like either it can’t pick up whatever dnsmasq is serving (my DHCP is managed by something else). Or another issue that I found was that if the atftpd service wasn’t running properly because there was a port 69 conflict with dnsmasq, (run sudo lsof -i -P -n | grep :69 to check for that), the mining rig wasn’t able to pick up the PXE boot file from the atftpd server (it will say something like PXE boot file not found or something along those lines).

So you’ll also want to check and make sure that’s up and running properly as well.

(You can also use sudo lsof -i -P -n | grep atftpd and ... | grep dnsmasq as well to see which ports those services are actually using. On my system, atftpd wasn’t listed (the service exited, but it doesn’t seem to be having an issue running, so [shrug] - I dunno - it appears to working. I’m not going to mess with it. My rig boots up and to me, that’s all that matters. dnsmasq appears to be using port 69.)

So yeah, check that to make sure that it is all up and running and in good, working order and then, go ahead and try and reboot/start your mining rig(s).

These are the issues that I’ve found when I was trying to run this most recent update (that it caused).

Your mileage may vary and you might encounter other problems that I haven’t written about here, so hopefully, things will work out for you and your specific installation/set up.

Again, I WILL say though, HiveOS’ diskless PXE boot IS really cool and nifty. There are still other issues with it, but for what it’s worth, I STILL do find it useful despite those other issues.

1 Like

@alpha754293 THAAAAANKS SO MUCH
All working fine
Thanks really

No problem.

You’re welcome.

THANK YOU!

No problem.

You’re welcome.

Is it possible to setup an environment to update the NVIDIA Drivers? Like chroot the diskless filesystem and update it plus add a few of my own small apps? If so can you post instructions?
Thanks

When I’m installing on Ubuntu 16.04.7 LTS with the command

wget https://raw.githubusercontent.com/minershive/hiveos-pxe-diskless/master/pxe-setup.sh && sudo bash pxe-setup.sh

I get this error when I try to upgrade. Any ideas on how to solve this error updating?

Do you want to upgrade Hiveos PXE server package [Y/n]?
sudo: curl: command not found
/pxeserver/hive-upgrade.sh: line 44: Download install script failed! Exit: command not found
chmod: cannot access '/tmp/pxe-setup.sh': No such file or directory
sudo: /tmp/pxe-setup.sh: command not found

I found I had to install the application curl

sudo apt update
sudo apt install curl

I also had to make the tmp folder writable.

sudo chmod 777 /tmp/

This is cool - I normally just buy old second hand SSD drives but this is something to think about for flexibility.

I don’t know about updating the Nvidia drivers on the master PXE boot image, but there is probably a way to do that. You might have to repackage the Nvidia drivers into a .tar.xz file that the HiveOS PXE environment can then use, but I don’t see why not.

If you dissect /path/to/pxeserver/pxe-config.sh, you will see that there is a line in there that says:
NV_VER=nvidia-470.86.tar.xz, so I think that if you were to update that, you should be able to do it.

(It might take a bit of dissection for the setup and configuration scripts, but I don’t see why you wouldn’t be able to do it either.)

(Sidebar: You might also have to update the PXE boot parameters in /path/to/pxeserver/tftp/bios/menu.cfg along with /path/to/pxeserver/tftp/efi/grub.cfg)

And the same goes for where you want to add your own small apps.

For example, previously, the HiveOS PXE setup use to just use regular xz to compress and decompress the hiveramfs.tar.xz files.

Quite some time ago, I asked about and then modified my own pxe-config.sh where I had the system download pxz and I used pxz to compress the hiveramfs.tar.xz file in order to speed up the compression process (because the system that I am using for the PXE server doesn’t have a super power processor, so it used to take me almost 40 minutes to compress the hiveramfs.tar.xz file back up whenever I updated it.) Since I’ve modified my scripts (which it looks like that it’s been rolled back into the official diskless PXE script, they’ve now standardised on this (because when I download the new scripts, this is already included.)

Thus, to your point and question about including your own apps - absolutely you can.

Again, you just have to dissect their scripts to be able to do that.

Yeah. I prefer this approach because I have a centrally managed PXE boot image.

And so long as you take some of the necessary and (pre-)cautionary steps to secure that image (and/or periodically back it up), if say you have a security breach, it’s really easy to “repair” your mining rig (and/or your entire mining farm) by just rebooting your systems back to the secured, original PXE boot image and your mining rigs should be back up in a few minutes (as fast as it can reboot basically).

So this is an amazing feature and functionality and I kind of wished that more crypto YouTubers actually USED this feature more (and talked about it more) rather than just buying a bunch of cheap, low-capacity Kingston SATA SSDs and flashing the HiveOS image onto that.

@hiveon
Have you or anybody ever tried moving to using pixz instead of using pxz for the parallel compression and parallel decompression of the boot archive (i.e. moving from hiveramfs.tar.xz to hiveramfs.tpxz)?

I tried dissecting through the scripts and I can’t seem to find the part where the system knows to use tar to extract the hiveramfs.tar.xz file into tmpfs.

I’ve tried looking in /path/to/pxeserver/tftp and also in /path/to/pxeserver/hiveramfs and I wasn’t able to find where it codifies the instruction and/or the command to unpack the hiveramfs.tar.xz.

If you can provide some guidance as to where I would find that in the startup script, where it would instruct the client to decompress and unpack the hiveramfs.tar.xz, that would be greatly appreciated.

Thank you.

edit
I’ve implemented pixz now for both parallel compression and the creation of the boot archive hiveramfs.tpxz and the decompression of the same.

It replaces the boot archive hiveramfs.tar.xz.

The PXE server host, if you are running an Ubuntu PXE boot server, will need to have pixz installed (which you can get by running sudo apt install -y pixz, so it’s pretty easy to get and install.)

The primary motivation for this is on your mining rig, depending on the CPU that you have in it, but usually, at boot time, you will have excess CPU capacity, and therefore; if you can use a parallel decompression for the hiveramfs archive, then you can get your mining rig up and running that much quicker.

The side benefit that this has also produced is that in the management of the hiveramfs image on the PXE server, pixz worked out to be faster in the creation of the FS archive compared to pxz.

Tested on my PXE server which has a Celeron J3455 (4-core, 1.5 GHz base clock), it compressed the FS archive using pxz in 11 minutes 2 seconds whilst pixz was able to complete the same task (on a fresh install of the HiveOS PXE server) in 8 minutes 57 seconds. (Sidebar: For reference, previously, when using only xz (without the parallelisation), on my system, it would take somewhere between 40-41 minutes to create the FS archive.)

On my mining rig, which has a Core i5-6500T, it takes about 8.70 seconds to decompress hiveramfs.tpxz to hiveramfs.tar and then it takes about another 1.01 seconds to unpack the tarball file.

Unfortunately, I don’t have the benchmarking data for how long it took my mining rig to decompress and unpack hiveramfs.tar.xz file.

Here are the steps to deploying pixz, and using that to replace pxz.

On the PXE server, install pixz:
sudo apt install -y pixz

Run the pxe-config.sh to specify your farm hash, server IPv4 address, etc. and also the change the name of the FS archive from hiveramfs.tar.xz to hiveramfs.tpxz.

DO NOT RUN HiveOS update/upgrade yet still!!!

When it asks if you want to upgrade HiveOS, type n for no.

For safety/security, make a backup copy of the initial hiveramfs.tar.xz file that can be found in /path/to/pxeserver/hiveramfs.

(For me, I just ran sudo cp hiveramfs.tar.xz hiveramfs.tar.xz.backup.)

You will need to manually create the initial hiveramfs.tpxz file that the system will act upon next when you run the hive-upgrade.sh script.

To do that, run the following:

/path/to/pxeserver$ sudo mkdir -p tmp/root
/path/to/pxeserver$ cd tmp/root
/path/to/pxeserver/tmp/root$ cp ../../hiveramfs/hiveramfs.tar.xz .
/path/to/pxeserver/tmp/root$ tar --lzma -xf hiveramfs.tar.xz
/path/to/pxeserver/tmp/root$ tar -I pixz -cf ../hiveramfs.tpxz .
/path/to/pxeserver/tmp/root$ cd ..
/path/to/pxeserver/tmp/root$ cp hiveramfs.tpxz ../../hiveramfs
/path/to/pxeserver/tmp/root$ cd ../../hiveramfs
/path/to/pxeserver/hiveramfs$ cp hiveramfs.tpxz hiveramfs.tpxz.backup

Now, edit the pxe-config.sh:
at about line 51, it should say something like:
#adde pxz (typo included)

copy lines 51-53 and paste it after line 53

(basically, add an i so that where it says pxz now says pixz instead)
edit the lines to read:
#adde pixz
dpkg -s pixz > /dev/null 2>&1
[[ $? -ne 0 ]] && need_install="$need_install pixz"

save, quit

Run pxe-config.sh again.

DO NOT RUN HiveOS update/upgrade yet still!!!

Now, your farm hash, IP address, etc. should all have been set previously. Again, when it asks you if you want to upgrade HiveOS, type n for no.

Now, we are going to make a bunch of updates to hive-upgrade.sh.

(For me, I still use vi, but you can use whatever text editor you want.)

/path/to/pxeserver$ sudo vi hive-upgrade.sh
at line 71, add pixz to the end of the line so that the new line 71 would read:
apt install -y pv pixz

I haven’t been able to figure out how to decompress the hiveramfs.tpxz archive and unpack it in the same line.

(I also was unable to get pv working properly so that it would show the progress indicator, so if someone else who is smarter than I am can help figure that out, that would be greatly appreciated, but you can also remote into your PXE server again in another terminal window and run top to monitor your PXE server to make sure that it is working in the absence of said progress indicator.)

So the section starting at line 79 echo -e "> Extract Hive FS to tmp dir" now reads:

line80: #pv $FS | tar --lzma -xf -
line81: cp $FS .
line82: pixz -d $ARCH_NAME
line83: tar -xf hiveramfs.tar .
line84: rm hiveramfs.tar

Line84 is needed because otherwise, without it, when you go to create the archive, it will try to compress the old hiveramfs.tar in as well, and you don’t need that.

Now fast forward to the section where it creates the archive (around line 121) where it says:
line121: echo -e "> Create FS archive"
line122: #tar -C root -I pxz -cpf - . | pv -s $arch_size | cat > $ARCH_NAME
line123: tar -C root -I pixz -cpf - . | pv -s $arch_size | cat > $ARCH_NAME

(in other words, copy that line, paste it, comment out the old line, and add an i to the new line.)

line125 is still the old line where it used the single threaded xz compression algorithm/tool, which should be already commented out for you.

The rest of the hive-upgrade.sh should be fine. You shouldn’t have to touch/update the rest of it.

Now you can run hive-upgrade.sh:
/path/to/pxeserver$ sudo ./hive-upgrade.sh

and you can run it to check and make sure that it is copying the hiveramfs.tpxz from /path/to/pxeserve/hiveramfs to /path/to/pxeserver/tmp/root, decompressing the archive, and unpacking the files properly.

If it does that properly, then the updating portion of it should be running fine, without any issues (or none that I observed).

Then the next section that you want to check is to make sure that when it repacks and compresses the archive back up, that that should be working properly for you.

Again, it is useful/helpful to have a second terminal window open where you’ve ssh’d into the PXE server again, with top running so that you can make sure that the pixz process is working/running.

After that is done, you can reboot your mining rig to make sure that your mining rig is picking up the new hiveramfs.tpxz file is ok and that it is also successful in decompressing and unpacking the archive.

I have NO idea how it is doing that because normally, I would have to issue that as two separate commands, but again, it appears to be working with my mining rig.

shrug

It’s working.

I don’t know/understand why/how.

But I’m not going to mess with it too much to try and figure out why/how it works, because it IS working.

(Again, if there are other people who are smarter than I am that might be able to explain how it is able to decompress and unpack a .tpxz file, I would be interested in learning, but on the other hand, like I said, my mining rig is up with the new setup, so I’m going to leave it here.)

Feel free to ask questions if you would want to implement pixz so that you would have faster compression and decompression times.

If your PXE server is fast enough for you such that pxz is fast enough for you and this isn’t going to make enough of a difference for you, then that’s fine. That’s up to you.

For me, my PXE server, running on a Celeron J3455 is quite slow, so anything that I can do to speed things up a little bit is still a speed up.

Thanks.

HI. Can you share a link to image of latest Version 6.5 ?
I would like to install it localy on few machines because of kernel 5.15

Thank you

Hi there. I recently tried this and it worked great however I can’t get CPU mining to work when the machine PXE boots. Is there a way to enable this so I can mine XMR from a PXE boot machine is it just GPU mining?

Thanks

You can mine XMR with your CPU.

Set it up in your flight sheet.

(Add a second miner, make sure your XMR wallet and pool information is already set up and then you can set the cryptocurrency to XMR, give it your XMR wallet address, from wherever you might obtain one, the pool, and the miner that you want to use and away you go.)

I’ve done it before and it works.

(except for there’s another current issue that I am about to post about), but other than that, it works.

Sidebar, for the benefit of the team here:

Ever since I have implemented pixz for both parallel compression and decompression of the archive, whenever I’m updating the PXE boot server, I’ve now been able to cut the time it takes to prepare the hiveramfs archive file from ~40-41 minutes on my Celeron J3455 to 1 minutes and 41 seconds on my AMD Ryzen 9 5900HX (where I run Ubuntu in a virtual machine).

The AMD Ryzen 9 5900HX Ubuntu VM will usually take about 24.27 seconds to decompress the hiveramfs.tpxz file and then another 1 minute 8 seconds to unpack the tarball.

But this shows that depending on the processor that you’re using to host the PXE server, if it has a fast enough processor, the upgrade can be performed very quickly with pixz.

Just wanted to add an additional data point in terms of the amount of time savings that can be gained by switching to and using pixz instead of pxz or the original PXE boot script (where it had no parallelisation for neither the compression nor decompression side of things).

Thanks.

Hi, when i reboot the Diskless PXE Server, my rigs do not boot anymore over the network like there is no pxe server. Even when I rerun the pxe-config.sh script (It tells everything is ok and server is ready to work).
Does anybody else have this problem or knows how to fix it?